From: Simon Horman <simon.horman@corigine.com>
To: Jakub Kicinski <kuba@kernel.org>
Cc: davem@davemloft.net, netdev@vger.kernel.org, edumazet@google.com,
pabeni@redhat.com, Tariq Toukan <tariqt@nvidia.com>,
saeedm@nvidia.com, leon@kernel.org, brouer@redhat.com
Subject: Re: [PATCH net v2] net/mlx5e: do as little as possible in napi poll when budget is 0
Date: Thu, 18 May 2023 18:35:09 +0200 [thread overview]
Message-ID: <ZGZTvQheMsX4LzUx@corigine.com> (raw)
In-Reply-To: <20230517015935.1244939-1-kuba@kernel.org>
On Tue, May 16, 2023 at 06:59:35PM -0700, Jakub Kicinski wrote:
> NAPI gets called with budget of 0 from netpoll, which has interrupts
> disabled. We should try to free some space on Tx rings and nothing
> else.
>
> Specifically do not try to handle XDP TX or try to refill Rx buffers -
> we can't use the page pool from IRQ context. Don't check if IRQs moved,
> either, that makes no sense in netpoll. Netpoll calls _all_ the rings
> from whatever CPU it happens to be invoked on.
>
> In general do as little as possible, the work quickly adds up when
> there's tens of rings to poll.
>
> The immediate stack trace I was seeing is:
>
> __do_softirq+0xd1/0x2c0
> __local_bh_enable_ip+0xc7/0x120
> </IRQ>
> <TASK>
> page_pool_put_defragged_page+0x267/0x320
> mlx5e_free_xdpsq_desc+0x99/0xd0
> mlx5e_poll_xdpsq_cq+0x138/0x3b0
> mlx5e_napi_poll+0xc3/0x8b0
> netpoll_poll_dev+0xce/0x150
>
> AFAIU page pool takes a BH lock, releases it and since BH is now
> enabled tries to run softirqs.
>
> Reviewed-by: Tariq Toukan <tariqt@nvidia.com>
> Fixes: 60bbf7eeef10 ("mlx5: use page_pool for xdp_return_frame call")
> Signed-off-by: Jakub Kicinski <kuba@kernel.org>
> ---
> I'm pointing Fixes at where page_pool was added, although that's
> probably not 100% fair.
>
> v2:
> - don't call napi_complete_done()
> v1: https://lore.kernel.org/all/20230512025740.1068965-1-kuba@kernel.org/
Reviewed-by: Simon Horman <simon.horman@corigine.com>
next prev parent reply other threads:[~2023-05-18 16:35 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-05-17 1:59 [PATCH net v2] net/mlx5e: do as little as possible in napi poll when budget is 0 Jakub Kicinski
2023-05-17 2:04 ` Jakub Kicinski
2023-05-18 16:35 ` Simon Horman [this message]
2023-05-19 7:50 ` patchwork-bot+netdevbpf
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=ZGZTvQheMsX4LzUx@corigine.com \
--to=simon.horman@corigine.com \
--cc=brouer@redhat.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=kuba@kernel.org \
--cc=leon@kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=saeedm@nvidia.com \
--cc=tariqt@nvidia.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).