Article View: linux.kernel.netdev
Article #18931Re: [PATCH net-next 6/6] eth: bnxt_en: restart Rx queues when their IRQ moves to another NUMA node
From: netdev-bot+sashiko
Date: Thu, 19 Nov 2026 03:21
Date: Thu, 19 Nov 2026 03:21
177 lines
14432 bytes
14432 bytes
Thank you for your contribution! Sashiko AI review found 3 potential
issue(s) to consider.
Critical: 0 · High: 2 · Medium: 1 · Low: 0
If you believe none of the issues are legitimate, please reply to each
issue of Medium severity or higher and explain why the AI is wrong.
If any of them are legitimate and you plan to respin, please let patchwork
know by including "pw-bot: cr" as a separate line at the end of your reply
(one such reply per series is enough).
- [High] The new error handling in bnxt_irq_affinity_update() cannot
work, and the path it targets oopses.
- [High] bnxt_irq_affinity_update() takes only the netdev instance lock,
via bnxt_lock_sp() (not bnxt_rtnl_lock_sp()), before calling…
- [Medium] The code restarts more queues than the commit message and the
new function comment describe ('Restart the Rx queues whose IRQ…
--
eth: bnxt_en: restart Rx queues when their IRQ moves to another NUMA node
This patch schedules the IRQ affinity update work on every device that
supports the queue API, instead of only when the TPH Steering Tag changes.
The work restarts an Rx queue when its page pool's nid differs from the
node of the CPU servicing the IRQ. After a failed restart it checks that
the device is still open.
> diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.c b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
> index 134b24842c4f2..5f4a8db1f8b58 100644
> --- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c
> +++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
[ ... ]
> @@ -14663,7 +14662,10 @@ static void bnxt_rtnl_unlock_sp(struct bnxt *bp)
> rtnl_unlock();
> }
>
> -static void bnxt_tph_update(struct bnxt *bp)
> +/* Restart the Rx queues whose IRQ moved, if the move changed the TPH
> + * Steering Tag or the node the queue memory should be allocated on.
> + */
> +static void bnxt_irq_affinity_update(struct bnxt *bp)
> {
> struct net_device *dev = bp->dev;
> int i;
[ ... ]
> @@ -14680,20 +14684,26 @@ static void bnxt_tph_update(struct bnxt *bp)
> map_idx = bnxt_cp_num_to_irq_num(bp, i);
> irq = &bp->irq_tbl[map_idx];
> tag = READ_ONCE(irq->new_tag);
> - if (irq->tag == tag)
> - continue;
> -
> - if (pcie_tph_set_st_entry(bp->pdev, irq->msix_nr, tag))
> + if (irq->tag != tag &&
> + !pcie_tph_set_st_entry(bp->pdev, irq->msix_nr, tag))
> + new_tag = true;
> + if (rxr->page_pool->p.nid != bnxt_cp_num_to_node(bp, i))
> + new_node = true;
[Severity: Medium]
The new function comment says only "Rx queues whose IRQ moved" are
restarted. Is that what this loop does?
An affinity notification for any one Rx IRQ queues
BNXT_IRQ_AFFINITY_SP_EVENT. This loop then compares every ring's
page_pool nid against bnxt_cp_num_to_node(bp, i), whether or not that
ring's IRQ moved.
For rings whose affinity was never set, bnxt_request_irq() leaves
ring_nid[i] as NUMA_NO_NODE. bnxt_cp_num_to_node() then falls back to:
cpu = cpumask_local_spread(n, dev_to_node(&bp->pdev->dev));
return cpu_to_node(cpu);
That result depends on cpu_online_mask at the time of the call.
After CPU hotplug (for example SMT disable or offlining CPUs), can this
fallback pick a different node from the one used at open? If so, moving
one unrelated IRQ would restart these other queues and move their memory
to the new default-spread node.
The comment in bnxt_request_irq() says this placement is "just a hint",
so the new node may not match where the IRQ actually runs.
> + if (!new_tag && !new_node)
> continue;
>
> - err = netdev_rx_queue_restart(dev, irq->ring_nr);
> + err = netdev_rx_queue_restart(dev, i);
> if (err) {
> netdev_err(dev, "RX queue restart failed: err=%d\n",
> err);
> + /* Failing to start a new queue may close the device */
> + if (!test_bit(BNXT_STATE_OPEN, &bp->state))
> + break;
[Severity: High]
If the restart fails because the device was closed, can this check ever
be reached? Here is the sequence I'm looking at:
bnxt_irq_affinity_update()
netdev_rx_queue_restart(dev, i)
netdev_rx_queue_reconfig()
ndo_queue_stop(old_mem) /* succeeds */
bnxt_queue_start(new_mem)
/* clone page_pool, rings and rx_tpa moved into bp->rx_ring[idx] */
bnxt_hwrm_rx_ring_alloc() fails -> err_reset
netif_close(dev)
bnxt_close()->bnxt_close_nic()->__bnxt_close_nic()
bnxt_free_mem(bp, true)
kfree(bp->rx_ring);
bp->rx_ring = NULL;
err_start_queue:
bnxt_queue_start(old_mem)
rxr = &bp->rx_ring[idx];
rxr->rx_prod = clone->rx_prod; /* bp->rx_ring is NULL */
Wouldn't this hit a NULL pointer dereference in the sp workqueue while
netdev_lock is held, before control returns to this check?
If that step were survived, err_free_new_queue_mem would call
ndo_queue_mem_free(dev, new_mem). That runs page_pool_destroy() and
bnxt_free_ring() a second time on resources bnxt_free_mem() already
released.
The commit message says "check that the device is still up after
errors", which relies on this path returning normally.
Before this patch the path ran only on TPH Steering Tag changes.
bnxt_irq_affinity_notify() now queues the work on every queue-API PF,
and any cross-node Rx IRQ move restarts a queue. irqbalance or a write
to /proc/irq/N/smp_affinity is enough to trigger it. An HWRM failure
during queue start is the only other precondition.
[Severity: High]
bnxt_irq_affinity_update() starts with bnxt_lock_sp(bp). That only takes
netdev_lock(bp->dev), not RTNL.
The new comment expects this restart to close the device. The close
happens via bnxt_queue_start() err_reset -> netif_close(dev) ->
netif_close_many() -> __dev_close_many(), which begins with:
ASSERT_RTNL();
might_sleep();
It then calls the NETDEV_GOING_DOWN notifiers, dev_deactivate_many(),
rtmsg_ifinfo() and the NETDEV_DOWN notifiers.
Doesn't all of that run without RTNL here? That would trigger the
assertion and race with other RTNL holders.
Would bnxt_rtnl_lock_sp()/bnxt_rtnl_unlock_sp() be more appropriate,
as bnxt_reset() uses?
The old bnxt_tph_update() used the same helper, but it only ran on TPH
tag changes. With this patch the path runs for any cross-node IRQ move
on a queue-API PF. In the same failure, the core rollback then hits the
NULL bp->rx_ring dereference described above.
> continue;
> }
>
> - irq->tag = tag;
> + if (new_tag)
> + irq->tag = tag;
> }
[ ... ]
--
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261118023905.3050661-1-kuba%40kernel.org
Technical Details
Message-ID:
<179505851274.3136.4469982545223123709@kernel.org>Path:
mbox-mo1.pugleaf.net!news-lax.pugleaf.net!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-366703-linux-kernel-netdev=dewy.ruReferences:
<20261118023905.3050661-7-kuba@kernel.org>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-366703-linux-kernel-netdev=dewy.ru From: netdev-bot+sashiko@kernel.org Newsgroups: linux.kernel.netdev Subject: Re: [PATCH net-next 6/6] eth: bnxt_en: restart Rx queues when their IRQ moves to another NUMA node Date: Thu, 19 Nov 2026 03:21:52 +0000 Organization: Usenet Network Message-ID: <179505851274.3136.4469982545223123709@kernel.org> References: <20261118023905.3050661-7-kuba@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Injection-Info: usenet.network; logging-data="2775912"; mail-complaints-to="abuse@usenet.network" Cancel-Lock: sha1:JIRYM23FmxaKmj8nNg0kJswT07c= sha256:AptrFF5tL7CRHq+tdZF8CDI97nyamY9yYTVxg78fiuw= sha1:SfsHpXrydR2zV13KHsPRtTUjrlQ= sha256:v4+F+AdCTP4O4lxmkRazfmZQNFj473nINv+cpts7Cks= List-ID: <netdev.vger.kernel.org> X-Mailpost-Empty-Hdrs: X-Spam-Level X-Received: from localhost (localhost [127.0.0.1]) by mail.dewy.ru (Postfix) with ESMTP id 6A35A111FA5; Thu, 19 Nov 2026 06:22:14 +0300 (MSK) X-Virus-Scanned: Debian amavisd-new at usenet.network X-Spam-Flag: NO X-Spam-Score: -3.4 X-Spam-Status: No, score=-3.4 tagged_above=-9999 required=6.31 tests=[DCC_REPUT_70_89=0.1, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (2048-bit key) header.d=kernel.org X-Received: from mail.dewy.ru ([127.0.0.1]) by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id KRa22AuED0e1; Thu, 19 Nov 2026 06:22:10 +0300 (MSK) X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-366703-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> X-Authentication-Results: OpenDMARC; dmarc=pass (p=quarantine dis=none) header.from=kernel.org X-Received: from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10]) by mail.dewy.ru (Postfix) with ESMTPS id 748A31154CA; Thu, 19 Nov 2026 06:22:01 +0300 (MSK) X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92]) by sea.lore.kernel.org (Postfix) with ESMTP id 424551673D1; Thu, 19 Nov 2026 03:21:56 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1 X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass; t=1795058514; b=yQD2aukEZum/AnT5l6tMlQFcMQ+9Lch0d2f5PKzwI80Y/DPkDdNN+1ZOpoyFv4gtkMCr HFFwslhHYoaiOga50NMdRsjZiH21x4QfJdlYQWqQ+6HVqKHXeJhrC4TGPD+OaGpVivEgi /d6OPd7Zc7F4eavaW0vKeEnlwl+pEAtlTK6HlDLZdOWolfygxxeaCtV/N8PYXHcpM3TrF x7J/YmQBGviVSB5U9MHM+iAEBerqBSBs4zV+A2tcPwofJAgwzh2gyQydm3deQmGHBFnKb 4diI9V2vKfgACO2+PDAhwIziTGDrcL4Tu/8x+bb/eaoxFFndjOMiPuyP/Gk5JwfdYdQ== X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795058514; h=X-Original-To:Received:Received:DKIM-Signature:Subject:From:To:Cc: Date:Message-ID:In-Reply-To:References:X-sashiko-severity: Content-Type:Content-Transfer-Encoding:X-Mailing-List:List-Id: List-Post:List-Help:List-Subscribe:List-Unsubscribe:List-Owner: Precedence:MIME-Version; bh=UyLUi1+1/tBeEtLf7/QqtxqCmuLdma61KC/Yyvt7xh0=; b=bKo3E1GZRLB7pbPu7NcLFrYJbthqeTpTMXnuaXklLhZWhR0lggmNdO6Vz1fg3k6IhUMZ fCmY1pAkrk4a8LXoZwMi+muGPBUPE66W2frLfzcHxuaIp4SjnEQFRh1Npy7i/8EHm44Bw M05O4dlfCu+B/MsocPoMjI/MJKB0XKh6A6S7/PG/L6MgGUWQzEbEBnyZ7Z0MP1gEVwyFN iuGL+WRXM8LyK38bjXbAsJxlrsaJzMVx/iZd4USC5EScebyZYV6BQo/6fqCxSCC6uc46i xwUJ0jIUEOIDFl8fVjQ5yTdTQuxSPomdLO5iFGJN0cWNfNc6YUvynrNZVmULKImY+3g== X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=O0cKBxlf; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1 X-Received: from localhost.localdomain (localhost [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A9468606A32A; Thu, 19 Nov 2026 03:21:54 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=O0cKBxlf X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1795058513; b=1yDPu68xZHkDd9MlVFTG0CytXLvJ7JlJiIHv9/a1+MTK4Hi/NlidL7++Q6pW65ui87AI 2+ANtPRpByRbL2aUzOp1mQA8cok9pB6t+qv+yVvNfu0gedXO1eHYvbU3kLd5utFk7sTYV IOia9W7+9gs+7vBsxRt2dR4/qSs2ads1UQUfeqK6CD05ozzRDSJhPbdZHpBvPwYEUfYXr yBCLRBMmZGgXfEBziHOqaO3W2NR8RZZaKvyBOgysn7LzpbxvUx9SYTmw30Qa6Xb9imCmA +njQcWWB/RnoiE4cWyDrB9RsyFG5HTP51IlRRb6UumBeL/gW4o1jd6AIN7vSjOhrd4g== X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795058513; h=Received:DKIM-Signature:Subject:From:To:Cc:Date:Message-ID: In-Reply-To:References:X-sashiko-severity:Content-Type: Content-Transfer-Encoding:MIME-Version; bh=UyLUi1+1/tBeEtLf7/QqtxqCmuLdma61KC/Yyvt7xh0=; b=WEzpik35AZomjvnq19wbrEWFwm45bF9Y55s35Pw4f++rDqRD7C6vh4OyXiWy6ovU2mWt kD1M1TDgDfWDLI4rp9slpL2VQwTvf2BTPz12v/n2EUmDB/qd3yBZNcUqdd2kR+cqINgD7 1hHQK+q4uVBrlsqKpZEZdxzF6DqOjZpt9InlUe2XRD65p+cfNJvsRpHhAoLo1lPIgrK8J oINv9S05In3jO4QfO9YW4Fs6glYBSPilM9kLtH1MxcOA0aMQeyu+Wc9HvWK9l6yMXVIe8 c50ibLMqLnK0D+MqAR1zwsoU+RSSt2TCNpdSPfMoO97xKPTaHtoG+r2hcr7lL/4e2Hw== X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=O0cKBxlf; arc=none smtp.remote-ip=100.103.45.18 X-Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id CA96E606A332 for <netdev@vger.kernel.org>; Thu, 19 Nov 2026 03:21:53 +0000 (UTC) X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3334D1F000C5; Thu, 19 Nov 2026 03:21:53 +0000 (UTC) X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1795058513; bh=UyLUi1+1/tBeEtLf7/QqtxqCmuLdma61KC/Yyvt7xh0=; h=Subject:From:To:Cc:Date:In-Reply-To:References; b=O0cKBxlfm6llXuek6UrBAPpH65cRdAj+i2KnpnTvzfpuU7YAgu9aikXR0BgPd4ugl jXkLFWzMAExskPfUKIp5gqgki/s4XbNEmMWkA0nThzuvZ3kjDUkPfn4pA76PmEFPOy RLIHn55UfyXw9tAodqSMnOGmMsdEKSHwl9Vqab0n3dycYMXxNYZfjBjHxXr1KVTYuJ LulDdcWuprIFzA2YdLhstmojelRTNJP6f9ODKVMknHFE5EQZaP0ZLABzOgVYbV/eaR NaGHtZSq7zElypEGOXcsFJfSOjEyhJ7ID6rVl0llfJ//skzebiM57CsXSHAtnA3CY0 pNOzdRkw3ltRw== X-Cc: davem@davemloft.net, michael.chan@broadcom.com, netdev@vger.kernel.org, edumazet@google.com, pabeni@redhat.com, andrew+netdev@lunn.ch, horms@kernel.org, pavan.chebbi@broadcom.com X-In-Reply-To: <20261118023905.3050661-7-kuba@kernel.org> X-sashiko-severity: High X-Mailing-List: netdev@vger.kernel.org X-List-Post: <mailto:netdev@vger.kernel.org> X-List-Help: <mailto:netdev+help@vger.kernel.org> X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org> X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org> X-List-Owner: <mailto:netdev+owner@vger.kernel.org> X-Precedence: list