]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
rtnetlink: honor RTEXT_FILTER_SKIP_STATS in IFLA_STATS
authorAdrian Moreno <amorenoz@redhat.com>
Mon, 3 Nov 2025 15:40:04 +0000 (16:40 +0100)
committerJakub Kicinski <kuba@kernel.org>
Wed, 5 Nov 2025 00:07:37 +0000 (16:07 -0800)
commit105bae321862b3bac300c73748192ff61a5129cd
tree77cfe830bc1624a5379a1e7cd2b25720cbbcf8a6
parent255d75ef029f33f75fcf5015052b7302486f7ad2
rtnetlink: honor RTEXT_FILTER_SKIP_STATS in IFLA_STATS

Gathering interface statistics can be a relatively expensive operation
on certain systems as it requires iterating over all the cpus.

RTEXT_FILTER_SKIP_STATS was first introduced [1] to skip AF_INET6
statistics from interface dumps and it was then extended [2] to
also exclude IFLA_VF_INFO.

The semantics of the flag does not seem to be limited to AF_INET
or VF statistics and having a way to query the interface status
(e.g: carrier, address) without retrieving its statistics seems
reasonable. So this patch extends the use RTEXT_FILTER_SKIP_STATS
to also affect IFLA_STATS.

[1] https://lore.kernel.org/all/20150911204848.GC9687@oracle.com/
[2] https://lore.kernel.org/all/20230611105108.122586-1-gal@nvidia.com/

Signed-off-by: Adrian Moreno <amorenoz@redhat.com>
Reviewed-by: Toke Høiland-Jørgensen <toke@redhat.com>
Reviewed-by: Eric Dumazet <edumazet@google.com>
Reviewed-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
Link: https://patch.msgid.link/20251103154006.1189707-1-amorenoz@redhat.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
net/core/rtnetlink.c