Re: [PATCH net-next v2 0/3] Report netns cookie in FIB lookup tracepoints
flat view
From: Paolo Abeni <pabeni@redhat.com>
Date: 2026-10-13 10:26:01
On 10/8/26 15:31, Ido Schimmel wrote:
The fib:fib_table_lookup and fib6:fib6_table_lookup tracepoints do not
report the network namespace in which the lookup was performed, so
lookups performed in different namespaces cannot be told apart. The
recorded PID does not help either, as lookups in the receive path are
performed in softIRQ context.
This is a problem, for example, for netns-aware tracers [1] and
multi-ASIC systems where each ASIC and its ports reside in a separate
network namespace.
This patchset reports the network namespace cookie in both tracepoints,
as commit 27cb3de7f43a ("net: add net cookie for net device trace
events") did for the net device tracepoints. This allows filtering
lookups performed in a specific network namespace, for example:
# perf record -a -e fib:fib_table_lookup --filter 'net_cookie == 12'
The cookie of a given network namespace can be retrieved using "ip netns
cookie" [2].
Patch #1 reports the cookie in the IPv6 tracepoint, which is already
passed the network namespace.
Patch #2 passes the network namespace to fib_table_lookup() and from
there to the IPv4 tracepoint.
Patch #3 reports the cookie in the IPv4 tracepoint.Not intended to block the above (could be eventually a follow-up), but I'm wondering if you have considered adding a `net` (or net_cookie) field to the fib_table struct instead of passing the net as an additional argument to the lookup functions - AFAICS the latter are also called in critical path and the additional arg could be unneeded (very small) overhead. /P