From nobody Sun Aug 30 01:37:57 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 4hXZWV04Wzz6ptML for ; Sun, 30 Aug 2026 01:37:58 +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 4hXZWT5B3Kz3snm for ; Sun, 30 Aug 2026 01:37:57 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1788053877; 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=g9Cw6BWM63xT/9El802I+EyPi2r9TKYNJ1jl60jQucg=; b=f7u1faoPlRrwhofA7gakArcuigFHClMwS/3aDtOcz+U3Yw7eUfrQpKmRLB5itsDSz1wnOX mGoSo0UsZ5JXWwpIQUxWqe+d+chakpu9e1nzMeHUnjPCmUr/iH00bjvIYca1Chqla3iiWW nEaK8UuX6QjvPoXc22FUbqWYXGXlplkuXie2WyYW0Kgalz3oh53PVHwRpCJq6OMhjohIkI x5B5wl/FgsO5dD3G9iA3wgSYJs6foYfgP/ylyhev7FriW9DVNeh64EU7VY1R54K5nOjt68 u8nZuVVBG+EsGk0a4cdziWK1T8sSmkv5xFvNXbzYbvHVamOpOToFXfIj17BQmw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1788053877; a=rsa-sha256; cv=none; b=u4hOo/b6xKycHeB4hp9Fr0+ipt66QSQPgUfyl33V5TEU220p0IjcSt/cWQ/rNgkCinckYZ ObSi/iELqRaL8e32MNACCW0VUel6NvGk8Z+Xg1qkFJfgzYNNtyy5ZFzJAfcMC42O0RSTRC odNP3+mVoZDXxb6R8vBBU11rLRoEMwa85EBbg0TKpyS95qYlaSy8+65SgFGOFqphUkRcuu X8hnftfvudyuAptRaQDDrKGSEKZYAhAFNDRGz5zB2O4nzpa1OLLVHDuafnBLdIyqqdmu2v oTE37VUCl5EDN8L9QZiw2edo48uJhyOBmarSXl1ydX9a+BxpjXbi638ea4fSnQ== 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=1788053877; 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=g9Cw6BWM63xT/9El802I+EyPi2r9TKYNJ1jl60jQucg=; b=FfODXJgnOdBpcd0KTSb6sVQWeUTrjpDfnWFlllF7uFC57TaCkjX1I0qWYIj2g2h4FcD1Ir QCl5PfNLkuMXtJi5geIkK8AFhiEYJhcrcRMZCm7vso0bkM9Nf8tOsei0FKbQXOyHalXAt5 CfuRueUco7WMmFpk9QwN5J6iRK8PyJfXQON1A+QHmiHq6zY1EqaGx7lpSuO1/mSDtUE115 pg+VowJxHcxbfMjjd7WbK7kBbw6kEt1oh5GCYWR+jqvOT4SeSQ9UBLshkgwnWg2OEcvoki 7fV/xTXZkmTgATCbN9lhQU1c4EAIxPlk8BvUXL/tngMFfumPwpPR6SzMfSkqBw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4hXZWT41RBz149r for ; Sun, 30 Aug 2026 01:37:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 3d14d by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Sun, 30 Aug 2026 01:37:57 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kevin Bowling Subject: git: 7827d437dc88 - stable/15 - e1000: Recover from the 82574 PHY hang 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/15 X-Git-Reftype: branch X-Git-Commit: 7827d437dc88cc3bb341691fd0c04622175a371a Auto-Submitted: auto-generated Date: Sun, 30 Aug 2026 01:37:57 +0000 Message-Id: <6a938975.3d14d.7ba8e185@gitrepo.freebsd.org> The branch stable/15 has been updated by kbowling: URL: https://cgit.FreeBSD.org/src/commit/?id=7827d437dc88cc3bb341691fd0c04622175a371a commit 7827d437dc88cc3bb341691fd0c04622175a371a Author: Kevin Bowling AuthorDate: 2026-08-16 07:02:25 +0000 Commit: Kevin Bowling CommitDate: 2026-08-30 01:37:19 +0000 e1000: Recover from the 82574 PHY hang The shared code provides e1000_check_phy_82574() to recognize a PHY hang from saturated receive error and idle error counters, but em(4) never calls it. Run the check from timer driven admin work. Match Intel e1000e by requiring two consecutive positive samples before requesting a full iflib reset. MFC after: 2 weeks Sponsored by: BBOX.io (cherry picked from commit 81d5356799a1db1701cb3f91146131c34dede413) --- sys/dev/e1000/if_em.c | 25 ++++++++++++++++++++++++- sys/dev/e1000/if_em.h | 1 + 2 files changed, 25 insertions(+), 1 deletion(-) diff --git a/sys/dev/e1000/if_em.c b/sys/dev/e1000/if_em.c index b4ca34a0593a..93bab0e65ee6 100644 --- a/sys/dev/e1000/if_em.c +++ b/sys/dev/e1000/if_em.c @@ -3053,8 +3053,30 @@ em_if_update_admin_status(if_ctx_t ctx) * message. Exported counters can consequently trail hardware by the * timer interval (normally 500 ms). */ - if (atomic_readandclear_32(&sc->stats_pending) != 0) + if (atomic_readandclear_32(&sc->stats_pending) != 0) { em_update_stats_counters(sc); + /* + * The 82574 PHY can enter a state in which both its receive + * error and idle error counters saturate. Require two + * consecutive timer samples before resetting, matching Intel's + * e1000e recovery policy and avoiding a reset on a transient + * register sample. + */ + if (hw->mac.type == e1000_82574) { + if (e1000_check_phy_82574(hw)) + sc->phy_hang_count++; + else + sc->phy_hang_count = 0; + if (sc->phy_hang_count > 1) { + sc->phy_hang_count = 0; + device_printf(dev, + "PHY appears hung; requesting reset\n"); + iflib_request_reset(ctx); + iflib_admin_intr_deferred(ctx); + return; + } + } + } /* Reset LAA into RAR[0] on 82571 */ if (hw->mac.type == e1000_82571 && e1000_get_laa_state_82571(hw)) @@ -4067,6 +4089,7 @@ em_reset(if_ctx_t ctx) E1000_WRITE_REG(hw, E1000_VET, ETHERTYPE_VLAN); e1000_get_phy_info(hw); e1000_check_for_link(hw); + sc->phy_hang_count = 0; return (E1000_SUCCESS); } diff --git a/sys/dev/e1000/if_em.h b/sys/dev/e1000/if_em.h index 5beb3e09fcad..4675317c2993 100644 --- a/sys/dev/e1000/if_em.h +++ b/sys/dev/e1000/if_em.h @@ -618,6 +618,7 @@ struct e1000_softc { u32 pba; int link_mask; int tso_automasked; + u32 phy_hang_count; u32 stats_pending; u32 fatal_error_state; u32 fatal_error_icr;