diff mbox series

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

Message ID 20210202182513.325864-4-danieller@nvidia.com
State New
Headers show
Series Extend uAPI with lanes parameter | expand

Commit Message

Danielle Ratson Feb. 2, 2021, 6:25 p.m. UTC
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 <danieller@nvidia.com>
---

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 mbox series

Patch

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]);