public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
From: Jiri Pirko <jiri@resnulli.us>
To: netdev@vger.kernel.org
Cc: stephen@networkplumber.org, dsahern@gmail.com
Subject: [PATCH iproute2-next 3/3] devlink: show devlink instance index in dev output
Date: Mon, 16 Mar 2026 16:44:18 +0100	[thread overview]
Message-ID: <20260316154418.625026-4-jiri@resnulli.us> (raw)
In-Reply-To: <20260316154418.625026-1-jiri@resnulli.us>

From: Jiri Pirko <jiri@nvidia.com>

Print devlink instance index in dev show output when
the kernel provides it.

Signed-off-by: Jiri Pirko <jiri@nvidia.com>
---
 devlink/devlink.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/devlink/devlink.c b/devlink/devlink.c
index 39b0fac098c8..730515a78950 100644
--- a/devlink/devlink.c
+++ b/devlink/devlink.c
@@ -4095,8 +4095,12 @@ static void pr_out_dev(struct dl *dl, const struct nlmsghdr *nlh,
 {
 	if ((tb[DEVLINK_ATTR_RELOAD_FAILED] && mnl_attr_get_u8(tb[DEVLINK_ATTR_RELOAD_FAILED])) ||
 	    (tb[DEVLINK_ATTR_DEV_STATS] && dl->stats) ||
-	     tb[DEVLINK_ATTR_NESTED_DEVLINK]) {
+	     tb[DEVLINK_ATTR_NESTED_DEVLINK] ||
+	     tb[DEVLINK_ATTR_INDEX]) {
 		__pr_out_handle_start(dl, tb, true, false);
+		if (tb[DEVLINK_ATTR_INDEX])
+			print_uint(PRINT_ANY, "index", " index %u",
+				   mnl_attr_get_uint(tb[DEVLINK_ATTR_INDEX]));
 		pr_out_reload_data(dl, tb);
 		pr_out_dev_nested(dl, nlh);
 		pr_out_handle_end(dl);
-- 
2.51.1


  parent reply	other threads:[~2026-03-16 15:44 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-16 15:44 [PATCH iproute2-next 0/3] devlink: show devlink instance index in dev output Jiri Pirko
2026-03-16 15:44 ` [PATCH iproute2-next 1/3] update kernel headers Jiri Pirko
2026-03-16 15:44 ` [PATCH iproute2-next 2/3] mnl: add fallback implementation for mnl_attr_get_uint() Jiri Pirko
2026-03-16 16:12   ` Stephen Hemminger
2026-03-17  8:17     ` Jiri Pirko
2026-03-18  2:31       ` David Ahern
2026-03-16 15:44 ` Jiri Pirko [this message]
2026-03-23  0:20 ` [PATCH iproute2-next 0/3] devlink: show devlink instance index in dev output patchwork-bot+netdevbpf

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=20260316154418.625026-4-jiri@resnulli.us \
    --to=jiri@resnulli.us \
    --cc=dsahern@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=stephen@networkplumber.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