Re: [PATCH] net: ag71xx: switch to napi_build_skb() to reuse skbuff_heads

From: Jakub Kicinski
Date: Wed Jul 06 2022 - 22:52:26 EST


On Tue, 5 Jul 2022 08:44:34 +0800 Sieng-Piaw Liew wrote:
> --- a/drivers/net/ethernet/atheros/ag71xx.c
> +++ b/drivers/net/ethernet/atheros/ag71xx.c
> @@ -825,7 +825,7 @@ static int ag71xx_tx_packets(struct ag71xx *ag, bool flush)
> if (!skb)
> continue;
>
> - dev_kfree_skb_any(skb);
> + napi_consume_skb(skb, !flush);

!flush is not sufficient here, napi can be called with a budget of 0.