From: netdev-bot+sashiko@kernel.org
To: kuba@kernel.org
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, bjorn@kernel.org, joe@dama.to
Subject: Re: [PATCH net-next v2 7/7] eth: bnxt_en: restart Rx queues when their IRQ moves to another NUMA node
Date: Mon, 23 Nov 2026 03:52:53 +0000 [thread overview]
Message-ID: <179540597395.3135.10998884715226762162@kernel.org> (raw)
In-Reply-To: <20261120035214.369158-8-kuba@kernel.org>
Thank you for your contribution! Sashiko AI review found 3 potential
issue(s) to consider.
Critical: 0 · High: 3 · Medium: 0 · 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 close-on-error handling in bnxt_irq_affinity_update()
cannot work.
- [High] bnxt_irq_affinity_update() takes only the netdev instance lock
through bnxt_lock_sp() (bnxt.c:14636-14646: clear_bit(IN_SP_TASK);…
- [High] With this patch, PFs that support the queue API but run without
TPH restart their Rx queues when the IRQ moves to another NUMA node.
--
eth: bnxt_en: restart Rx queues when their IRQ moves to another NUMA node
This patch schedules the IRQ affinity sp work on every device that
supports the queue API, not only in TPH mode. bnxt_irq_affinity_update()
then restarts an Rx queue if the TPH Steering Tag changed or if the page
pool's nid no longer matches the IRQ's node. It also stops the loop when
a failed restart has closed the device.
> diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.c b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
> index c022fcb063482..e2a0fb2b614a2 100644
> --- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c
> +++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
[ ... ]
> @@ -14677,27 +14679,40 @@ static void bnxt_tph_update(struct bnxt *bp)
> goto unlock;
>
> for (i = 0; i < bp->rx_nr_rings; i++) {
> + struct bnxt_rx_ring_info *rxr = &bp->rx_ring[i];
> + bool new_tag = false, new_node = false;
> + int map_idx, err, nid;
> struct bnxt_irq *irq;
> - int map_idx, err;
> u16 tag;
>
> 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 (irq->tag != tag) {
> + if (!pcie_tph_set_st_entry(bp->pdev, irq->msix_nr, tag))
> + new_tag = true;
> + }
>
> - if (pcie_tph_set_st_entry(bp->pdev, irq->msix_nr, tag))
> + nid = READ_ONCE(bp->ring_nid[i]);
> + if (nid != NUMA_NO_NODE && rxr->page_pool->p.nid != nid)
> + new_node = true;
[Severity: High]
When bp->tph_mode is off, this new_node check alone now restarts the
queue. Does the restart quiesce the XDP TX ring that shares this Rx
queue's NAPI?
XDP requires combined rings. The XDP TX ring is attached to the Rx bnapi,
and its tx_int is bnxt_tx_int_xdp(). bnxt_queue_stop() calls
bnxt_tx_queue_stop(), which skips freeing and draining the TX ring when
TPH is off:
bnxt_tx_queue_stop() {
...
if (!bp->tph_mode)
continue;
bnxt_hwrm_tx_ring_free(bp, txr, true);
bnxt_hwrm_cp_ring_free(bp, txr->tx_cpr);
bnxt_free_one_tx_ring_skbs(bp, txr, txr->txq_index);
...
}
That leaves XDP_TX descriptors already posted to hardware in flight while
bnxt_queue_start() installs the clone's pools:
rxr->page_pool = clone->page_pool;
rxr->head_pool = clone->head_pool;
Those completions are processed later in bnxt_tx_int_xdp():
page_pool_recycle_direct(rxr->page_pool, tx_buf->page);
Wouldn't that recycle old-pool pages into the new pool? The same path
also rings the Rx doorbell with a tx_buf->rx_prod from the old ring.
Meanwhile, bnxt_queue_mem_free(old_mem) frees the old rx_buf_ring pages,
including XDP_TX head pages that hardware may still be reading. It then
calls page_pool_destroy() on the old pool, which DMA-unmaps the pages
that pool still tracks. Some of those pages may already have been
reposted to hardware Rx through the new pool.
Before this patch, bnxt only called netdev_rx_queue_restart() in TPH
mode, where the TX rings are freed during stop. Is it safe to reach this
restart on non-TPH devices that have XDP attached?
>
> + 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]
Can netdev_rx_queue_restart() return here safely once the device has
been closed?
If bnxt_queue_start() for new_mem hits an HWRM failure, it jumps to
err_reset and calls netif_close(dev), which leads to:
netif_close()
__dev_close_many()
bnxt_close()
bnxt_close_nic()
__bnxt_close_nic()
bnxt_free_mem(bp, true)
bnxt_free_rx_rings() <- destroys rxr->page_pool (new pool)
kfree(bp->rx_ring); bp->rx_ring = NULL;
Next, netdev_rx_queue_reconfig() takes its err_start_queue path. It does
not check whether the device is still running:
if (qops->ndo_queue_start(dev, qcfg_old, old_mem, rxq_idx)) {
...
}
err_free_new_queue_mem:
qops->ndo_queue_mem_free(dev, new_mem);
bnxt_queue_start(old_mem) then runs:
rxr = &bp->rx_ring[idx];
clone = qmem;
rxr->rx_prod = clone->rx_prod;
with bp->rx_ring set to NULL. Wouldn't this oops? Even if it didn't,
bnxt_queue_mem_free(new_mem) would call page_pool_destroy() a second
time on the new pool, which bnxt_free_rx_rings() has already destroyed.
The reverse order has the same problem. Suppose the new queue fails in
the MRU path without closing, and the rollback start for old_mem then
reaches err_reset. The close destroys the old pool, and
ndo_queue_mem_free(old_mem) destroys it again.
So whenever the device closes inside the restart, the new
BNXT_STATE_OPEN check doesn't seem to be reached safely.
This restart can now be triggered by any cross-node affinity change on a
queue-API PF, for example from irqbalance or a write to
/proc/irq/*/smp_affinity, not only by TPH Steering Tag changes.
[Severity: High]
Related to the above: which locks are held when this close happens?
bnxt_irq_affinity_update() takes only the netdev instance lock, through
bnxt_lock_sp():
bnxt_lock_sp() {
clear_bit(BNXT_STATE_IN_SP_TASK, &bp->state);
netdev_lock(bp->dev);
}
Unlike bnxt_rtnl_lock_sp(), it does not take RTNL. The err_reset path in
bnxt_queue_start() calls netif_close(dev), and __dev_close_many() begins
with:
ASSERT_RTNL();
might_sleep();
list_for_each_entry(dev, head, close_list) {
netpoll_poll_disable(dev);
call_netdevice_notifiers(NETDEV_GOING_DOWN, dev);
Wouldn't this trigger the RTNL assertion?
The NETDEV_GOING_DOWN and NETDEV_DOWN notifiers and rtmsg_ifinfo() would
also run without RTNL. That lets them race with other RTNL holders that
don't take this device's instance lock.
The new comment "Failing to start a new queue may close the device"
expects this close path. With this patch, it can be reached on every
BNXT_SUPPORTS_QUEUE_API PF, not only in TPH mode.
> continue;
> }
[ ... ]
--
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261120035214.369158-1-kuba%40kernel.org
next prev parent reply other threads:[~2026-11-23 3:52 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-20 3:52 [PATCH net-next v2 0/7] eth: bnxt_en: allocate memory on the right NUMA node Jakub Kicinski
2026-11-20 3:52 ` [PATCH net-next v2 1/7] eth: bnxt_en: order event data before setting the sp_event bit Jakub Kicinski
2026-11-22 20:20 ` Björn Töpel
2026-11-20 3:52 ` [PATCH net-next v2 2/7] eth: bnxt_en: follow explicitly set IRQ affinity when placing page pool Jakub Kicinski
2026-11-23 3:52 ` netdev-bot+sashiko
2026-11-20 3:52 ` [PATCH net-next v2 3/7] eth: bnxt_en: allocate per-queue SW state on the queue's NUMA node Jakub Kicinski
2026-11-20 3:52 ` [PATCH net-next v2 4/7] eth: bnxt_en: explicitly keep device-only memory on the device's node Jakub Kicinski
2026-11-20 3:52 ` [PATCH net-next v2 5/7] eth: bnxt_en: allocate fast path DMA rings on the queue's NUMA node Jakub Kicinski
2026-11-20 3:52 ` [PATCH net-next v2 6/7] eth: bnxt_en: add a local bp variable in the IRQ affinity notifier Jakub Kicinski
2026-11-20 3:52 ` [PATCH net-next v2 7/7] eth: bnxt_en: restart Rx queues when their IRQ moves to another NUMA node Jakub Kicinski
2026-11-21 2:18 ` Michael Chan
2026-11-23 3:52 ` netdev-bot+sashiko [this message]
2026-11-21 2:20 ` [PATCH net-next v2 0/7] eth: bnxt_en: allocate memory on the right " Michael Chan
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=179540597395.3135.10998884715226762162@kernel.org \
--to=netdev-bot+sashiko@kernel.org \
--cc=andrew+netdev@lunn.ch \
--cc=bjorn@kernel.org \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=horms@kernel.org \
--cc=joe@dama.to \
--cc=kuba@kernel.org \
--cc=michael.chan@broadcom.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=pavan.chebbi@broadcom.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