Yan Zhai ba8de796ba net: introduce sk_skb_reason_drop function
Long used destructors kfree_skb and kfree_skb_reason do not pass
receiving socket to packet drop tracepoints trace_kfree_skb.
This makes it hard to track packet drops of a certain netns (container)
or a socket (user application).

The naming of these destructors are also not consistent with most sk/skb
operating functions, i.e. functions named "sk_xxx" or "skb_xxx".
Introduce a new functions sk_skb_reason_drop as drop-in replacement for
kfree_skb_reason on local receiving path. Callers can now pass receiving
sockets to the tracepoints.

kfree_skb and kfree_skb_reason are still usable but they are now just
inline helpers that call sk_skb_reason_drop.

Note it is not feasible to do the same to consume_skb. Packets not
dropped can flow through multiple receive handlers, and have multiple
receiving sockets. Leave it untouched for now.

Suggested-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: Yan Zhai <yan@cloudflare.com>
Acked-by: Jesper Dangaard Brouer <hawk@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
2024-06-19 12:44:22 +01:00
..
2024-05-29 09:25:15 -07:00
2024-06-14 19:08:50 -07:00
2024-06-10 18:02:14 -07:00
2024-06-05 10:18:06 +01:00
2024-02-20 15:32:45 +01:00
2024-06-10 11:54:18 +01:00
2024-01-11 10:07:29 -08:00
2024-05-28 07:27:29 -07:00
2024-06-10 17:40:26 -07:00
2024-05-18 10:32:39 -07:00
2024-06-17 13:14:09 +01:00
2024-06-13 11:07:32 -07:00
2024-06-10 17:40:26 -07:00
2024-01-31 16:41:16 -08:00