Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

tracing: ipv6: Add flow label to fib6_table_lookup tracepoint

The different parameters affecting the IPv6 route lookup are printed to
the trace buffer by the fib6_table_lookup tracepoint. Add the IPv6 flow
label for better observability as it can affect the route lookup both in
terms of multipath hash calculation and policy based routing (FIB
rules). Example:

# echo 1 > /sys/kernel/tracing/events/fib6/fib6_table_lookup/enable
# ip -6 route get ::1 flowlabel 0x12345 ipproto udp sport 12345 dport 54321 &> /dev/null
# cat /sys/kernel/tracing/trace_pipe
ip-358 [010] ..... 44.897484: fib6_table_lookup: table 255 oif 0 iif 1 proto 17 ::/12345 -> ::1/54321 flowlabel 0x12345 tos 0 scope 0 flags 0 ==> dev lo gw :: err 0

Reviewed-by: Petr Machata <petrm@nvidia.com>
Signed-off-by: Ido Schimmel <idosch@nvidia.com>
Reviewed-by: Guillaume Nault <gnault@redhat.com>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>

authored by

Ido Schimmel and committed by
Paolo Abeni
002bf68a d26b8267

+5 -3
+5 -3
include/trace/events/fib6.h
··· 22 22 __field( int, err ) 23 23 __field( int, oif ) 24 24 __field( int, iif ) 25 + __field( u32, flowlabel ) 25 26 __field( __u8, tos ) 26 27 __field( __u8, scope ) 27 28 __field( __u8, flags ) ··· 43 42 __entry->err = ip6_rt_type_to_error(res->fib6_type); 44 43 __entry->oif = flp->flowi6_oif; 45 44 __entry->iif = flp->flowi6_iif; 45 + __entry->flowlabel = ntohl(flowi6_get_flowlabel(flp)); 46 46 __entry->tos = ip6_tclass(flp->flowlabel); 47 47 __entry->scope = flp->flowi6_scope; 48 48 __entry->flags = flp->flowi6_flags; ··· 78 76 } 79 77 ), 80 78 81 - TP_printk("table %3u oif %d iif %d proto %u %pI6c/%u -> %pI6c/%u tos %d scope %d flags %x ==> dev %s gw %pI6c err %d", 79 + 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", 82 80 __entry->tb_id, __entry->oif, __entry->iif, __entry->proto, 83 81 __entry->src, __entry->sport, __entry->dst, __entry->dport, 84 - __entry->tos, __entry->scope, __entry->flags, 85 - __entry->name, __entry->gw, __entry->err) 82 + __entry->flowlabel, __entry->tos, __entry->scope, 83 + __entry->flags, __entry->name, __entry->gw, __entry->err) 86 84 ); 87 85 88 86 #endif /* _TRACE_FIB6_H */