Thread (11 messages) flat view 11 messages, 2 authors, 2021-02-10
STALE2004d

Revision v2 of 2 in this series.

Revisions (2)
  1. v2 current
  2. v3 [diff vs current]

[PATCH ethtool v2 3/5] netlink: settings: Expose the number of lanes in use

From: Danielle Ratson <hidden>
Date: 2021-02-02 18:28:34
Subsystem: the rest · Maintainer: Linus Torvalds

Currently, the user does not have the information regarding how many lanes
are used when the link is up.

After adding a possibility to advertise or force a specific number of
lanes this information becomes helpful.

Expose the number of lanes in use if the information is passed from
kernel.

Signed-off-by: Danielle Ratson <redacted>
---

Notes:
    v2:
    	* Remove possibility for printing unknown lanes, as now unknown
    	  lanes attribute doesn't pass to netlink.

 netlink/settings.c | 6 ++++++
 1 file changed, 6 insertions(+)
diff --git a/netlink/settings.c b/netlink/settings.c
index 6cb5d5b..2ebe4c9 100644
--- a/netlink/settings.c
+++ b/netlink/settings.c
@@ -474,6 +474,12 @@ int linkmodes_reply_cb(const struct nlmsghdr *nlhdr, void *data)
 		else
 			printf("\tSpeed: %uMb/s\n", val);
 	}
+	if (tb[ETHTOOL_A_LINKMODES_LANES]) {
+		uint32_t val = mnl_attr_get_u32(tb[ETHTOOL_A_LINKMODES_LANES]);
+
+		print_banner(nlctx);
+		printf("\tLanes: %u\n", val);
+	}
 	if (tb[ETHTOOL_A_LINKMODES_DUPLEX]) {
 		uint8_t val = mnl_attr_get_u8(tb[ETHTOOL_A_LINKMODES_DUPLEX]);
 
-- 
2.26.2
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help