Thread (1 message) 1 message, 1 author, 2017-09-27

Re: [PATCH] IB/ipoib: Enable pkey and device name decoupling

From: Leon Romanovsky <hidden>
Date: 2017-09-27 15:01:40

Possibly related (same subject, not in this thread)

On Wed, Sep 27, 2017 at 12:32:48PM +0300, Yuval Shaia wrote:
quoted hunk
The sysfs "create_child" interface creates pkey based child interface but
derives the name from parent device name and pkey value.
This makes administration difficult where pkey values can change but
policies encoded with device names do not.

We add ability to create a child interface with a user specified name and a
specified pkey with a new sysfs "create_named_child" interface (and also
add a corresponding "delete_named_child" interface).

We also add a new module api interface to query pkey from a netdevice so
any kernel users of pkey based child interfaces can query it - since with
device name decoupled from pkey, it can no longer be deduced from parsing
the device name by other kernel users.

Signed-off-by: Mukesh Kacker <redacted>
Reviewed-by: Yuval Shaia <redacted>
Reviewed-by: Chien-Hua Yen <redacted>
Signed-off-by: Yuval Shaia <redacted>
---
 Documentation/infiniband/ipoib.txt        |  12 ++
 drivers/infiniband/ulp/ipoib/ipoib.h      |   3 +
 drivers/infiniband/ulp/ipoib/ipoib_main.c | 187 ++++++++++++++++++++++++++++++
 drivers/infiniband/ulp/ipoib/ipoib_vlan.c |  76 +++++++++++-
 4 files changed, 272 insertions(+), 6 deletions(-)
diff --git a/Documentation/infiniband/ipoib.txt b/Documentation/infiniband/ipoib.txt
index 47c1dd9818f2..1db53c9b2906 100644
--- a/Documentation/infiniband/ipoib.txt
+++ b/Documentation/infiniband/ipoib.txt
@@ -21,6 +21,18 @@ Partitions and P_Keys

     echo 0x8001 > /sys/class/net/ib0/delete_child

+  Interfaces with a user chosen name can be created in a similar
+  manner with a different name and P_Key, by writing them into the
+  main interface's /sys/class/net/<intf name>/create_named_child
+  For example:
+     echo "epart2 0x8002" > /sys/class/net/ib1/create_named_child
+
+   This will create an interfaces named epart2 with P_Key 0x8002 and
+   parent ib1. To remove a named subinterface, use the
+   "delete_named_child" file:
+
+     echo epart2 > /sys/class/net/ib1/delete_named_child
I doubt that delete_named_child is actually needed. You can use delete_child
on the pkey, which you used to create named child.

Maybe better to add support to rename child instead of introducing named
child concept?

Thanks

Attachments

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help