From nobody Sat Aug 8 10:01:31 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 4hHGkm57ZZz6nPv1 for ; Sat, 08 Aug 2026 10:01:36 +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 "YR1" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4hHGkm36zYz3CL3 for ; Sat, 08 Aug 2026 10:01:36 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1786183296; 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=yZPgENjzD4oMM6/qzp68YSOYcbL3vnMjiJK8Zaq9aCw=; b=P7ELnc6Dj1hK7jZUO835jcZNKl9WgjmVISdLS0MWyXPkrERusbEa0Sto8RYvcw0vNnrMmu 6c9t3q31ZyaBiKzVPa9sB1niyMxTTaLFedNifROOIh6ngPB+XhRJRgN56N1EVWmr1UWR65 SaiZ21KDT4KnQ07XTJguBbmLhplZ2DJmXuz6Bf1b8DOHPj+nkN637bnCeXeMKYwU2ndR4D nePFt4xNZGQ6UBYbWICCaReR3DYciqKiSwX3PFx94i22GrwFuIUORixA9Iiil1ZrvWv4kP 5wMhq8NSBEQNVjfyrRz5nWb1ZspaZzSg4wNf5CwyKUmk9N1gwuL3VaYf+5XBXA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1786183296; a=rsa-sha256; cv=none; b=n/nRsdVd2syaW6D3gkTm5JPvn2UZehFopITFPWpABkZQScoUE1yYU2Ls47b7kJJYUZSrxP xJ0jgsO7Wx0bDKxDlRbLyJZn3ZGZSFUy7Rsk2WYj3gNg4+Gi3HuYnUVrRpUKqpV/YgTG+C N0ICi7WO7uoTF4Gfox+sprrpEJ/bb+kUZFadzO2r4QkbVXtrs9i0wQ+h7p+j3PmxWn6Sc0 wrLiFSnf1oRirUle8XVtYf4qd7Mxov65hVZFEB4ZYP9VtH4s9EaYNGD+iCQ/FZXZLWh+QF PeFFUhF7TDbTWPLdFNyB/WfNDLY0x8JiIExC8j2VRPZEMqgdaxSV5020NECOoQ== 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=1786183296; 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=yZPgENjzD4oMM6/qzp68YSOYcbL3vnMjiJK8Zaq9aCw=; b=JLU9yvRJUu+SdNzQHIUbWapZwnkhQ7h2qCBZGZsjr0jjDNbLxhbKyKL5HdG0soOET8hYCY 8AZCztGExx1TPcD8/lBURd/cbkUtgAyS85rL3dzzeTlKfPzkX+B1RBV8bIGPNWZR9i43ep FLZXoroy7EkuzKrqiZpAkmGCCnEkATcz/QQFy5eGPRtCVGDEG05s0xMVATa1Gz5Gf/fH1/ Gaet4VFCce9mZHqFzYe/rvIt3u4YKP9HNdOUKgcfhBimITr0BqXkqIVPgP170hc44QLp+8 OPlzfBuNpHLrX2N3h40w6o+6XclSKSvwI0eaX+2YEaKl46qa+Nu6FAUCoRpyKA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4hHGkm1YbxzZG2 for ; Sat, 08 Aug 2026 10:01:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 22f36 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Sat, 08 Aug 2026 10:01:31 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kevin Bowling Subject: git: d6f97c6bbca6 - main - iflib: Add sysctl stat for TX watchdog reset events 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/main X-Git-Reftype: branch X-Git-Commit: d6f97c6bbca689f00d5edcfd9c8f31b0910edbaf Auto-Submitted: auto-generated Date: Sat, 08 Aug 2026 10:01:31 +0000 Message-Id: <6a76fe7b.22f36.708979b3@gitrepo.freebsd.org> The branch main has been updated by kbowling: URL: https://cgit.FreeBSD.org/src/commit/?id=d6f97c6bbca689f00d5edcfd9c8f31b0910edbaf commit d6f97c6bbca689f00d5edcfd9c8f31b0910edbaf Author: Kevin Bowling AuthorDate: 2026-08-08 07:50:08 +0000 Commit: Kevin Bowling CommitDate: 2026-08-08 10:01:24 +0000 iflib: Add sysctl stat for TX watchdog reset events iflib counts resets initiated by its transmit watchdog in 69c3e0de01c1. Export the counter in the per-device iflib sysctl tree so every driver provides the diagnostic without a driver callback or duplicate storage. A watchdog reset does not establish how many packets failed. It can recover a hardware stall involving several queued packets or a missed completion involving no packet loss. Stop adding one output error per watchdog event in em(4), igb(4), and igc(4). Remove the redundant driver counters and move the diagnostic to dev...iflib.tx_watchdog_events. MFC after: 1 month Relnotes: yes --- share/man/man4/iflib.4 | 7 ++++++- share/man/man9/iflibdi.9 | 6 +++--- sys/dev/e1000/if_em.c | 24 +----------------------- sys/dev/e1000/if_em.h | 1 - sys/dev/igc/if_igc.c | 19 +------------------ sys/dev/igc/if_igc.h | 2 -- sys/dev/ixgbe/if_ix.c | 2 -- sys/dev/ixgbe/if_ixv.c | 2 -- sys/dev/ixgbe/ixgbe.h | 1 - sys/net/iflib.c | 7 +++++-- 10 files changed, 16 insertions(+), 55 deletions(-) diff --git a/share/man/man4/iflib.4 b/share/man/man4/iflib.4 index b7e09de40875..9ddba8933ed8 100644 --- a/share/man/man4/iflib.4 +++ b/share/man/man4/iflib.4 @@ -1,4 +1,4 @@ -.Dd August 4, 2026 +.Dd August 8, 2026 .Dt IFLIB 4 .Os .Sh NAME @@ -145,6 +145,11 @@ variables are read-only: .Bl -tag -width indent .It Va driver_version A string indicating the internal version of the driver. +.It Va tx_watchdog_events +Number of transmit watchdog resets initiated by +.Nm . +This counts recovery events, not failed packets, and is not included in the +interface output error counter. .El .Pp There are a number of queue state diff --git a/share/man/man9/iflibdi.9 b/share/man/man9/iflibdi.9 index 57fa02c60b25..b148f74c560b 100644 --- a/share/man/man9/iflibdi.9 +++ b/share/man/man9/iflibdi.9 @@ -1,4 +1,4 @@ -.Dd May 21, 2019 +.Dd August 8, 2026 .Dt IFLIBDI 9 .Os .Sh NAME @@ -148,8 +148,8 @@ Its possible values are either active or inactive. .Pq Vt "eventhandler_tag" .It Va ifc_pause_frames .Pq Vt "int" -.It Va ifc_watchdog_events -.Pq Vt "int" +.It Va ifc_tx_watchdog_events +.Pq Vt "uint32_t" .It Va ifc_mac .Pq Vt "uint8_t" .It Va ifc_msix_mem diff --git a/sys/dev/e1000/if_em.c b/sys/dev/e1000/if_em.c index 361d44168623..6ef36eb579b6 100644 --- a/sys/dev/e1000/if_em.c +++ b/sys/dev/e1000/if_em.c @@ -431,7 +431,6 @@ static int em_if_mtu_set(if_ctx_t, uint32_t); static void em_if_timer(if_ctx_t, uint16_t); static void em_if_vlan_register(if_ctx_t, u16); static void em_if_vlan_unregister(if_ctx_t, u16); -static void em_if_watchdog_reset(if_ctx_t); static bool em_if_needs_restart(if_ctx_t, enum iflib_restart_event); static void em_identify_hardware(if_ctx_t); @@ -617,7 +616,6 @@ static device_method_t em_if_methods[] = { DEVMETHOD(ifdi_mtu_set, em_if_mtu_set), DEVMETHOD(ifdi_promisc_set, em_if_set_promisc), DEVMETHOD(ifdi_timer, em_if_timer), - DEVMETHOD(ifdi_watchdog_reset, em_if_watchdog_reset), DEVMETHOD(ifdi_vlan_register, em_if_vlan_register), DEVMETHOD(ifdi_vlan_unregister, em_if_vlan_unregister), DEVMETHOD(ifdi_get_counter, em_if_get_counter), @@ -655,7 +653,6 @@ static device_method_t igb_if_methods[] = { DEVMETHOD(ifdi_mtu_set, em_if_mtu_set), DEVMETHOD(ifdi_promisc_set, em_if_set_promisc), DEVMETHOD(ifdi_timer, em_if_timer), - DEVMETHOD(ifdi_watchdog_reset, em_if_watchdog_reset), DEVMETHOD(ifdi_vlan_register, em_if_vlan_register), DEVMETHOD(ifdi_vlan_unregister, em_if_vlan_unregister), DEVMETHOD(ifdi_get_counter, em_if_get_counter), @@ -698,7 +695,6 @@ static device_method_t igbv_if_methods[] = { DEVMETHOD(ifdi_mtu_set, em_if_mtu_set), DEVMETHOD(ifdi_promisc_set, em_if_set_promisc), DEVMETHOD(ifdi_timer, em_if_timer), - DEVMETHOD(ifdi_watchdog_reset, em_if_watchdog_reset), DEVMETHOD(ifdi_vlan_register, em_if_vlan_register), DEVMETHOD(ifdi_vlan_unregister, em_if_vlan_unregister), DEVMETHOD(ifdi_get_counter, em_if_get_counter), @@ -2791,18 +2787,6 @@ em_if_update_admin_status(if_ctx_t ctx) lem_smartspeed(sc); } -static void -em_if_watchdog_reset(if_ctx_t ctx) -{ - struct e1000_softc *sc = iflib_get_softc(ctx); - - /* - * Just count the event; iflib(4) will already trigger a - * sufficient reset of the controller. - */ - sc->watchdog_events++; -} - /********************************************************************* * * This routine disables all traffic on the adapter by issuing a @@ -5579,9 +5563,6 @@ em_if_get_vf_counter(if_ctx_t ctx, ift_counter cnt) switch (cnt) { case IFCOUNTER_IERRORS: return sc->dropped_pkts; - case IFCOUNTER_OERRORS: - return (if_get_counter_default(ifp, cnt) + - sc->watchdog_events); default: return (if_get_counter_default(ifp, cnt)); } @@ -5609,7 +5590,7 @@ em_if_get_counter(if_ctx_t ctx, ift_counter cnt) stats->mpc + stats->cexterr); case IFCOUNTER_OERRORS: return (if_get_counter_default(ifp, cnt) + - stats->ecol + stats->latecol + sc->watchdog_events); + stats->ecol + stats->latecol); default: return (if_get_counter_default(ifp, cnt)); } @@ -5762,9 +5743,6 @@ em_add_hw_stats(struct e1000_softc *sc) SYSCTL_ADD_ULONG(ctx, child, OID_AUTO, "rx_overruns", CTLFLAG_RD, &sc->rx_overruns, "RX overruns"); - SYSCTL_ADD_ULONG(ctx, child, OID_AUTO, "watchdog_timeouts", - CTLFLAG_RD, &sc->watchdog_events, - "Watchdog timeouts"); if (!sc->vf_ifp) { SYSCTL_ADD_PROC(ctx, child, OID_AUTO, "device_control", CTLTYPE_UINT | CTLFLAG_RD, diff --git a/sys/dev/e1000/if_em.h b/sys/dev/e1000/if_em.h index 4204dee4d982..6d3f312715d4 100644 --- a/sys/dev/e1000/if_em.h +++ b/sys/dev/e1000/if_em.h @@ -640,7 +640,6 @@ struct e1000_softc { unsigned long dropped_pkts; unsigned long link_irq; unsigned long rx_overruns; - unsigned long watchdog_events; u64 rx_csum_good; u64 rx_csum_errors; diff --git a/sys/dev/igc/if_igc.c b/sys/dev/igc/if_igc.c index 0900689e5f01..84012414ec27 100644 --- a/sys/dev/igc/if_igc.c +++ b/sys/dev/igc/if_igc.c @@ -110,7 +110,6 @@ static int igc_if_mtu_set(if_ctx_t, uint32_t); static void igc_if_timer(if_ctx_t, uint16_t); static void igc_if_vlan_register(if_ctx_t, u16); static void igc_if_vlan_unregister(if_ctx_t, u16); -static void igc_if_watchdog_reset(if_ctx_t); static bool igc_if_needs_restart(if_ctx_t, enum iflib_restart_event); static void igc_identify_hardware(if_ctx_t); @@ -225,7 +224,6 @@ static device_method_t igc_if_methods[] = { DEVMETHOD(ifdi_mtu_set, igc_if_mtu_set), DEVMETHOD(ifdi_promisc_set, igc_if_set_promisc), DEVMETHOD(ifdi_timer, igc_if_timer), - DEVMETHOD(ifdi_watchdog_reset, igc_if_watchdog_reset), DEVMETHOD(ifdi_vlan_register, igc_if_vlan_register), DEVMETHOD(ifdi_vlan_unregister, igc_if_vlan_unregister), DEVMETHOD(ifdi_get_counter, igc_if_get_counter), @@ -1486,18 +1484,6 @@ igc_if_update_admin_status(if_ctx_t ctx) igc_update_stats_counters(sc); } -static void -igc_if_watchdog_reset(if_ctx_t ctx) -{ - struct igc_softc *sc = iflib_get_softc(ctx); - - /* - * Just count the event; iflib(4) will already trigger a - * sufficient reset of the controller. - */ - sc->watchdog_events++; -} - /********************************************************************* * * This routine disables all traffic on the adapter by issuing a @@ -2790,7 +2776,7 @@ igc_if_get_counter(if_ctx_t ctx, ift_counter cnt) sc->stats.mpc); case IFCOUNTER_OERRORS: return (if_get_counter_default(ifp, cnt) + - sc->stats.ecol + sc->stats.latecol + sc->watchdog_events); + sc->stats.ecol + sc->stats.latecol); default: return (if_get_counter_default(ifp, cnt)); } @@ -2891,9 +2877,6 @@ igc_add_hw_stats(struct igc_softc *sc) SYSCTL_ADD_ULONG(ctx, child, OID_AUTO, "rx_overruns", CTLFLAG_RD, &sc->rx_overruns, "RX overruns"); - SYSCTL_ADD_ULONG(ctx, child, OID_AUTO, "watchdog_timeouts", - CTLFLAG_RD, &sc->watchdog_events, - "Watchdog timeouts"); SYSCTL_ADD_PROC(ctx, child, OID_AUTO, "device_control", CTLTYPE_UINT | CTLFLAG_RD | CTLFLAG_NEEDGIANT, sc, IGC_CTRL, igc_sysctl_reg_handler, "IU", diff --git a/sys/dev/igc/if_igc.h b/sys/dev/igc/if_igc.h index d9834212fee8..57b3fdcb0f13 100644 --- a/sys/dev/igc/if_igc.h +++ b/sys/dev/igc/if_igc.h @@ -414,8 +414,6 @@ struct igc_softc { unsigned long dropped_pkts; unsigned long link_irq; unsigned long rx_overruns; - unsigned long watchdog_events; - struct igc_hw_stats stats; u16 vf_ifp; }; diff --git a/sys/dev/ixgbe/if_ix.c b/sys/dev/ixgbe/if_ix.c index 0c40feed48c9..1aa6c039ad74 100644 --- a/sys/dev/ixgbe/if_ix.c +++ b/sys/dev/ixgbe/if_ix.c @@ -2067,8 +2067,6 @@ ixgbe_add_hw_stats(struct ixgbe_softc *sc) /* Driver Statistics */ SYSCTL_ADD_ULONG(ctx, child, OID_AUTO, "dropped", CTLFLAG_RD, &sc->dropped_pkts, "Driver dropped packets"); - SYSCTL_ADD_ULONG(ctx, child, OID_AUTO, "watchdog_events", - CTLFLAG_RD, &sc->watchdog_events, "Watchdog timeouts"); SYSCTL_ADD_ULONG(ctx, child, OID_AUTO, "link_irq", CTLFLAG_RD, &sc->link_irq, "Link MSI-X IRQ Handled"); diff --git a/sys/dev/ixgbe/if_ixv.c b/sys/dev/ixgbe/if_ixv.c index 7fffc5ec00bb..c77e768a2a0b 100644 --- a/sys/dev/ixgbe/if_ixv.c +++ b/sys/dev/ixgbe/if_ixv.c @@ -2100,8 +2100,6 @@ ixv_add_stats_sysctls(struct ixgbe_softc *sc) char namebuf[QUEUE_NAME_LEN]; /* Driver Statistics */ - SYSCTL_ADD_ULONG(ctx, child, OID_AUTO, "watchdog_events", - CTLFLAG_RD, &sc->watchdog_events, "Watchdog timeouts"); SYSCTL_ADD_ULONG(ctx, child, OID_AUTO, "link_irq", CTLFLAG_RD, &sc->link_irq, "Link MSI-X IRQ Handled"); diff --git a/sys/dev/ixgbe/ixgbe.h b/sys/dev/ixgbe/ixgbe.h index 90ce3e470686..7c3f2aee7216 100644 --- a/sys/dev/ixgbe/ixgbe.h +++ b/sys/dev/ixgbe/ixgbe.h @@ -491,7 +491,6 @@ struct ixgbe_softc { unsigned long dropped_pkts; unsigned long mbuf_header_failed; unsigned long mbuf_packet_failed; - unsigned long watchdog_events; unsigned long link_irq; union { struct ixgbe_hw_stats pf; diff --git a/sys/net/iflib.c b/sys/net/iflib.c index da26926c8b17..c56f15cc00bc 100644 --- a/sys/net/iflib.c +++ b/sys/net/iflib.c @@ -178,7 +178,7 @@ struct iflib_ctx { uint32_t ifc_rx_mbuf_sz; int ifc_link_state; - int ifc_watchdog_events; + uint32_t ifc_tx_watchdog_events; struct cdev *ifc_led_dev; struct resource *ifc_msix_mem; @@ -4212,7 +4212,7 @@ _task_fn_admin(void *context, int pending) if (ctx->ifc_sctx->isc_flags & IFLIB_HAS_ADMINCQ) IFDI_ADMIN_COMPLETION_HANDLE(ctx); if (do_watchdog) { - ctx->ifc_watchdog_events++; + ctx->ifc_tx_watchdog_events++; IFDI_WATCHDOG_RESET(ctx); } IFDI_UPDATE_ADMIN_STATUS(ctx); @@ -6970,6 +6970,9 @@ iflib_add_device_sysctl_pre(if_ctx_t ctx) SYSCTL_ADD_CONST_STRING(&ctx->ifc_sysctl_ctx, oid_list, OID_AUTO, "driver_version", CTLFLAG_RD, ctx->ifc_sctx->isc_driver_version, "driver version"); + SYSCTL_ADD_U32(&ctx->ifc_sysctl_ctx, oid_list, OID_AUTO, + "tx_watchdog_events", CTLFLAG_RD, &ctx->ifc_tx_watchdog_events, 0, + "TX watchdog resets initiated by iflib"); SYSCTL_ADD_BOOL(&ctx->ifc_sysctl_ctx, oid_list, OID_AUTO, "simple_tx", CTLFLAG_RDTUN, &ctx->ifc_sysctl_simple_tx, 0,