From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-vs1-f97.google.com (mail-vs1-f97.google.com [209.85.217.97]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id CE77D3314B7 for ; Tue, 22 Sep 2026 05:30:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.217.97 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1790055042; cv=none; b=qxyznVIPDnx3oTnZ8jmDHBZmrQEHssuMu5If7K6Vf2FNBme3kAh+hM0j5zoIxrfmpVu97HPnPMX59u0pyiH+ag67Va6sVBmp/myhB8wXK/dMiarCm9UHLHMxOYZIQ7Pvah/J/TULPbuEhxKQO2+JpoSvPs0LNAmkzir1vHbnGUc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1790055042; c=relaxed/simple; bh=Bbie4m0HNMWMQpApjQgU8Cz6XHFA01t9Ywz48rA3up4=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=QLQ7Ylr2U3U+VhcJ8tKPGsf8AEUxu2Ny9u5mWKuqb2M9fSbCiosdgmAX2/vetsK3AAPA46gjI1brQqhtp/3maoIjR5oYSucaNza6h1BpzFbwe329iBAvgyWeQ8toneI3XKJEPgdEW8HBw7/3nq/FWDvrAv+9iWxwzI6r/sSXCA4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=broadcom.com; spf=fail smtp.mailfrom=broadcom.com; dkim=pass (1024-bit key) header.d=broadcom.com header.i=@broadcom.com header.b=RY4Ac3PL; arc=none smtp.client-ip=209.85.217.97 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=broadcom.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=broadcom.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=broadcom.com header.i=@broadcom.com header.b="RY4Ac3PL" Received: by mail-vs1-f97.google.com with SMTP id ada2fe7eead31-782e0fc1e55so469649137.3 for ; Mon, 21 Sep 2026 22:30:38 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1790055037; x=1790659837; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:dkim-signature:x-gm-gg:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to:content-type; bh=ebnLov+Q2rs5repZqDCuiaG4HicuyOeFYO5yUX8XiEs=; b=ETH/OvECiZW4uokuKcEyseC/O0DB69WXEiEKyLf6JZr9dbMOyiVm8POLBULR6rdNxe 459B/970G65jY3tpQRtoJGKEzQmGR/PE0ruCx8wcAUN3AuMdFScYU8NQAzV9r2wgJbew fioCxNlfCqVpTBguNRnazaCjjFWkwwvRDdXl7N9LrjJ6mD+OVf45qlpGxIHjMTl9Rn1Y hZlF773asxhDOJiAErJ6i1zx74Gc4Lt8S0GSNbPenap+htFXMC9v61laSsnnfaS2mfnK 1J1gMpJBcSweN5Y3iTnifcaPPjlRH7n9IGUBAScA8eXXpkjYoGH7LikUikeQWYpsQq12 rdPg== X-Forwarded-Encrypted: i=1; AKwUvByWE8HaireDipS31mqXKDWHmPfVdBJgL89B5DUcb8a7vtIK8uNaZjgpzReDZsmY7S0pmTOkseIIXZMHAu4=@vger.kernel.org X-Gm-Message-State: AFuF++kkZHGP0HMzFr0O5CtLNBAjS9Jz2WUSVFIJktg/rl0nyFkwrTsl Zugbxal+dp7ub8j1fHRW9S6l4lhXeEfnPM3zNLkQzX4pN885MzoGArxWoUfeYEo7ueS9TEbd1o1 fGTeJHGCIu25b4B8/X7BAnbzH1urYrDfBpqOPI9RDi3wBEH89zAAO1UZ7OrXYFByTSeWoexZc21 wT1HsnJaFHuop4J2LbI+41CWMSP6lYopPL0FhPL4KmcjesAVDPRZ+Vio+I0t123mNZYbh9vBEi5 icFB+SdvWqOjxmQ/h92XOCWEA== X-Gm-Gg: AYBFou39k6CDgNmHHjyPQlA8ro3KsvmbmYxNjlhcle2dafW56v5PCwgW05htieB1ms8 ctdVvatHlte0tOPj1R956Chnj4GpPHldPC0QEMxPOuv5Bn/MDVGzuixDVTidmxyKgkqkJJwv+tQ 4/vZtuZQ9tiJaN/YjUq+Eb6ad3T4gjVpSvBBT9zbz97LXhJYCScacXrqU6nX21QdobUV6xYZHbH TnQqMk0ARb38HxdLIgP13z6Iw3+yy/wMC9UJgWqCzSUyeEo2Pz27lfHrSK1AeyBU2wQGXnpLmu1 IJ+1VfK17fHy95lUnd67pb0lmz9PFDcpdbEGbqQ7tVa1BgVZBmbuK1WnQufbpX0eDwf1qX8Omye M2N8tESkz0jcrijrt62Hqmvr0nhgrFMM/T+Q1Flj792UMe6wbJZvm1qfAsFcGUVmp0b9zcHF8Q8 nKfzA4FH3u4AaXuPfP40glTdpCbhYTj4NDejrdxqQdhRvn X-Received: by 2002:a05:6102:4b13:b0:7a1:f951:f307 with SMTP id ada2fe7eead31-7a55d79e3eamr5890266137.26.1790055036913; Mon, 21 Sep 2026 22:30:36 -0700 (PDT) Received: from smtp-us-east1-p01-i01-si01.dlp.protect.broadcom.com (address-144-49-247-125.dlp.protect.broadcom.com. [144.49.247.125]) by smtp-relay.gmail.com with ESMTPS id ada2fe7eead31-7ab19373022sm4894137.12.2026.09.21.22.30.36 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 21 Sep 2026 22:30:36 -0700 (PDT) X-Relaying-Domain: broadcom.com X-CFilter-Loop: Reflected Received: by mail-pj1-f69.google.com with SMTP id 98e67ed59e1d1-39de4e72b33so6845191a91.2 for ; Mon, 21 Sep 2026 22:30:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; t=1790055036; x=1790659836; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to:content-type; bh=ebnLov+Q2rs5repZqDCuiaG4HicuyOeFYO5yUX8XiEs=; b=RY4Ac3PLo5MPXj1i4zbyQ3ZKFOaVEUtiX5R6ixkM9PkiiwBOms6k/FMinlpoaI0wq5 sKdW5cshRoF4U6sut9jifljVq2u6NE1ahdSBQ3el2kdea8rcVsqV6Ftf5Z6JaW1Ncn58 BgX6fgUpFmIfvqXLJsxaREHWaa2bOB/Hml9rY= X-Forwarded-Encrypted: i=1; AKwUvBzf5d5JY46qhynmkV9Hn0ndLjs0KRKevpiWELldHJZIaGBgqIHbpolyYXkBn+kVsHIr1lcwicjKoB9XiNQ=@vger.kernel.org X-Received: by 2002:a17:90b:1805:b0:39e:6c6a:6570 with SMTP id 98e67ed59e1d1-3a07321be51mr35244a91.51.1790055035647; Mon, 21 Sep 2026 22:30:35 -0700 (PDT) X-Received: by 2002:a17:90b:1805:b0:39e:6c6a:6570 with SMTP id 98e67ed59e1d1-3a07321be51mr35220a91.51.1790055035183; Mon, 21 Sep 2026 22:30:35 -0700 (PDT) Received: from localhost.localdomain ([192.19.203.250]) by smtp.gmail.com with ESMTPSA id a92af1059eb24-144f29dc903sm2029025c88.3.2026.09.21.22.30.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 21 Sep 2026 22:30:34 -0700 (PDT) From: Bhargava Marreddy To: davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, andrew+netdev@lunn.ch, horms@kernel.org Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, michael.chan@broadcom.com, pavan.chebbi@broadcom.com, vsrama-krishna.nemani@broadcom.com, vikas.gupta@broadcom.com, Bhargava Marreddy Subject: [PATCH net-next v2 0/6] bnge: Support async events while down Date: Tue, 22 Sep 2026 10:58:58 +0530 Message-ID: <20260922052904.59237-1-bhargava.marreddy@broadcom.com> X-Mailer: git-send-email 2.47.3 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-DetectorID-Processed: b00c1d49-9d2e-4205-b15f-d015386d3d5e 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@broadcom.com/ 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