From: Josef Bacik <josef@toxicpanda.com>
To: Tariq Toukan <tariqt@nvidia.com>
Cc: "Saeed Mahameed" <saeedm@nvidia.com>,
"Mark Bloch" <mbloch@nvidia.com>,
"Leon Romanovsky" <leon@kernel.org>,
"Andrew Lunn" <andrew+netdev@lunn.ch>,
"Jakub Kicinski" <kuba@kernel.org>,
"Björn Töpel" <bjorn@kernel.org>,
netdev@vger.kernel.org, linux-rdma@vger.kernel.org
Subject: Re: [PATCH net] net/mlx5e: Fix stalled channels with threaded NAPI
Date: Thu, 22 Oct 2026 12:56:49 +0000 [thread overview]
Message-ID: <17926738093796.1.mlx5e-threaded-napi-stall@toxicpanda.com> (raw)
In-Reply-To: <cd140948-317a-49d8-885e-0ded451195c6@nvidia.com>
On Thu, Oct 22, 2026 at 02:38:41PM +0300, Tariq Toukan wrote:
> The arm doorbell carries the consumer counter, and the device tracks the
> last index it reported an event for. Arming while CQEs posted after the
> last event are still unconsumed generates an event right away.
>
> The affinity path depends on exactly that, since commit a8c2eb15797a
> ("net/mlx5e: Stop NAPI when irq balancer changes affinity").
>
> Event moderation can delay that event, but not drop it.
>
> So the root analysis doesn't match the mlx5 device behavior.
The CQ has a backlog much deeper than one poll, about 6900 CQEs in the
run in the changelog. The thread polls 64, is off the IRQ's CPU,
completes and arms. There are CQEs posted after the last event, so the
event comes right away, and the device now remembers the current
producer index. The thread polls another 64, completes and arms again.
If nothing has arrived in between there is no CQE posted after the last
event, only older ones that are still unconsumed, so there is no event.
The rest of the backlog waits for the next arrival.
That matches the counters of the stalled channel. It had 0 polls and 0
events for 150 seconds. New connections then gave it 16 events, 16
polls and 1018 packets, so one poll of 64 per event. It was armed the
whole time, it just took a new completion to get an event. Then nothing
for 14 seconds, then 93 polls and 5917 packets, and it was empty.
Is that how the device behaves, no event on arm when everything that is
unconsumed was posted before the last event? That part is my reading of
your description, I haven't got a way to check it.
> Is it a degradation? Did you have any "good"/working version?
I don't know. I've only run threaded NAPI on these machines on the
7.3-rc5 based kernel, I have no older kernel that I know to be good.
> If arming really doesn't raise an event here, softirq NAPI would stall
> the same way when the IRQ affinity changes under load, for example by
> irqbalance.
> Was it seen there too? I believe not, so it must be something else
> causing the stall...
I haven't seen it there, and I haven't tried changing the affinity under
load. If the above is right I wouldn't expect it. With softirq the
path is taken once, that arm raises the event, the interrupt lands on
the new CPU, and from then on the check passes and the poll goes on
until the CQ is empty without arming again. A NAPI thread takes the
path at every poll, so it needs a second event for a backlog that the
first one already covered.
I'll fix the changelog and the comment in v2 once I know I've got the
device's side of it right, and move the check into
mlx5e_channel_no_affinity_change() as Jakub asked.
Thanks,
Josef
next prev parent reply other threads:[~2026-10-22 13:00 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-21 17:37 [PATCH net] net/mlx5e: Fix stalled channels with threaded NAPI Josef Bacik
2026-10-21 17:47 ` sashiko-bot
2026-10-21 19:10 ` Björn Töpel
2026-10-21 20:49 ` Jakub Kicinski
2026-10-22 11:38 ` Tariq Toukan
2026-10-22 12:56 ` Josef Bacik [this message]
2026-10-22 13:51 ` Tariq Toukan
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=17926738093796.1.mlx5e-threaded-napi-stall@toxicpanda.com \
--to=josef@toxicpanda.com \
--cc=andrew+netdev@lunn.ch \
--cc=bjorn@kernel.org \
--cc=kuba@kernel.org \
--cc=leon@kernel.org \
--cc=linux-rdma@vger.kernel.org \
--cc=mbloch@nvidia.com \
--cc=netdev@vger.kernel.org \
--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