Thread (74 messages) 74 messages, 9 authors, 2018-05-19

[patch iproute2 rfc 2/2] devlink: introduce support for showing port number and split subport number

flat view
STALE3076d

From: Jiri Pirko <jiri@resnulli.us>
Date: 2018-03-23 06:36:01
Subsystem: devlink, the rest · Maintainers: Jiri Pirko, Linus Torvalds

From: Jiri Pirko <redacted>

Signed-off-by: Jiri Pirko <redacted>
---
 devlink/devlink.c            | 6 ++++++
 include/uapi/linux/devlink.h | 2 ++
 2 files changed, 8 insertions(+)
diff --git a/devlink/devlink.c b/devlink/devlink.c
index 952b7cabbccf..50fec26781f4 100644
--- a/devlink/devlink.c
+++ b/devlink/devlink.c
@@ -1725,9 +1725,15 @@ 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])
+		pr_out_uint(dl, "number",
+			    mnl_attr_get_u32(tb[DEVLINK_ATTR_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]));
+	if (tb[DEVLINK_ATTR_PORT_SPLIT_SUBPORT_NUMBER])
+		pr_out_uint(dl, "subport",
+			    mnl_attr_get_u32(tb[DEVLINK_ATTR_PORT_SPLIT_SUBPORT_NUMBER]));
 	pr_out_port_handle_end(dl);
 }
 
diff --git a/include/uapi/linux/devlink.h b/include/uapi/linux/devlink.h
index 5ea871c2739d..4a39ad2ecd08 100644
--- a/include/uapi/linux/devlink.h
+++ b/include/uapi/linux/devlink.h
@@ -243,6 +243,8 @@ enum devlink_attr {
 	DEVLINK_ATTR_DPIPE_TABLE_RESOURCE_UNITS,/* u64 */
 
 	DEVLINK_ATTR_PORT_FLAVOUR,		/* u16 */
+	DEVLINK_ATTR_PORT_NUMBER,		/* u32 */
+	DEVLINK_ATTR_PORT_SPLIT_SUBPORT_NUMBER,	/* u32 */
 
 	/* add new attributes above here, update the policy in devlink.c */
 
-- 
2.14.3
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help