Skip to content

Commit 002bf68

Browse files
idoschPaolo Abeni
authored andcommitted
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 <[email protected]> Signed-off-by: Ido Schimmel <[email protected]> Reviewed-by: Guillaume Nault <[email protected]> Signed-off-by: Paolo Abeni <[email protected]>
1 parent d26b826 commit 002bf68

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

include/trace/events/fib6.h

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ TRACE_EVENT(fib6_table_lookup,
2222
__field( int, err )
2323
__field( int, oif )
2424
__field( int, iif )
25+
__field( u32, flowlabel )
2526
__field( __u8, tos )
2627
__field( __u8, scope )
2728
__field( __u8, flags )
@@ -42,6 +43,7 @@ TRACE_EVENT(fib6_table_lookup,
4243
__entry->err = ip6_rt_type_to_error(res->fib6_type);
4344
__entry->oif = flp->flowi6_oif;
4445
__entry->iif = flp->flowi6_iif;
46+
__entry->flowlabel = ntohl(flowi6_get_flowlabel(flp));
4547
__entry->tos = ip6_tclass(flp->flowlabel);
4648
__entry->scope = flp->flowi6_scope;
4749
__entry->flags = flp->flowi6_flags;
@@ -76,11 +78,11 @@ TRACE_EVENT(fib6_table_lookup,
7678
}
7779
),
7880

79-
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",
81+
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",
8082
__entry->tb_id, __entry->oif, __entry->iif, __entry->proto,
8183
__entry->src, __entry->sport, __entry->dst, __entry->dport,
82-
__entry->tos, __entry->scope, __entry->flags,
83-
__entry->name, __entry->gw, __entry->err)
84+
__entry->flowlabel, __entry->tos, __entry->scope,
85+
__entry->flags, __entry->name, __entry->gw, __entry->err)
8486
);
8587

8688
#endif /* _TRACE_FIB6_H */

0 commit comments

Comments
 (0)