[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20190709163352.20371-1-parav@mellanox.com>
Date: Tue, 9 Jul 2019 11:33:52 -0500
From: Parav Pandit <parav@...lanox.com>
To: netdev@...r.kernel.org
Cc: stephen@...workplumber.org, jiri@...lanox.com, dsahern@...nel.org,
Parav Pandit <parav@...lanox.com>
Subject: [PATCH net-next iproute2] devlink: Show devlink port number
Show devlink port number whenever kernel reports that attribute.
An example output for a physical port.
$ devlink port show
pci/0000:06:00.1/65535: type eth netdev eth1_p1 flavour physical port 1
Acked-by: Jiri Pirko <jiri@...lanox.com>
Signed-off-by: Parav Pandit <parav@...lanox.com>
---
devlink/devlink.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/devlink/devlink.c b/devlink/devlink.c
index 559f624e..dba74e04 100644
--- a/devlink/devlink.c
+++ b/devlink/devlink.c
@@ -2806,6 +2806,11 @@ static void pr_out_port(struct dl *dl, struct nlattr **tb)
pr_out_str(dl, "flavour", port_flavour_name(port_flavour));
}
+ if (tb[DEVLINK_ATTR_PORT_NUMBER]) {
+ uint32_t port_number =
+ mnl_attr_get_u32(tb[DEVLINK_ATTR_PORT_NUMBER]);
+ pr_out_uint(dl, "port", port_number);
+ }
if (tb[DEVLINK_ATTR_PORT_SPLIT_GROUP])
pr_out_uint(dl, "split_group",
mnl_attr_get_u32(tb[DEVLINK_ATTR_PORT_SPLIT_GROUP]));
--
2.19.2
Powered by blists - more mailing lists