Skip to content

Commit 69716a2

Browse files
borkmanndavem330
authored andcommitted
ipv6, trace: fix tos reporting on fib6_table_lookup
flowi6_tos of struct flowi6 is unused in IPv6, therefore dumping tos on that tracepoint will also give incorrect information wrt traffic class. If we want to fix it, we need to extract it via ip6_tclass(flp->flowlabel). While for the same test case I get a count of 0 non-zero tos values before the change, they now start to show up after the change: # ./perf record -e fib6:fib6_table_lookup -a sleep 10 # ./perf script | grep -v "tos 0" | wc -l 60 Since there's no user in the kernel tree anymore of flowi6_tos, remove the define to avoid any future confusion on this. Fixes: b811580 ("net: IPv6 fib lookup tracepoint") Signed-off-by: Daniel Borkmann <daniel@iogearbox.net> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 95caf6f commit 69716a2

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

include/net/flow.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,14 +127,14 @@ struct flowi6 {
127127
#define flowi6_oif __fl_common.flowic_oif
128128
#define flowi6_iif __fl_common.flowic_iif
129129
#define flowi6_mark __fl_common.flowic_mark
130-
#define flowi6_tos __fl_common.flowic_tos
131130
#define flowi6_scope __fl_common.flowic_scope
132131
#define flowi6_proto __fl_common.flowic_proto
133132
#define flowi6_flags __fl_common.flowic_flags
134133
#define flowi6_secid __fl_common.flowic_secid
135134
#define flowi6_tun_key __fl_common.flowic_tun_key
136135
struct in6_addr daddr;
137136
struct in6_addr saddr;
137+
/* Note: flowi6_tos is encoded in flowlabel, too. */
138138
__be32 flowlabel;
139139
union flowi_uli uli;
140140
#define fl6_sport uli.ports.sport

include/trace/events/fib6.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ TRACE_EVENT(fib6_table_lookup,
3737
__entry->tb_id = tb_id;
3838
__entry->oif = flp->flowi6_oif;
3939
__entry->iif = flp->flowi6_iif;
40-
__entry->tos = flp->flowi6_tos;
40+
__entry->tos = ip6_tclass(flp->flowlabel);
4141
__entry->scope = flp->flowi6_scope;
4242
__entry->flags = flp->flowi6_flags;
4343

0 commit comments

Comments
 (0)