Thread View: linux.kernel.netdev
1 messages
1 total messages
Started by netdev-bot+sashiko
Tue, 20 Oct 2026 07:25
Re: [PATCH net-next v4 1/8] bnxt_en: Clear bp->total_irqs when disabling IRQs
Author: netdev-bot+sashiko
Date: Tue, 20 Oct 2026 07:25
Date: Tue, 20 Oct 2026 07:25
141 lines
12918 bytes
12918 bytes
Thank you for your contribution! Sashiko AI review found 2 potential
issue(s) to consider.
Critical: 0 ยท High: 0 ยท Medium: 1 ยท Low: 1
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).
- [Medium] The NULL bp->irq_tbl dereference is still reachable on AER
resume through bnxt_ulp_start().
- [Low] The commit message describes the new MSI-X behaviour too
narrowly, and an in-code comment is now stale.
--
bnxt_en: Clear bp->total_irqs when disabling IRQs
This patch clears bp->total_irqs, and a new bp->irq_tbl_size, every time
bp->irq_tbl is freed. It also makes the dynamic MSI-X paths skip
adjustments when bp->irq_tbl is NULL. The dynamic MSI-X table is now
sized to the FW maximum, and bnxt_io_resume() skips a duplicate
bnxt_init_int_mode() call.
> diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.c b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
> index 0682060b048ce..6edf998a4ba66 100644
> --- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c
> +++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
[ ... ]
> @@ -11690,6 +11699,8 @@ static void bnxt_clear_int_mode(struct bnxt *bp)
>
> kfree(bp->irq_tbl);
> bp->irq_tbl = NULL;
> + bp->total_irqs = 0;
> + bp->irq_tbl_size = 0;
> }
>
> int bnxt_reserve_rings(struct bnxt *bp, bool irq_re_init)
> @@ -11716,7 +11727,7 @@ int bnxt_reserve_rings(struct bnxt *bp, bool irq_re_init)
>
> if (irq_re_init && BNXT_NEW_RM(bp) && irqs_required != bp->total_irqs) {
> irq_change = true;
> - if (!pci_msix_can_alloc_dyn(bp->pdev)) {
> + if (!pci_msix_can_alloc_dyn(bp->pdev) || !bp->irq_tbl) {
> bnxt_ulp_irq_stop(bp);
> bnxt_clear_int_mode(bp);
> irq_cleared = true;
[Severity: Low]
Is this part of the commit message accurate?
In the AER path, if MSI-X capabilities change, bnxt_reserve_rings()
will initialize MSI-X if BNXT_NEW_RM() is true.
bnxt_clear_int_mode() now sets bp->total_irqs to 0, and irqs_required is
never 0. So once the interrupt mode has been cleared, the two values
always differ, and the new !bp->irq_tbl check takes the clear/re-init
branch.
After bnxt_io_slot_reset()->bnxt_clear_int_mode(), the call
bnxt_io_resume()->bnxt_reserve_rings(bp, true) seems to always
re-initialize MSI-X on BNXT_NEW_RM devices. That includes a
bnxt_ulp_irq_stop()/bnxt_ulp_irq_restart() cycle, and it happens whether
or not the capabilities changed.
The same thing happens outside AER. In bnxt_hwrm_if_change(), the
fw_reset/caps_change branch does:
/* IRQ will be initialized later in bnxt_request_irq()*/
bnxt_clear_int_mode(bp);
}
rc = bnxt_cancel_reservations(bp, fw_reset);
The following __bnxt_open_nic()->bnxt_reserve_rings(bp, true) now always
allocates MSI-X and calls bnxt_ulp_irq_restart(). When IN_FW_RESET is
not set, bnxt_ulp_irq_stop() also runs a second time, after the earlier
call in bnxt_hwrm_if_change().
Could the commit message describe this behaviour? The comment in
bnxt_hwrm_if_change() is also no longer correct for BNXT_NEW_RM devices.
Could it be updated too?
[ ... ]
> @@ -17755,7 +17766,7 @@ static void bnxt_io_resume(struct pci_dev *pdev)
> err = bnxt_open(netdev);
> } else {
> err = bnxt_reserve_rings(bp, true);
> - if (!err)
> + if (!err && !bp->irq_tbl)
> err = bnxt_init_int_mode(bp);
> }
> }
[Severity: Medium]
Can bp->irq_tbl still be NULL here while err is 0?
bnxt_init_int_mode() returns success without allocating the table when
total_vecs is 0:
total_vecs = bnxt_get_num_msix(bp);
max = bnxt_get_max_func_irqs(bp);
if (total_vecs > max)
total_vecs = max;
if (!total_vecs)
return 0;
bnxt_get_max_func_irqs() is derived from max_irqs and max_nqs or
max_cp_rings. bnxt_hwrm_func_qcaps() re-reads those values from FW at
the start of bnxt_io_resume(), and nothing enforces a lower bound. Both
bnxt_reserve_rings() (the irq_cleared branch) and the bnxt_init_int_mode()
call above can return 0 in this case. The same is true on legacy RM,
where bnxt_reserve_rings() returns early.
With the netdev down, err then stays 0, and bnxt_io_resume() calls
bnxt_ulp_start(). Take a registered RDMA ULP with
BNXT_EN_FLAG_ULP_STOPPED set and a non-zero msix_requested:
bnxt_ulp_start()
if (edev->ulp_tbl->msix_requested)
bnxt_fill_msix_vecs(bp, edev->msix_entries);
bnxt_fill_msix_vecs() then reads bp->irq_tbl[i].vector while bp->irq_tbl
is NULL.
This patch adds a "!err && bp->irq_tbl" guard to bnxt_ulp_irq_restart()
for the same state. Should bnxt_ulp_start(), or this check in
bnxt_io_resume(), get a matching bp->irq_tbl check?
The netif_running() branch looks safe, because
bnxt_open()->bnxt_setup_int_mode() returns -ENODEV when bp->irq_tbl is
NULL.
--
Sashiko AI review ยท https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261016064427.496944-1-michael.chan%40broadcom.com
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads