Thread (2 messages) flat view 2 messages, 2 authors, 2021-06-11

Re: [PATCH iproute2-next v2] devlink: Add optional controller user input

From: David Ahern <hidden>
Date: 2021-06-11 02:41:34

On 6/7/21 1:24 PM, Parav Pandit wrote:
A user optionally provides the external controller number when user
wants to create devlink port for the external controller.

An example on eswitch system:
$ devlink dev eswitch set pci/0033:01:00.0 mode switchdev

$ devlink port show
pci/0033:01:00.0/196607: type eth netdev enP51p1s0f0np0 flavour physical port 0 splittable false
pci/0033:01:00.0/131072: type eth netdev eth0 flavour pcipf controller 1 pfnum 0 external true splittable false
  function:
    hw_addr 00:00:00:00:00:00

$ devlink port add pci/0033:01:00.0 flavour pcisf pfnum 0 sfnum 77 controller 1
pci/0033:01:00.0/163840: type eth netdev eth1 flavour pcisf controller 1 pfnum 0 sfnum 77 external true splittable false
  function:
    hw_addr 00:00:00:00:00:00 state inactive opstate detached

Signed-off-by: Parav Pandit <redacted>
Reviewed-by: Jiri Pirko <redacted>
---
changelog:
v1->v2: (addresssed comments from David)
 - split the command help output and man page to multiple lines to make it readable
---
 devlink/devlink.c       | 21 ++++++++++++++++++---
 man/man8/devlink-port.8 | 21 +++++++++++++++++++++
 2 files changed, 39 insertions(+), 3 deletions(-)
applied to iproute2-next, but ...
quoted hunk ↗ jump to hunk
@@ -3795,7 +3806,9 @@ static void cmd_port_help(void)
 	pr_err("       devlink port param set DEV/PORT_INDEX name PARAMETER value VALUE cmode { permanent | driverinit | runtime }\n");
 	pr_err("       devlink port param show [DEV/PORT_INDEX name PARAMETER]\n");
 	pr_err("       devlink port health show [ DEV/PORT_INDEX reporter REPORTER_NAME ]\n");
-	pr_err("       devlink port add DEV/PORT_INDEX flavour FLAVOUR pfnum PFNUM [ sfnum SFNUM ]\n");
+	pr_err("       devlink port add DEV/PORT_INDEX flavour FLAVOUR pfnum PFNUM\n"
+	       "                      [ sfnum SFNUM ]\n"
+	       "                      [ controller CNUM ]\n");

I put both of those lines on 1 since they fit within 80. Same below.

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