From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.210.171 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796237814; b=B4rXlERrklWlRwQrBsZvHxYLMjqikFbdDO6AqvUZ+l4yI6mYBkoLKoLe0yYtGxhwPNBF bvxprcN46jkD+s+JWWBxKCNvigPkvNemeVICBaYE1f5BiB1CBGdZdHhrndqzqgXwzqaoJ FPk/p0Aafq0JX68kkPGh58VE5db64x4ulLUfeRDnWAsBuFOEdNB4Z8whmDWtwvOLtoO6D KyfSLORTPBpP12omy7S8ne+kJ6eylzAR6DthhfmDQzSotYVOxsVMUlFeWOW1OPQeCVgxC ett2QZTjX6i4weyyjAMKyRVSUp7yBDFKGxlQNvgHlnHIgyEYShgHQYveErNmHVsVR2Q== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796237814; h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature: X-Gm-Message-State:X-Gm-Gg:X-Received:Received:From:To:Cc:Subject: Date:Message-ID:X-Mailer:MIME-Version:Content-Transfer-Encoding; bh=wQUscHAnqG0G4/lG8V7OfYzoqGxjrkVZ+ImLcTu97zQ=; b=g3HHSsYswsOWOqQvuySs3bQzESxlKy1KBVS1J9k2FTyF98d0DeF8tLwhZ2a2kwiJVWHR AkXzYvBZog80ZVYO2rWJAM00gz3u5zhwyK+Z6BlNHy6Iwt82rl3IFuubanBb/XhfXQZiJ jj5JvVxULxdJ7FxhfWnDuWxjvdHCHnn9F3fL0fGNRdYDwVNeVv+x6Kgbjqz0h+98rFeL0 4cnyIsFOLaTuVu8X81iGY+EvJ/dq1SFZO0QN8VWQVJsSSTbcsxbBLVFNPAcME06Iv4GFV 8V8vpKCmg79UCSHHBCEDYBpGPCOGoeIY9tP4Zy3P0mBnY7wbvEewnBuEx1LHR0iXm9Q== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none header.from=dama.to; spf=none smtp.mailfrom=dama.to; dkim=pass header.d=dama-to.20260707.gappssmtp.com header.i=@dama-to.20260707.gappssmtp.com header.a=rsa-sha256 header.s=20260707 header.b=e41mj7L5; arc=none smtp.remote-ip=209.85.210.171 Received: from mail-pf1-f171.google.com (mail-pf1-f171.google.com [209.85.210.171]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 246D1606A322 for ; Wed, 2 Dec 2026 18:56:52 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 246D1606A322 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=dama.to Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=dama.to Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=dama-to.20260707.gappssmtp.com header.i=@dama-to.20260707.gappssmtp.com header.a=rsa-sha256 header.s=20260707 header.b=e41mj7L5 Received: by mail-pf1-f171.google.com with SMTP id d2e1a72fcca58-8d9a1df134eso1336961b3a.2 for ; Wed, 02 Dec 2026 10:56:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=dama-to.20260707.gappssmtp.com; s=20260707; t=1796237812; x=1796842612; 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=wQUscHAnqG0G4/lG8V7OfYzoqGxjrkVZ+ImLcTu97zQ=; b=e41mj7L5UEf/UYMtVzzSxYqCcMqVlH81qAPj8GHdvo2bxIyZ9JA/nKDA32btljluW4 dDG+SXEwKQYXPupCIwzChoZWWkzQMxwmErSYywS8n24ZwwZmLDTk7mvAME1nv6D35rhT 5uNmIdyf87U3ob6dsYQhrplmEZWpJXfZg0IxIf+Sxmdpi8lHATYSN3HUsSH1qFzWvMbF Gc6787kH4bGT+6KV07BiLyxnptWF+B/efEf4p3YSxyCqMWIDPP7Dp8hvviErZm/oDtD5 b/17/ZDVGTo5dAfXZdBdAlWG5xgngE6VqwAUj5iJAi4G4Nxsoslze2yHZ/DlUCHOAFkV 2Sdw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796237812; x=1796842612; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to:content-type; bh=wQUscHAnqG0G4/lG8V7OfYzoqGxjrkVZ+ImLcTu97zQ=; b=JUnWQt4/eCUtwwZSGRuifgxKlIrRJJC/pJcyO6cqAupWXnsI4e8HrZrL6LpgfMCGvX 2aPHV8S/LYeHuy45JXXXa4S3VZfiNx2BuWe5HtcEL2zp3o2+1nkU25JXXIMKRWqqDoCG s4xGnz+zUDgtVDSGdjVbhj5szRshLF+AEhCyV+C03H/aqr8P/s4YLS+2ONJ2qddM7jyN 2vJELR4j9+Gv9sOyAQl0EZCoEeOzeKxbkC8jp9O23kAgLcWlF8wRvNo26QrUTFZNXHj2 Tlu5KfJPjfHD+Jlz2pQS5gCrqdZh2kbrGm3HwOGn7LrIwFVLAK0sHuz3TnhzIFZkC2mt LHqw== X-Gm-Message-State: APuU4Z8CqTRNjZIDYxoRv6RnmKT53/ATVAptKCiipQ/rDtWsjZMLYd5j MA7fiMr6TuUUtEaEaxhGghfwD2E4zpejV0ow0MBM6NQ00e4k07teSKVm49Q4qltvsf11ZlMNxOX 6IPUJ X-Gm-Gg: AZFdTZcQR+pL3/8XitrjS9or4qUTLuNMsPrkcrvQ5U6FzkwT5HiEpMNpietANost1Wj 29J6XuGbyxmxWbJbN8jJl4tUxXUxvoZJI9qNdh8958sudaiGiheCnUAdvAd/dbQhjQEXIWXK8qW 7yC1KfgKAkx5GPJxAMB0EH0poSVikjXzHWs2sxMVeqwOa6DHz4EKEP4DsYAThBVK85Rb40l+mQF Yo9D37a/bKgflp7JY09KqRNtfH3ETxd6tM+lFe2q1o2enc3d7Mj413tykfjWTy727NGuC1BlXvW yl2NFqW1bTZMf3aWmqWmzWNkjNY6uKM172P3Bm5qtc4Kkj30n/mE6VN5KfwpYk30mqdlCU5elbQ 451NGULRXh+vnLgdokfTMZh0Ee76Hm7cu6d5FJdYdNMNSQ/wsTWUTNK4EKr/SUWta4dNjq4Emem hccvd8cjvM9xVS5YXHZY3SsoXkdupXXqbr+XOj38MeyWeCSPgBSnt3WBhmhWSYi5aCxPPi9XaE3 VOE1/XCENdh98q16yggSuq3Bn2lU+0r9di4q0ItSmG3ChQog2LbbGHQmREmrAh+pEpYHRwVAA+c PqYGXVqfBEflmkGHSMcPOD8+Bdpx5H3GD/8/+kc8z7k= X-Received: by 2002:a05:6a00:f8a:b0:8a0:20e0:b11f with SMTP id d2e1a72fcca58-8c87bac549fmr34203400b3a.20.1796237812241; Wed, 02 Dec 2026 10:56:52 -0800 (PST) Received: from localhost ([2a03:2880:2ff:47::]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-8c87285c219sm22506718b3a.18.2026.12.02.10.56.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 02 Dec 2026 10:56:51 -0800 (PST) From: Joe Damato To: netdev@vger.kernel.org Cc: michael.chan@broadcom.com, pavan.chebbi@broadcom.com, selvin.xavier@broadcom.com, kalesh-anakkur.purayil@broadcom.com, pabeni@redhat.com, kuba@kernel.org, edumazet@google.com, davem@davemloft.net, andrew+netdev@lunn.ch, horms@kernel.org, linux-kernel@vger.kernel.org, Joe Damato Subject: [PATCH net v7 0/4] bnxt_en: Make RING FREE more robust Date: Wed, 2 Dec 2026 10:56:21 -0800 Message-ID: <20261202185628.847699-1-joe@dama.to> X-Mailer: git-send-email 2.53.1 X-Mailing-List: netdev@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Greetings: On two production systems, I saw the following dmesg pattern: NETDEV WATCHDOG: transmit queue 0 timed out 6073 ms Resp cmpl intr err msg: 0x51 x20 hwrm_ring_free type 1 failed x12 hwrm_ring_free type 2 failed x8 AMD-Vi: IO_PAGE_FAULT x3 Since v6, I searched our fleet logs and found the same pattern, a TX timeout followed by RING_FREE failures, on two more hosts. This suggests that, for some currently unknown reason, TX completions stall and the netdev watchdog fires. The driver asks FW to free the rings, this times out, but the driver ignores the possible failure and frees ring memory. Since the FW didn't respond to the ring free command, it is possible that the FW is still DMAing to the memory which was freed. To address this, this series makes the driver stop DMA before freeing ring memory when the firmware did not answer RING_FREE. Since the RFCv4, I found a third system that hit this repeatedly: NETDEV WATCHDOG: CPU: 35: transmit queue 0 timed out 5459 ms hwrm_ring_free type 1 failed. rc:fffffff0 err:0 x64 hwrm_ring_free type 2 failed. rc:fffffff0 err:0 x32 hwrm_ring_free type 0 failed. rc:fffffffb err:1 x64 hwrm_ring_alloc type 1 failed. rc:ffffffe4 err:4 hwrm_ring_free type 1 failed. rc:fffffff0 err:0 x44 Abandoning msg {0x51 0x3e35} len: 0 due to firmware status: 0x408100 nic open fail (rc: fffffffb) DMAR: [DMA Write NO_PASID] Request device [47:00.0] fault addr 0xffffa07ef000 [fault reason 0x05] PTE Write access is not set This case differs from the first two in a few ways, but this series would have still helped: - The ring frees fail on the close path and again on the error path of the reopen (bnxt_init_chip()), and the device then writes to memory the driver has already unmapped. The series stops DMA on both paths. - The interface came back up later, the watchdog fired again, and the cycle started over. The host logged 79 DMAR write faults in about 20 hours. Patch 4 breaks this loop by refusing to reopen after DMA has been stopped. - The firmware answers each RING_FREE about 5 seconds late, after the driver has given up, and finally reports an error in its health register. Patch 2 does not treat these late responses as success because their sequence ids do not match. In this most recent case, I suspect the hardware is faulty, but the driver shouldn't hand memory back to the system while the device could still write to it. In all of the above cases, the IOMMU caught the error. If the system had no IOMMU or the IOMMU was in passthrough mode, data corruption or crash would have occurred. Sashiko does not appear to read cover letters, so each patch now has a note below the --- line listing what was already discussed. Sashiko pointed out a few issues which are real bugs but were not observed in production and I am leaving out of this series which only addresses an issue I've seen in production. In particular, I am leaving out: - the per queue paths (real, but not observed in production) - completion and nq failures are not counted as stuck (all rings fail in prod, have not observed only nq failures) - The polling path in __hwrm_send() probably needs a dma_rmb (sashiko pointed out this pre-existing issue that is probably unlikely but also unobserved) - bnxt_resume, bnxt_fw_reset_task, and bnxt_io_slot_reset all call pci_set_master without checking the DMA bit - bnxt_re is not notified when DMA is stopped. Patch 5 from v6 tried this but could deadlock against bnxt_close(). Michael and Kalesh agreed to drop it; the fix needs bnxt_re to stop using RTNL, which Broadcom is working on. Kalesh's reply wasn't on lore at the time of this writing so I can't link to it. All of the above was outlined in the threads about the v5 [1] and v6 [2]. Thanks, Joe [1]: https://lore.kernel.org/netdev/avIpEpoCYvLHYl3j@devvm20253.cco0.facebook.com/ [2]: https://lore.kernel.org/netdev/CACKFLik4WFi669cajW7e5d0rkLGEEZm404LVuN=6aAR_uH26oA@mail.gmail.com/ v7: - Dropped patch 5 (stop the ULP around the reset task). It could deadlock against bnxt_close(), see [2]. - Commit messages for patches 1, 2 and 4 updated after the v6 review. No code changes. - Added notes for Sashiko below the --- line of each patch. v6: https://lore.kernel.org/netdev/20261120152830.699712-1-joe@dama.to/ - Commit messages across all patches were updated and a new patch was added to the series, patch 5. - Patch 1: - Return the errno from hwrm_req_send instead of always -EIO. - Patch 2: - Respect BNXT_HWRM_CTX_SILENT for the new warning. - Read the valid byte with READ_ONCE(), then dma_rmb() before reading the rest of the response, including error_code. - Only check the response for HWRM_RING_FREE. HWRM_SELFTEST_IRQ and HWRM_RING_RESET keep the existing behavior. - Patch 3: - Count a ring as stuck only when no response arrived, not when the firmware replied with an error. - Don't stop DMA when BNXT_STATE_IN_FW_RESET or BNXT_STATE_FW_FATAL_COND is set. - Patch 4: - Add BNXT_STATE_DMA_STOPPED to BNXT_NO_FW_ACCESS() so HWRM commands sent after DMA is stopped fail right away instead of waiting for the timeout. - Patch 5 (new): - stop the ULP around bnxt_reset() and leave it stopped if DMA was stopped. The silent reset after a VF config change leaves the ULP running. v5: https://lore.kernel.org/netdev/20261106191423.4194081-1-joe@dama.to/ - Switched from RFC to actual submission - Patch 4 updated to use an un-used bit to make backporting easier. v4: https://lore.kernel.org/netdev/20260925174404.2789072-1-joe@dama.to/ - No changes to patch 1 or 2 - Patch 3: reworded the message logged when DMA is stopped, a rebind is what recovers the device, not a firmware reset. No functional change. - Patch 4 added which adds a new bit (BNXT_STATE_DMA_STOPPED) that is set when DMA is disabled. When this bit is set, the device requires user intervention to bring back up. v3: https://lore.kernel.org/netdev/20260923210744.3406861-1-joe@dama.to/ - No changes to patch 1 - Patch 2: Don't poll for the valid bit as Michael suggested. - Patch 3: bnxt_hwrm_ring_free now returns -EIO instead of stopping the device, so the remaining resources can be freed and the remaining commands can be sent before stopping the device, as Michael suggested. Note the switch to using pci_clear_master in this patch instead of pci_disable_device. This was done so that the normal shutdown paths can call pci_disable_device without generating a warning. v2: https://lore.kernel.org/netdev/20260922182405.1290749-1-joe@dama.to/ - No changes to patch 1 - Patch 2 from v1 dropped - Patch 2 in the v2 now checks the response and logs state before giving up - Patch 3 in the v2 disables the device to stop DMA before freeing ring memory RFCv1: https://lore.kernel.org/netdev/20260917233218.1160001-1-joe@dama.to/ Joe Damato (4): bnxt_en: return the RING_FREE status to callers bnxt_en: check HWRM response if completion never arrives bnxt_en: stop DMA before releasing rings the firmware did not free bnxt_en: refuse to open a device with stopped DMA drivers/net/ethernet/broadcom/bnxt/bnxt.c | 137 +++++++++++++----- drivers/net/ethernet/broadcom/bnxt/bnxt.h | 2 + .../net/ethernet/broadcom/bnxt/bnxt_hwrm.c | 47 +++++- 3 files changed, 145 insertions(+), 41 deletions(-) base-commit: c1c39137dcc3134010566ff29a81c93124efa539 -- 2.53.1-Meta