From: Eric Dumazet Date: Wed, 20 May 2026 10:30:43 +0000 (+0000) Subject: ll_map: add RTEXT_FILTER_NAME_ONLY to ll_link_get() and ll_init_map() X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=de91e928ff57bc11bdcf76c8d6d302fe788e0440;p=thirdparty%2Fiproute2.git ll_map: add RTEXT_FILTER_NAME_ONLY to ll_link_get() and ll_init_map() 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 Signed-off-by: David Ahern --- diff --git a/lib/ll_map.c b/lib/ll_map.c index 07937e27..21dd1249 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); }