[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20241111165737.129c8d2b@kernel.org>
Date: Mon, 11 Nov 2024 16:57:37 -0800
From: Jakub Kicinski <kuba@...nel.org>
To: Breno Leitao <leitao@...ian.org>
Cc: "David S. Miller" <davem@...emloft.net>, Eric Dumazet
<edumazet@...gle.com>, Paolo Abeni <pabeni@...hat.com>, Simon Horman
<horms@...nel.org>, netdev@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH net-next v2 2/2] net: netpoll: flush skb pool during
cleanup
On Thu, 07 Nov 2024 07:57:07 -0800 Breno Leitao wrote:
> +static void skb_pool_flush(struct netpoll *np)
> +{
> + struct sk_buff_head *skb_pool;
> + struct sk_buff *skb;
> + unsigned long flags;
> +
> + skb_pool = &np->skb_pool;
> +
> + spin_lock_irqsave(&skb_pool->lock, flags);
> + while (skb_pool->qlen > 0) {
> + skb = __skb_dequeue(skb_pool);
> + kfree_skb(skb);
> + }
> + spin_unlock_irqrestore(&skb_pool->lock, flags);
skb_queue_purge_reason(... SKB_CONSUMED)
should be able to replace the loop
Powered by blists - more mailing lists