From: Maxime Chevallier <maxime.chevallier@bootlin.com>
To: Julien Blais <webmaster@jbsky.fr>
Cc: thomas.petazzoni@bootlin.com, davem@davemloft.net,
kuba@kernel.org, netdev@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] mvneta: fix "napi poll" infinite loop
Date: Wed, 11 Sep 2024 14:41:06 +0200 [thread overview]
Message-ID: <20240911144106.034b2f4a@fedora.home> (raw)
In-Reply-To: <20240911112846.285033-1-webmaster@jbsky.fr>
Hello Julien,
On Wed, 11 Sep 2024 13:28:46 +0200
Julien Blais <webmaster@jbsky.fr> wrote:
> In percpu mode, when there's a network load, one of the cpus can be
> solicited without having anything to process.
> If 0 is returned to napi poll, napi will ignore the next requests,
> causing an infinite loop with ISR handling.
>
> Without this change, patches hang around fixing the queue at 0 and
> the interrupt remains stuck on the 1st CPU.
> The percpu conf is useless in this case, so we might as well remove it.
>
> Signed-off-by: Julien Blais <webmaster@jbsky.fr>
If this patch is a fix, you must also include a "Fixes" tag stating
which commit you are fixing. You must also include in the subject
whether you are targetting the "net-next" tree or "net". In your case,
this would be the "net" tree, that gathers the bugfixes.
> ---
> drivers/net/ethernet/marvell/mvneta.c | 5 ++++-
> 1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/net/ethernet/marvell/mvneta.c b/drivers/net/ethernet/marvell/mvneta.c
> index 3f124268b..b6e89b888 100644
> --- a/drivers/net/ethernet/marvell/mvneta.c
> +++ b/drivers/net/ethernet/marvell/mvneta.c
> @@ -3186,7 +3186,10 @@ static int mvneta_poll(struct napi_struct *napi, int budget)
>
> if (rx_done < budget) {
> cause_rx_tx = 0;
> - napi_complete_done(napi, rx_done);
> + if (rx_done)
> + napi_complete_done(napi, rx_done);
> + else
> + napi_complete(napi);
I don't quite get this patch. as napi_complete is just calling
napi_complete_done(napi, 0), so this is basically
if (rx_done != 0)
napi_complete_done(napi, rx_done);
else
napi_complete_done(napi, 0);
So, nothing actually changes.
Can you elaborate more on the issue you are facing ?
Thanks,
Maxime
next prev parent reply other threads:[~2024-09-11 12:41 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-09-11 11:28 [PATCH v2] mvneta: fix "napi poll" infinite loop Julien Blais
2024-09-11 12:41 ` Maxime Chevallier [this message]
2024-09-11 15:20 ` Jakub Kicinski
2024-09-11 18:45 ` Julien Blais
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=20240911144106.034b2f4a@fedora.home \
--to=maxime.chevallier@bootlin.com \
--cc=davem@davemloft.net \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=thomas.petazzoni@bootlin.com \
--cc=webmaster@jbsky.fr \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.