From nobody Sun Aug 16 10:24:18 2026 X-Original-To: dev-commits-src-main@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 4hNBsG44SYz6nrJZ for ; Sun, 16 Aug 2026 10:24:18 +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 4hNBsG3ZJ1z3bB8 for ; Sun, 16 Aug 2026 10:24:18 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1786875858; 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=sWLIdfSf8fipoXvVhYZ/RatT/YsigM/7DATYzs1qI4A=; b=gxT70gHNOHIo/TtEQjUnss1oARnLYZuNyrhOzSMQdDW8+lEj6t1gMl0FTabpS37/Lluzp4 iK17rqSqZh+0HMeq8p38cWaG+sXbJjbZRk93/KMB31vpdk3WHifTv8gI4x7I62FT0GlPOH HpkxdcOQKRvQZrsA5LCEuhs8BglfpQ+o6JO2G4hqeZxUZCoY27MrqwJFoYHJJnVNcz6kK8 ium+AUaChAcj4UvGZbfU7Hfl7K5AkTg/VFBkmWU/0UYBHVtRMTr9ihz4RTMvppVOWwHG51 9FYIf0+8tR1jevMDg5jhhkJnWjxVqAF8cw9znGCbMr+ZuL9JgsO9B5fCPCq6QA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1786875858; a=rsa-sha256; cv=none; b=BGFUQqdUTRpkQNVclaq7wXO1exIKtpqewVYiXcMxflMIiYNk36at+cF5TFrGAFHgC0ZvRi N2QWXDJ2ueC1luhNDNpO1WDkmc1onp89UQtqO1JEoyfePVbWQ1E65jqtYnzoZpphZiD3lB avlJaH9EhFvOFFpobk3DcSoF2xo5UWD9NPGrn7MIlGqqOOoCbsQw0w08at8nsoUc2SqBAp o2PqSf8UI06KlKw8ksHaarW1nqgDcdOEX4gabq1rgt4FMQ4sEyZwS2x7LlQjySW3NIq5FF QxW925RKVhMllXqZXdvsJ0c44gfHM6UVrz74tADfYDuTTpt3G9zlMnRvUvUaSQ== 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=1786875858; 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=sWLIdfSf8fipoXvVhYZ/RatT/YsigM/7DATYzs1qI4A=; b=lklkoiB0HjLud5T75QLFJJ5jxsw+xSD4YSOCon2OwJZRj5xg45NZxHYUtI6Vk/2HSsUVjZ wcBY2xVGkRQ+0G7oX4alilGsuqKzNIzn4pWuHElKu6+3akzqXSEXww+cty1gtHfrWayIVN T1tF3gp09O9jIk3CnIbmogQNEHk4PqX/K9YpXgNPtCHtoXZFFzADf2OHmevlFeDCK7MA3Q U8PzH+cC79YFuA0gYZlbg4tecV0FsACxexy+eTiZEFH3GQSQq64/eiE9GRYzG/kIPtGaUX xxL2g2PJIqeRtEgD95REkueJioOUleW/wDGbPqnRY9kLC8ia/hddMnSfHSwZsg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4hNBsG2bNPz7x6 for ; Sun, 16 Aug 2026 10:24:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 26357 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Sun, 16 Aug 2026 10:24:18 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kevin Bowling Subject: git: 81d5356799a1 - main - e1000: Recover from the 82574 PHY hang List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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/main X-Git-Reftype: branch X-Git-Commit: 81d5356799a1db1701cb3f91146131c34dede413 Auto-Submitted: auto-generated Date: Sun, 16 Aug 2026 10:24:18 +0000 Message-Id: <6a818fd2.26357.413041ef@gitrepo.freebsd.org> The branch main has been updated by kbowling: URL: https://cgit.FreeBSD.org/src/commit/?id=81d5356799a1db1701cb3f91146131c34dede413 commit 81d5356799a1db1701cb3f91146131c34dede413 Author: Kevin Bowling AuthorDate: 2026-08-16 07:02:25 +0000 Commit: Kevin Bowling CommitDate: 2026-08-16 10:23:51 +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 --- 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 6574b2d0e7d7..f07f75100650 100644 --- a/sys/dev/e1000/if_em.c +++ b/sys/dev/e1000/if_em.c @@ -3447,8 +3447,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)) @@ -4511,6 +4533,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 9c441edd320b..e5b0fec8b087 100644 --- a/sys/dev/e1000/if_em.h +++ b/sys/dev/e1000/if_em.h @@ -622,6 +622,7 @@ struct e1000_softc { u32 pba; int link_mask; int tso_automasked; + u32 phy_hang_count; u32 promisc_pending; u32 stats_pending; u32 fatal_error_state;