From: Jakub Kicinski <kuba@kernel.org>
To: Jesper Dangaard Brouer <jbrouer@redhat.com>
Cc: davem@davemloft.net, brouer@redhat.com, netdev@vger.kernel.org,
edumazet@google.com, pabeni@redhat.com, hawk@kernel.org,
ilias.apalodimas@linaro.org, linyunsheng@huawei.com,
Alexander Duyck <alexander.duyck@gmail.com>
Subject: Re: [PATCH net-next 1/3] net: skb: plumb napi state thru skb freeing paths
Date: Wed, 12 Apr 2023 21:20:59 -0700 [thread overview]
Message-ID: <20230412212059.1b7a3364@kernel.org> (raw)
In-Reply-To: <9ecc38df-a185-fc1f-e94e-cf0c1fef865f@redhat.com>
On Wed, 12 Apr 2023 11:29:08 +0200 Jesper Dangaard Brouer wrote:
> On 11/04/2023 22.17, Jakub Kicinski wrote:
> > We maintain a NAPI-local cache of skbs which is fed by napi_consume_skb().
> > Going forward we will also try to cache head and data pages.
> > Plumb the "are we in a normal NAPI context" information thru
> > deeper into the freeing path, up to skb_release_data() and
> > skb_free_head()/skb_pp_recycle().
> >
> > Use "bool in_normal_napi" rather than bare "int budget",
>
> The code was changed to "napi_safe", the desc should reflect this ;-)
Ah, sed would have been a better idea after all :)
> > the further we get from NAPI the more confusing the budget
> > argument may seem (particularly whether 0 or MAX is the
> > correct value to pass in when not in NAPI).
>
> I do like the code cleanup.
> It is worth explaining/mentioning that where budget==0 comes from?
>
> (Cc. Alex, please correct me.)
> My understanding is that this is caused by netconsole/netpoll (see
> net/core/netpoll.c func poll_one_napi()), which is a kernel (net)console
> debugging facility sending UDP packets via using only TX side of
> napi_poll. Thus, we are really trying to protect against doing these
> recycle tricks for when netpoll/netconcole is running (which I guess
> makes sense as we are likely printing/sending an OOPS msg over UDP).
Yup, that's correct. I'll add a sentence or two to that effect.
next prev parent reply other threads:[~2023-04-13 4:21 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-04-11 20:17 [PATCH net-next 0/3] page_pool: allow caching from safely localized NAPI Jakub Kicinski
2023-04-11 20:17 ` [PATCH net-next 1/3] net: skb: plumb napi state thru skb freeing paths Jakub Kicinski
2023-04-12 9:29 ` Jesper Dangaard Brouer
2023-04-13 4:20 ` Jakub Kicinski [this message]
2023-04-11 20:17 ` [PATCH net-next 2/3] page_pool: allow caching from safely localized NAPI Jakub Kicinski
2023-04-11 20:18 ` [PATCH net-next 3/3] bnxt: hook NAPIs to page pools Jakub Kicinski
2023-04-12 6:41 ` [PATCH net-next 0/3] page_pool: allow caching from safely localized NAPI Tariq Toukan
2023-04-12 6:56 ` Tariq Toukan
2023-04-13 4:18 ` Jakub Kicinski
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=20230412212059.1b7a3364@kernel.org \
--to=kuba@kernel.org \
--cc=alexander.duyck@gmail.com \
--cc=brouer@redhat.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=hawk@kernel.org \
--cc=ilias.apalodimas@linaro.org \
--cc=jbrouer@redhat.com \
--cc=linyunsheng@huawei.com \
--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).