lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Wed,  6 Jan 2021 15:10:04 +0200
From:   Danielle Ratson <danieller@...lanox.com>
To:     netdev@...r.kernel.org
Cc:     mkubecek@...e.cz, f.fainelli@...il.com, kuba@...nel.org,
        andrew@...n.ch, mlxsw@...dia.com,
        Danielle Ratson <danieller@...dia.com>
Subject: [PATCH ethtool 3/5] netlink: settings: Expose the number of lanes in use

From: Danielle Ratson <danieller@...dia.com>

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@...dia.com>
Reviewed-by: Jiri Pirko <jiri@...dia.com>
---
 netlink/settings.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/netlink/settings.c b/netlink/settings.c
index 6cb5d5b..13a080c 100644
--- a/netlink/settings.c
+++ b/netlink/settings.c
@@ -474,6 +474,15 @@ 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);
+		if (val == 0 || val == (uint16_t)(-1) || val == (uint32_t)(-1))
+			printf("\tLanes: Unknown!\n");
+		else
+			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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ