From nobody Thu Oct 29 06:03:23 2026 X-Original-To: dev-commits-src-branches@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 4jFYZ36jkfz6xrLb for ; Thu, 29 Oct 2026 06:03:23 +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) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 4jFYZ34cklz4sks for ; Thu, 29 Oct 2026 06:03:23 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1793253803; 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=OkR6k0osDYNnRzzMHB+pOAP7P+kJ3WksUvPel9ni0to=; b=ADF7bzw8Kkx1EFolnJz/zHDYRoYpUEZJoFJkaopn656qt49G9arxKngtUvBFyespMmhQG5 i+Ka0HsaRW04oFKebMutRPisd8ffXrgaTMdRwRBCrMcdZ84hCiBHmB48PzcOymi3zDH0uA spg2NQEceUmkBifdiXFWplnp6lYLCKeLtjStt0Qc4FpYRsbWli7Pk/mreKHbhidPnvKUj2 z9OEKC8MjYprIhozBbl4ZmdqdE/DxizTSIn1tMvKU0zVllZYIwmpjNkohGrynx8gEy3a68 LvVfzKe0N63DE6R3HcCT5Z+KUrOjGoJhn0LgAe+qwa5eAw4dakTRYujM7WzgfQ== ARC-Seal: i=1; a=rsa-sha256; d=freebsd.org; s=dkim; cv=none; t=1793253803; b=RsvrX1E1ptrvC0sxbfrZ0BYQSexsNSIsE2Ql9pEuiVIOgbyBCG7pgXIXtXtvXGYdLZ1HLB 38Ee/dxB78rVH7EZo3m05r+CDORKN9ZIw2zCe3jwlBE3P7hzZg6vw9/XiRhOpfpDG6mAVf cPdhuYBNNgJioGhiHsVN9+zM8+ZvjIZjVHBG+IDsxoSWOS7RDSFAvGyaQvUSPN8VcL2f/r uojJKqXEGzJM6eucMOKoSlB6bw5T3BPtAaY/2O6tsNQR6CPVT8uEPlBRqaUTA3xInb/zX+ oTy5Pfisq+lTLj9V894wuCkxDbatxEFZvxdAcDddcgbMttEv+62mB+OR0siIEA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1793253803; 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=OkR6k0osDYNnRzzMHB+pOAP7P+kJ3WksUvPel9ni0to=; b=oLAJ2x55tyFW1t8aOKIMgbUHbiRwhimyLJPmaxgMjyc0okY6Zgya+defbfeizWVLB4G/Ca +QKPsY3teykUzf0BGtD5I4Whxo2+3OcmMzJDAwgPQuWG/5AQccD7CVG/my5qtP1esz7EKG uw9KL8MrbMwXpeO147GeM33BZhHPHN7w1N36gaDm0SEuBPaeS9PpYQCu951ewv6if9Rlgi BKQWcTx1u2EH3UbRUTYX+QqjhZR5x72HnZEm8aW0SuMH8SYPLKIGVDHAwMQ9eaTFTKtMko t2+tRXGZKJst0rCEiZmTQIoBkyFfYXS2xh3G+eKsBXv8GzJW+c9eveXp0o+omw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4jFYZ34G6szQqL for ; Thu, 29 Oct 2026 06:03:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 39a4f by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Thu, 29 Oct 2026 06:03:23 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kevin Bowling Subject: git: f7ea2d561288 - stable/15 - iflib: Add sysctl stat for TX watchdog reset events List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org List-Id: Commits to the stable branches of the FreeBSD src repository 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: f7ea2d561288be5bd0eade18fe2565f30b091f96 Auto-Submitted: auto-generated Date: Thu, 29 Oct 2026 06:03:23 +0000 Message-Id: <6ae2e1ab.39a4f.67569ec3@gitrepo.freebsd.org> The branch stable/15 has been updated by kbowling: URL: https://cgit.FreeBSD.org/src/commit/?id=f7ea2d561288be5bd0eade18fe2565f30b091f96 commit f7ea2d561288be5bd0eade18fe2565f30b091f96 Author: Kevin Bowling AuthorDate: 2026-08-08 07:50:08 +0000 Commit: Kevin Bowling CommitDate: 2026-10-29 05:41:55 +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. Relnotes: yes (cherry picked from commit d6f97c6bbca689f00d5edcfd9c8f31b0910edbaf) --- share/man/man4/iflib.4 | 5 +++++ share/man/man9/iflibdi.9 | 4 ++-- sys/dev/e1000/if_em.c | 22 +--------------------- sys/dev/e1000/if_em.h | 1 - sys/dev/igc/if_igc.c | 19 +------------------ sys/dev/igc/if_igc.h | 1 - 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, 14 insertions(+), 50 deletions(-) diff --git a/share/man/man4/iflib.4 b/share/man/man4/iflib.4 index e648a679313d..ca1b7918412e 100644 --- a/share/man/man4/iflib.4 +++ b/share/man/man4/iflib.4 @@ -194,6 +194,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 fcfc0f8170be..f5039dd41c3f 100644 --- a/share/man/man9/iflibdi.9 +++ b/share/man/man9/iflibdi.9 @@ -165,8 +165,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 74da82296b59..858cb6a176fd 100644 --- a/sys/dev/e1000/if_em.c +++ b/sys/dev/e1000/if_em.c @@ -421,7 +421,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); @@ -616,7 +615,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), @@ -654,7 +652,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), @@ -3654,18 +3651,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 @@ -6836,8 +6821,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 sc->watchdog_events; default: return (if_get_counter_default(ifp, cnt)); } @@ -6865,7 +6848,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)); } @@ -6986,9 +6969,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"); SYSCTL_ADD_PROC(ctx, child, OID_AUTO, "device_control", CTLTYPE_UINT | CTLFLAG_RD, sc, E1000_CTRL, em_sysctl_reg_handler, "IU", diff --git a/sys/dev/e1000/if_em.h b/sys/dev/e1000/if_em.h index 3e8d7edc69d4..42332b43dccc 100644 --- a/sys/dev/e1000/if_em.h +++ b/sys/dev/e1000/if_em.h @@ -669,7 +669,6 @@ struct e1000_softc { unsigned long dropped_pkts; unsigned long link_irq; unsigned long rx_overruns; - unsigned long watchdog_events; union { struct e1000_hw_stats stats; /* !sc->vf_ifp */ diff --git a/sys/dev/igc/if_igc.c b/sys/dev/igc/if_igc.c index 3734bb09508e..7aa8a1df9203 100644 --- a/sys/dev/igc/if_igc.c +++ b/sys/dev/igc/if_igc.c @@ -111,7 +111,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); @@ -243,7 +242,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), @@ -1625,18 +1623,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 @@ -3172,7 +3158,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)); } @@ -3275,9 +3261,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 495f684eab39..bef6b9d1211c 100644 --- a/sys/dev/igc/if_igc.h +++ b/sys/dev/igc/if_igc.h @@ -412,7 +412,6 @@ struct igc_softc { unsigned long dropped_pkts; unsigned long link_irq; unsigned long rx_overruns; - unsigned long watchdog_events; u32 fatal_error_state; u32 fatal_error_peind; diff --git a/sys/dev/ixgbe/if_ix.c b/sys/dev/ixgbe/if_ix.c index ada3cead1dd1..42054fc498ae 100644 --- a/sys/dev/ixgbe/if_ix.c +++ b/sys/dev/ixgbe/if_ix.c @@ -2238,8 +2238,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 166a480dd560..62e92be75197 100644 --- a/sys/dev/ixgbe/if_ixv.c +++ b/sys/dev/ixgbe/if_ixv.c @@ -2450,8 +2450,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 28010526d235..2656d44772e3 100644 --- a/sys/dev/ixgbe/ixgbe.h +++ b/sys/dev/ixgbe/ixgbe.h @@ -513,7 +513,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 d9b4e770741b..7cbf3216b12d 100644 --- a/sys/net/iflib.c +++ b/sys/net/iflib.c @@ -232,7 +232,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; int ifc_led_state; struct resource *ifc_msix_mem; @@ -4543,7 +4543,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); @@ -7629,6 +7629,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,