ipv6: Report netns cookie in fib6_table_lookup tracepoint

The first argument of the tracepoint is a pointer to the network
namespace in which the FIB lookup was performed, but the tracepoint does
not report information about it in the associated trace record, making
it impossible to tell apart lookups performed in different namespaces.

Report the network namespace cookie, as commit 27cb3de7f4 ("net: add
net cookie for net device trace events") did for the net device
tracepoints.

Assisted-by: LLM
Reviewed-by: Petr Machata <petrm@nvidia.com>
Reviewed-by: Ferenc Fejes <ferenc@fejes.dev>
Signed-off-by: Ido Schimmel <idosch@nvidia.com>
Reviewed-by: David Ahern <dsahern@kernel.org>
Link: https://patch.msgid.link/20261008133158.1438907-2-idosch@nvidia.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
This commit is contained in:
Ido Schimmel 2026-10-08 16:31:56 +03:00 committed by Paolo Abeni
parent d538cc3ec0
commit ffe378c06c

View File

@ -34,6 +34,7 @@ TRACE_EVENT(fib6_table_lookup,
__field( u8, rt_type )
__array( char, name, IFNAMSIZ )
__array( __u8, gw, 16 )
__field( u64, net_cookie )
),
TP_fast_assign(
@ -76,13 +77,16 @@ TRACE_EVENT(fib6_table_lookup,
in6 = (struct in6_addr *)__entry->gw;
*in6 = res->nh->fib_nh_gw6;
}
__entry->net_cookie = net->net_cookie;
),
TP_printk("table %3u oif %d iif %d proto %u %pI6c/%u -> %pI6c/%u flowlabel %#x tos %d scope %d flags %x ==> dev %s gw %pI6c err %d",
TP_printk("table %3u oif %d iif %d proto %u %pI6c/%u -> %pI6c/%u flowlabel %#x tos %d scope %d flags %x ==> dev %s gw %pI6c err %d net_cookie %llu",
__entry->tb_id, __entry->oif, __entry->iif, __entry->proto,
__entry->src, __entry->sport, __entry->dst, __entry->dport,
__entry->flowlabel, __entry->tos, __entry->scope,
__entry->flags, __entry->name, __entry->gw, __entry->err)
__entry->flags, __entry->name, __entry->gw, __entry->err,
__entry->net_cookie)
);
#endif /* _TRACE_FIB6_H */