Re: [PATCH v4 net-next] packet: add a generic drop reason for receive

From: Willem de Bruijn
Date: Mon Dec 04 2023 - 18:42:36 EST


Eric Dumazet wrote:
> On Mon, Dec 4, 2023 at 8:33 PM Yan Zhai <yan@xxxxxxxxxxxxxx> wrote:
> >
> > Commit da37845fdce2 ("packet: uses kfree_skb() for errors.") switches
> > from consume_skb to kfree_skb to improve error handling. However, this
> > could bring a lot of noises when we monitor real packet drops in
> > kfree_skb[1], because in tpacket_rcv or packet_rcv only packet clones
> > can be freed, not actual packets.
> >
> > Adding a generic drop reason to allow distinguish these "clone drops".
> >
> > [1]: https://lore.kernel.org/netdev/CABWYdi00L+O30Q=Zah28QwZ_5RU-xcxLFUK2Zj08A8MrLk9jzg@xxxxxxxxxxxxxx/
> > Fixes: da37845fdce2 ("packet: uses kfree_skb() for errors.")
> > Suggested-by: Eric Dumazet <edumazet@xxxxxxxxxx>
> > Suggested-by: Willem de Bruijn <willemdebruijn.kernel@xxxxxxxxx>
> > Signed-off-by: Yan Zhai <yan@xxxxxxxxxxxxxx>
> > ---
>
> Reviewed-by: Eric Dumazet <edumazet@xxxxxxxxxx>

Reviewed-by: Willem de Bruijn <willemb@xxxxxxxxxx>