Netdev List
 help / color / mirror / Atom feed
* [PATCH net-next 0/3] Report netns cookie in FIB lookup tracepoints
@ 2026-10-06 15:54 Ido Schimmel
  2026-10-06 15:54 ` [PATCH net-next 1/3] ipv6: Report netns cookie in fib6_table_lookup tracepoint Ido Schimmel
                   ` (3 more replies)
  0 siblings, 4 replies; 8+ messages in thread
From: Ido Schimmel @ 2026-10-06 15:54 UTC (permalink / raw)
  To: netdev
  Cc: davem, kuba, pabeni, edumazet, dsahern, horms, petrm, rostedt,
	daniel, ferenc, Ido Schimmel

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.

[1] https://lore.kernel.org/netdev/c28ded3224734ca62187ed9a41f7ab39ceecb610.camel@fejes.dev/
[2] https://lore.kernel.org/netdev/20260923161756.2914560-1-idosch@nvidia.com/

Ido Schimmel (3):
  ipv6: Report netns cookie in fib6_table_lookup tracepoint
  ipv4: Pass netns to fib_table_lookup()
  ipv4: Report netns cookie in fib_table_lookup tracepoint

 include/net/ip_fib.h        | 12 +++++++-----
 include/trace/events/fib.h  | 12 ++++++++----
 include/trace/events/fib6.h |  8 ++++++--
 net/core/filter.c           |  2 +-
 net/ipv4/devinet.c          |  3 ++-
 net/ipv4/fib_frontend.c     |  6 ++++--
 net/ipv4/fib_rules.c        |  2 +-
 net/ipv4/fib_semantics.c    |  2 +-
 net/ipv4/fib_trie.c         | 16 +++++++++-------
 9 files changed, 39 insertions(+), 24 deletions(-)

-- 
2.55.0


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

end of thread, other threads:[~2026-10-08 10:31 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-10-06 15:54 [PATCH net-next 0/3] Report netns cookie in FIB lookup tracepoints Ido Schimmel
2026-10-06 15:54 ` [PATCH net-next 1/3] ipv6: Report netns cookie in fib6_table_lookup tracepoint Ido Schimmel
2026-10-06 15:54 ` [PATCH net-next 2/3] ipv4: Pass netns to fib_table_lookup() Ido Schimmel
2026-10-07 23:16   ` netdev-bot+sashiko
2026-10-08 10:30     ` Ido Schimmel
2026-10-06 15:54 ` [PATCH net-next 3/3] ipv4: Report netns cookie in fib_table_lookup tracepoint Ido Schimmel
2026-10-07 12:34 ` [PATCH net-next 0/3] Report netns cookie in FIB lookup tracepoints Ferenc Fejes
2026-10-07 12:50   ` Ido Schimmel

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