[PATCH net-next v2 0/6] bnge: Support async events while down

From: Bhargava Marreddy

Date: Tue Sep 22 2026 - 01:30:51 EST


Hi,

This series refactors the bnge driver's Notification Queue 0 (NQ0)
lifecycle so that NQ0 remains persistent across interface close/open
cycles instead of being torn down and rebuilt each time.

This persistent NQ0 setup lays the groundwork for additional async events
in future patches.

v2:
- Dropped patch 7/7 ("bnge: Process async events while administratively down"):
- Link events while down are unnecessary to process since bnge_open() already
queries and updates PHY settings via bnge_update_phy_setting().
- Keeps the series focused strictly on the NQ0/NAPI lifecycle refactoring.
- Corrected the order of operations in bnge_quiesce_nq0() to disable NAPI
first, synchronize IRQ, and then ring the doorbell to prevent NAPI
rescheduling race conditions.
- Added support for dynamic MSI-X vector reallocation by introducing
bnge_reinit_nq0() during interface open.
- Fixed potential NULL pointer dereferences in core ring cleanups (e.g. bn->rx_ring,
bn->tx_ring, and bn->grp_info) on allocation failure paths and failed opens.
- Fixed a resource leak in bnge_init_nic() where RX ring pair buffers
were leaked if chip initialization failed.
- Corrected the MSI-X vector demand check in bnge_resc.c to ensure
sufficient vectors are allocated for both NQ0/aux and main rings.
- Changed CPU affinity hint failure from a fatal error to a warning.
- Added robust NULL pointer and safety checks in ring allocation and
cleanup paths to prevent potential kernel crashes on allocation failures.

v1: https://lore.kernel.org/all/20260901191728.643212-1-bhargava.marreddy@xxxxxxxxxxxx/

Bhargava Marreddy (6):
bnge: Extract bnapi allocation and cleanup into helpers
bnge: Extract per-NQ ring allocation and init helpers
bnge: Move bnapi and ring_grp allocation to probe/remove
bnge: Drop obsolete bn->bnapi NULL checks in open/close paths
bnge: Quiesce NQ0 around ring teardown in bnge_free_core()
bnge: Create NQ0 during probe and keep active across open/close

.../net/ethernet/broadcom/bnge/bnge_ethtool.c | 2 +-
.../net/ethernet/broadcom/bnge/bnge_netdev.c | 514 ++++++++++++++----
.../net/ethernet/broadcom/bnge/bnge_netdev.h | 11 +
.../net/ethernet/broadcom/bnge/bnge_resc.c | 2 +-
.../net/ethernet/broadcom/bnge/bnge_rmem.c | 26 +-
.../net/ethernet/broadcom/bnge/bnge_rmem.h | 4 +-
.../net/ethernet/broadcom/bnge/bnge_txrx.c | 15 +
7 files changed, 470 insertions(+), 104 deletions(-)

--
2.47.3