Re: [PATCH v2 net-next 1/3] net: skb: introduce kfree_skb_with_reason()

From: Jakub Kicinski
Date: Fri Dec 31 2021 - 21:22:46 EST


On Fri, 31 Dec 2021 14:35:31 +0800 Menglong Dong wrote:
> > > void skb_release_head_state(struct sk_buff *skb);
> > > void kfree_skb(struct sk_buff *skb);
> >
> > Should this be turned into a static inline calling
> > kfree_skb_with_reason() now? BTW you should drop the
> > '_with'.
> >
>
> I thought about it before, but I'm a little afraid that some users may trace
> kfree_skb() with kprobe, making it inline may not be friendly to them?

Hm, there is a bpf sample which does that, but that's probably
not commonly used given there is a tracepoint. If someone is
using a kprobe they can switch to kprobing kfree_skb*reason().