From: Danielle Ratson <danieller@nvidia.com>
To: <netdev@vger.kernel.org>
Cc: <mkubecek@suse.cz>, <f.fainelli@gmail.com>, <kuba@kernel.org>,
<andrew@lunn.ch>, <mlxsw@nvidia.com>,
Danielle Ratson <danieller@nvidia.com>
Subject: [PATCH ethtool v3 3/5] netlink: settings: Expose the number of lanes in use
Date: Wed, 10 Feb 2021 15:48:38 +0200 [thread overview]
Message-ID: <20210210134840.2187696-4-danieller@nvidia.com> (raw)
In-Reply-To: <20210210134840.2187696-1-danieller@nvidia.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@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 --git a/netlink/settings.c b/netlink/settings.c
index c54fe56..e47a38f 100644
--- a/netlink/settings.c
+++ b/netlink/settings.c
@@ -473,6 +473,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
next prev parent reply other threads:[~2021-02-10 13:51 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-02-10 13:48 [PATCH ethtool v3 0/5] Extend uAPI with lanes parameter Danielle Ratson
2021-02-10 13:48 ` [PATCH ethtool v3 1/5] update UAPI header copies Danielle Ratson
2021-02-10 13:48 ` [PATCH ethtool v3 2/5] netlink: settings: Add netlink support for lanes parameter Danielle Ratson
2021-02-10 13:48 ` Danielle Ratson [this message]
2021-02-10 13:48 ` [PATCH ethtool v3 4/5] shell-completion: Add completion for lanes Danielle Ratson
2021-02-10 13:48 ` [PATCH ethtool v3 5/5] man: Add man page for setting lanes parameter Danielle Ratson
2021-02-14 22:01 ` [PATCH ethtool v3 0/5] Extend uAPI with " Michal Kubecek
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210210134840.2187696-4-danieller@nvidia.com \
--to=danieller@nvidia.com \
--cc=andrew@lunn.ch \
--cc=f.fainelli@gmail.com \
--cc=kuba@kernel.org \
--cc=mkubecek@suse.cz \
--cc=mlxsw@nvidia.com \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).