From: Tariq Toukan <tariqt@nvidia.com>
To: Josef Bacik <josef@toxicpanda.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 16:51:19 +0300 [thread overview]
Message-ID: <bf7ecec5-8bf4-47b0-bbf5-6dc8fa4e64d4@nvidia.com> (raw)
In-Reply-To: <17926738093796.1.mlx5e-threaded-napi-stall@toxicpanda.com>
On 22/10/2026 15:56, Josef Bacik wrote:
> 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.
>
I have to soften my previous reply: the immediate-event guarantee I
quoted covers CQEs posted after the last event, so it does not rule out
your scenario, where the leftover backlog was all reported by that
event. Your reading is consistent with the documentation and with your
counters.
I'm checking the exact behavior with our HW architects and will update
here, hopefully within a few days.
>> 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
prev parent reply other threads:[~2026-10-22 13:53 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
2026-10-22 13:51 ` Tariq Toukan [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=bf7ecec5-8bf4-47b0-bbf5-6dc8fa4e64d4@nvidia.com \
--to=tariqt@nvidia.com \
--cc=andrew+netdev@lunn.ch \
--cc=bjorn@kernel.org \
--cc=josef@toxicpanda.com \
--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 \
/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