On Fri, 6 Oct 2023 13:18:40 +0200 Daniel Borkmann wrote: > That should be possible with some work this way, agree. I've been toying a bit > more on this issue, and actually there is an even better way which would cleanly > solve all use cases and we likely would utilize it for bpf as well in future. > I wasn't aware of it before, but the drop reason actually has per-subsystem infra > already which so far only mac80211 and ovs makes use of. FWIW I'm not sure if leaning into the subsys specific error codes for something as core as TC is a good direction. I'd think that what matters to the user is was it an intentional policy drop or some form of an error / exception. More detailed info can come from stats. Maybe I'm overly conservative because I don't care about debugging mac80211 or ovs but do very much care about TC :) And I think Alastair (bpftrace) is working on auto-prettifying enums when bpftrace outputs maps. So we can do something like: $ bpftrace -e 'tracepoint:skb:kfree_skb { @[args->reason] = count(); }' Attaching 1 probe... ^C @[SKB_DROP_REASON_TC_INGRESS]: 2 @[SKB_CONSUMED]: 34 ^^^^^^^^^^^^ names!! Auto-magically. Which will no longer work with the "pack multiple values into the reason" scheme of subsys-specific values :( What I'm saying is that there is a trade-off here between providing as much info as possible vs basic user getting intelligible data..