Netdev List
 help / color / mirror / Atom feed
* [PATCH iproute2-next] ll_map: add RTEXT_FILTER_NAME_ONLY to ll_link_get() and ll_init_map()
@ 2026-05-20 10:30 Eric Dumazet
  2026-05-22 22:20 ` patchwork-bot+netdevbpf
  0 siblings, 1 reply; 2+ messages in thread
From: Eric Dumazet @ 2026-05-20 10:30 UTC (permalink / raw)
  To: David Ahern, Stephen Hemminger
  Cc: David S . Miller, Jakub Kicinski, Paolo Abeni, netdev,
	eric.dumazet, Eric Dumazet

iproute2 can spend considerable amount of time in ll_init_map()
or ll_link_get() to dump verbose netdev attributes, contributing
to RTNL pressure.

Add RTEXT_FILTER_NAME_ONLY new flag so that rtnl_fill_ifinfo()
limits its output to:

    - struct nlmsghdr
    - IFLA_IFNAME
    - IFLA_PROP_LIST (alternate names)

This is supported in linux 7.2+ (and ignored in old kernels).

RTNL avoidance should be automatically provided in upcoming
kernel patches.

Signed-off-by: Eric Dumazet <edumazet@google.com>
---
 lib/ll_map.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/lib/ll_map.c b/lib/ll_map.c
index 07937e27d4f6fb5506a3da6e9318270635224364..21dd124960a604b0cd8912a11e1808c0eec5dc3e 100644
--- a/lib/ll_map.c
+++ b/lib/ll_map.c
@@ -273,7 +273,8 @@ static int ll_link_get(const char *name, int index)
 		.n.nlmsg_type = RTM_GETLINK,
 		.ifm.ifi_index = index,
 	};
-	__u32 filt_mask = RTEXT_FILTER_VF | RTEXT_FILTER_SKIP_STATS;
+	__u32 filt_mask = RTEXT_FILTER_VF | RTEXT_FILTER_SKIP_STATS |
+			  RTEXT_FILTER_NAME_ONLY;
 	struct rtnl_handle rth = {};
 	struct nlmsghdr *answer;
 	int rc = 0;
@@ -393,7 +394,8 @@ void ll_init_map(struct rtnl_handle *rth)
 
 	if (rtnl_linkdump_req_filter(rth, AF_UNSPEC,
 				     RTEXT_FILTER_VF |
-				     RTEXT_FILTER_SKIP_STATS) < 0) {
+				     RTEXT_FILTER_SKIP_STATS |
+				     RTEXT_FILTER_NAME_ONLY) < 0) {
 		perror("Cannot send dump request");
 		exit(1);
 	}
-- 
2.54.0.631.ge1b05301d1-goog


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-05-22 22:19 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-20 10:30 [PATCH iproute2-next] ll_map: add RTEXT_FILTER_NAME_ONLY to ll_link_get() and ll_init_map() Eric Dumazet
2026-05-22 22:20 ` patchwork-bot+netdevbpf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox