From: Jakub Kicinski <kuba@kernel.org>
To: Breno Leitao <leitao@debian.org>
Cc: "David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Paolo Abeni <pabeni@redhat.com>, Simon Horman <horms@kernel.org>,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH net-next v2 2/2] net: netpoll: flush skb pool during cleanup
Date: Mon, 11 Nov 2024 16:57:37 -0800 [thread overview]
Message-ID: <20241111165737.129c8d2b@kernel.org> (raw)
In-Reply-To: <20241107-skb_buffers_v2-v2-2-288c6264ba4f@debian.org>
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
prev parent reply other threads:[~2024-11-12 0:57 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-11-07 15:57 [PATCH net-next v2 0/2] net: netpoll: Improve SKB pool management Breno Leitao
2024-11-07 15:57 ` [PATCH net-next v2 1/2] net: netpoll: Individualize the skb pool Breno Leitao
2024-11-07 15:57 ` [PATCH net-next v2 2/2] net: netpoll: flush skb pool during cleanup Breno Leitao
2024-11-12 0:57 ` Jakub Kicinski [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20241111165737.129c8d2b@kernel.org \
--to=kuba@kernel.org \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=horms@kernel.org \
--cc=leitao@debian.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).