From nobody Wed Aug 26 01:07:12 2026 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4hV61s2KCgz6qM4c for ; Wed, 26 Aug 2026 01:07:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "YR2" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4hV61r6mVGz42J7 for ; Wed, 26 Aug 2026 01:07:12 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1787706433; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=GTSpeg1plvJc6edPg1H2/GANSZ3bEiCaOBUx52Uyx34=; b=hwaP78ALVxMvTZc9+jjGJl1oSonoas/5I30yGC2YF8F/oAhwMCWqXnKM8QWAZ4QXcWOd25 MpqgxDZLcn6v9bEDc661CdWJanSCQtUG8sUsDDX+cVfj5EKecCLjWzO2fcPxhWr6eEQVaA LAufasFx8YYDw3gKQSujHutVMxbmmvEEfjYLDfedziwpM43rJKcQKsf42eUfo9auM0S1qH ZYL8663xXAv4mwQYiW4H7AXaswgnCXps/TFH8YdGyLiMyyKHkjZuFHU5IvujVT7pIBunKn EA54huTbc+R+DJTp1sJvzQt87Zk5BenSXGmgjIoNLuKX5itpUqHtYvYhfBWayQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1787706433; a=rsa-sha256; cv=none; b=exUMBjpLnl/hxJ20ZJaW8slXDNBJcxY1rjt6gJP1J1fS9jPIKs2wai7rLy5Hup7p1bRlcE xtn9jT6tA6MGMH4ZzxxJH1P/hww0xmJBZci/c1R2cwmEftzZYzlzXHO+isq9r0UPm2WVxV G0NW4IwQgFOLMrmecktYTzNF8StQP/WNP91vvUTXjP7ZxxPbzb0NEacXGB/ir6QBo92v2R cSPFdtOnbFdlzbH/GbNvGFOfWyaC3jIY+esEUY/1DefRejSel+I+rB8xR6oW16MrHsARIn 9KH+gkKboFUX9APFLVLGdCyaazCISxAlb+vLBvvxD6uGz5TX2s3lvGOZ5JkVuQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1787706433; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=GTSpeg1plvJc6edPg1H2/GANSZ3bEiCaOBUx52Uyx34=; b=YA1Rv8s2PTgNbeRFb+OXpku9DkiZ/f+4EMfH0i5Q1r924wsPhEKdUDVnN+YWHoo+T/h2H8 7bz+PSwdAJY1hWdNSsDk9xnEGNO77Eq1iBl9F3LI3NWebZ1uWYNq3UkS0weGLWCZG20/f3 yrDI14Ws8f/PuVw60AECbcESg8PA77fBcO0nlqOhIkWMdQSorftNNkgDLtBmVVk6STK82p gO/KeW46WoJMEiFKR8OGTDzu/9+LXorFL3/7NvwYBXJ9H1muMWgPyFOnSmqbrFnGG9ABzi sK/UibShXhjrwPrhv6kFiaSLEBQraMwnvkw1+7MuFZqxfqncUkrseBeu6ulBHA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4hV61r5Qxpz1BN for ; Wed, 26 Aug 2026 01:07:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 429e8 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Wed, 26 Aug 2026 01:07:12 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kevin Bowling Subject: git: b73064225666 - stable/14 - igc: Report corrected internal ECC errors List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kbowling X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: b73064225666b527a61413921f456525022af8f1 Auto-Submitted: auto-generated Date: Wed, 26 Aug 2026 01:07:12 +0000 Message-Id: <6a8e3c40.429e8.15014f35@gitrepo.freebsd.org> The branch stable/14 has been updated by kbowling: URL: https://cgit.FreeBSD.org/src/commit/?id=b73064225666b527a61413921f456525022af8f1 commit b73064225666b527a61413921f456525022af8f1 Author: Kevin Bowling AuthorDate: 2026-08-12 04:13:43 +0000 Commit: Kevin Bowling CommitDate: 2026-08-26 01:06:41 +0000 igc: Report corrected internal ECC errors I225 and I226 do not interrupt for corrected internal ECC errors. Instead, the DMA packet buffer and PCIe memories expose sticky status bits in PBECCSTS and PCIEECCSTS. Sample these bits with the regular hardware statistics update, preserve the PBECCSTS ECC enable state while clearing its RW1C indication, and expose separate counters for the DMA packet buffer, PCIe transmit-data memory, and PCIe retry buffer. These counters represent observed indications rather than an exact error count because multiple corrections between samples collapse into one sticky status bit. Hardware validation used an I225-IT (rev 3) and a debug kernel that wrote only the documented self-clearing injection bits. Each test armed the injector, exercised the owning RAM with traffic, and compared the corresponding counter before and after. Coverage: Memory Observed result DMA packet buffer corrected_dma advanced once PCIe transmit data corrected_pcie_tx_data advanced once PCIe retry buffer No PCIe replay source; not exercised The retry-buffer injector requires a real PCIe replay to read the corrupted entry. The test root port exposed AER and DPC reporting but no protocol error injector, so ordinary traffic could not cover that case. Sponsored by: BBOX.io (cherry picked from commit 9f7633b932954162792e2caef4f6f0cd87e82f43) --- sys/dev/igc/if_igc.c | 40 ++++++++++++++++++++++++++++++++++++++++ sys/dev/igc/if_igc.h | 3 +++ 2 files changed, 43 insertions(+) diff --git a/sys/dev/igc/if_igc.c b/sys/dev/igc/if_igc.c index 58b3596d86dd..75fbe5a67a2d 100644 --- a/sys/dev/igc/if_igc.c +++ b/sys/dev/igc/if_igc.c @@ -137,6 +137,7 @@ static void igc_if_multi_set(if_ctx_t); static void igc_if_update_admin_status(if_ctx_t); static void igc_apply_i225_ipg_workaround(struct igc_softc *); static void igc_if_debug(if_ctx_t); +static void igc_update_ecc_stats(struct igc_softc *); static void igc_update_stats_counters(struct igc_softc *); static void igc_add_hw_stats(struct igc_softc *); static int igc_if_set_promisc(if_ctx_t, int); @@ -2927,6 +2928,32 @@ pme: * Update the board statistics counters. * **********************************************************************/ +static void +igc_update_ecc_stats(struct igc_softc *sc) +{ + struct igc_hw *hw; + u32 pbeccsts, pcieeccsts; + + hw = &sc->hw; + pbeccsts = IGC_READ_REG(hw, IGC_PBECCSTS); + if (pbeccsts & IGC_PBECCSTS_CORR_ERR) { + sc->corrected_error_dma_count++; + /* Preserve the enable bit while clearing the RW1C status. */ + IGC_WRITE_REG(hw, IGC_PBECCSTS, + pbeccsts & (IGC_PBECCSTS_ECC_ENABLE | + IGC_PBECCSTS_CORR_ERR)); + } + + pcieeccsts = IGC_READ_REG(hw, IGC_PCIEECCSTS) & + IGC_PCIEECCSTS_CORR_MASK; + if (pcieeccsts & IGC_PCIEECCSTS_TX_WR_DATA) + sc->corrected_error_pcie_tx_data_count++; + if (pcieeccsts & IGC_PCIEECCSTS_RETRY_BUF) + sc->corrected_error_pcie_retry_count++; + if (pcieeccsts != 0) + IGC_WRITE_REG(hw, IGC_PCIEECCSTS, pcieeccsts); +} + static void igc_update_stats_counters(struct igc_softc *sc) { @@ -3008,6 +3035,8 @@ igc_update_stats_counters(struct igc_softc *sc) sc->stats.tncrs += IGC_READ_REG(&sc->hw, IGC_TNCRS); sc->stats.htdpmc += IGC_READ_REG(&sc->hw, IGC_HTDPMC); sc->stats.tsctc += IGC_READ_REG(&sc->hw, IGC_TSCTC); + + igc_update_ecc_stats(sc); } static uint64_t @@ -3169,6 +3198,17 @@ igc_add_hw_stats(struct igc_softc *sc) SYSCTL_ADD_UQUAD(ctx, memerr_list, OID_AUTO, "fatal_unknown", CTLFLAG_RD, &sc->fatal_error_unknown_count, "Fatal memory errors without a reported region"); + SYSCTL_ADD_UQUAD(ctx, memerr_list, OID_AUTO, "corrected_dma", + CTLFLAG_RD, &sc->corrected_error_dma_count, + "Corrected DMA memory error indications"); + SYSCTL_ADD_UQUAD(ctx, memerr_list, OID_AUTO, + "corrected_pcie_tx_data", CTLFLAG_RD, + &sc->corrected_error_pcie_tx_data_count, + "Corrected PCIe transmit-data memory error indications"); + SYSCTL_ADD_UQUAD(ctx, memerr_list, OID_AUTO, + "corrected_pcie_retry", CTLFLAG_RD, + &sc->corrected_error_pcie_retry_count, + "Corrected PCIe retry-buffer memory error indications"); eee_node = SYSCTL_ADD_NODE(ctx, child, OID_AUTO, "eee", CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, "Energy Efficient Ethernet statistics"); diff --git a/sys/dev/igc/if_igc.h b/sys/dev/igc/if_igc.h index 90976359f56f..c08f377c44af 100644 --- a/sys/dev/igc/if_igc.h +++ b/sys/dev/igc/if_igc.h @@ -426,6 +426,9 @@ struct igc_softc { uint64_t fatal_error_pcie_count; uint64_t fatal_error_dma_count; uint64_t fatal_error_unknown_count; + uint64_t corrected_error_dma_count; + uint64_t corrected_error_pcie_tx_data_count; + uint64_t corrected_error_pcie_retry_count; struct igc_hw_stats stats; u16 vf_ifp; };