From nobody Sun Aug 30 01:37:56 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 4hXZWT2LG7z6ptL4 for ; Sun, 30 Aug 2026 01:37:57 +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 4hXZWS4hy9z3sk6 for ; Sun, 30 Aug 2026 01:37:56 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1788053876; 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=P/aZ3jqKdzCOpMYiTlr2TjS9JaLZBUzfV5sEtoA/P6c=; b=gCbmirOLGKbT8A+OaAYFGEZGO5eyG8zoP2tRbZIf+8vCh2Wcv2CggB8BqDrCf8Ozb9xl2R stPaRxMe5i+dZqDkimLW0bBNyxFCZEIYI0dFFQIeK8aqd23CReaFU9PJoVmzut4vCGhayD gPR8xkAtcZEMcKvz+2+wwl9isqez8zJWvGaEePXc3/HwnPFmnk0Wlq9jLKLBnl+o5yqkbO sBQRsYRb2yFAR/cTgfWAaX46D4gs+pCH+YwNCtpgkd12DAEiqUeys5dfJ76r2XSEpC/4Bd Gn2ofdFQUZuZrgRifliZWUbFRNSS6z1FJCDStP9VsTAwMhM/TGeAe3UQMrTDSw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1788053876; a=rsa-sha256; cv=none; b=Q9HuPfU8NC+rHWlYB1YcdFPkdiGhaxKGyGZvEoJGO5E/UMipmU1pwCh6UpspCAiQb0fP9Z 2tX/1m0gUervFP3t8HYldjzTCoIc6aM9dZifsg70atkTnQIkvECu3VwJqVmUkevvZmWE+N WLZPgtyA/pRJUvMI2yizgjWmZaVVBrPScAGtoInHRI/+oe3GfDFrh0y4f6tkNZr4VjgBaL Fn3yUXmhSc2ODnyNMWl2apaIr+84Rbm+OqI59+8r1qUCkVyUBYxuwmSz4ZpB93PFcsYpQE 6X3Urk/6hxZb1FliYfadSzk57I9Z0DkhRa0R8rDj/o3bDqfFyO8UlNWo2wzi6w== 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=1788053876; 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=P/aZ3jqKdzCOpMYiTlr2TjS9JaLZBUzfV5sEtoA/P6c=; b=ru3P3e5SFZsC5cXLTZW2apSxJfGxVL4VKpIAfOz1ZmWTGAaEjfw8zrotnqrsdZLFYzQSwN AmoQtpb8QPP1uHQIc08lM52+OueMdh1OJ9Ed4hoL2iywiWPxF8DHP5zMfcvbT+YTR2PucW xqzzZnbtDmGDVq79KtOgat3QKXnbiaODU4UCREesfpFxUyNwvGBxiF6hZ0Rug3z7UcPFti u9ZYkSAm4Zy/P26KcaNoIauN3X2vS++6++fwWzPqU3pN+eKNhzIk/1LQYwBqW3xnZzYqwO l9zDqCUNXdxjkXHPGuZYuOp8ieEjXPa/zTw10SlCTErihOcEpXMKdE/17QmeTg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4hXZWS3JfLz14ND for ; Sun, 30 Aug 2026 01:37:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 3fab9 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Sun, 30 Aug 2026 01:37:56 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kevin Bowling Subject: git: b27c5cfc7e76 - stable/15 - e1000: Sample statistics at timer cadence 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: b27c5cfc7e7673a2d63349261f483a0f3472af4c Auto-Submitted: auto-generated Date: Sun, 30 Aug 2026 01:37:56 +0000 Message-Id: <6a938974.3fab9.191d6392@gitrepo.freebsd.org> The branch stable/15 has been updated by kbowling: URL: https://cgit.FreeBSD.org/src/commit/?id=b27c5cfc7e7673a2d63349261f483a0f3472af4c commit b27c5cfc7e7673a2d63349261f483a0f3472af4c Author: Kevin Bowling AuthorDate: 2026-07-29 09:11:19 +0000 Commit: Kevin Bowling CommitDate: 2026-08-30 01:36:29 +0000 e1000: Sample statistics at timer cadence Mailbox and link interrupts share iflib admin service with the periodic timer. Mark timer-driven passes explicitly and run the hardware statistics sweep only for those samples instead of repeating 66 PF MMIO reads for every VF mailbox message. DTrace on the I350 DUT measured the PF sweep at about 79 us on average. The normal hz/2 timer continues to extend clear-on-read counters safely; exported counters may trail hardware by up to 500 ms. Sponsored by: BBOX.io (cherry picked from commit d2cd0b57532ba35fe39744a60d53b90e6f13b5e4) --- sys/dev/e1000/if_em.c | 15 ++++++++++++++- sys/dev/e1000/if_em.h | 1 + 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/sys/dev/e1000/if_em.c b/sys/dev/e1000/if_em.c index 7f1da9fb7d3f..b4ca34a0593a 100644 --- a/sys/dev/e1000/if_em.c +++ b/sys/dev/e1000/if_em.c @@ -1443,6 +1443,7 @@ em_if_attach_post(if_ctx_t ctx) sc->ustats.stats = (struct e1000_hw_stats){}; em_update_stats_counters(sc); + atomic_readandclear_32(&sc->stats_pending); hw->mac.get_link_status = 1; em_if_update_admin_status(ctx); em_add_hw_stats(sc); @@ -2910,9 +2911,13 @@ em_if_multi_set(if_ctx_t ctx) static void em_if_timer(if_ctx_t ctx, uint16_t qid) { + struct e1000_softc *sc; + if (qid != 0) return; + sc = iflib_get_softc(ctx); + atomic_set_32(&sc->stats_pending, 1); iflib_admin_intr_deferred(ctx); } @@ -3041,7 +3046,15 @@ em_if_update_admin_status(if_ctx_t ctx) if (link_was_published) iflib_link_state_change(ctx, LINK_STATE_DOWN, 0); } - em_update_stats_counters(sc); + /* + * Mailbox, link, and timer events share this admin task. The PF + * statistics sweep performs 66 MMIO reads, so run it only when the + * ordinary iflib timer requests a sample rather than once per mailbox + * message. Exported counters can consequently trail hardware by the + * timer interval (normally 500 ms). + */ + if (atomic_readandclear_32(&sc->stats_pending) != 0) + em_update_stats_counters(sc); /* Reset LAA into RAR[0] on 82571 */ if (hw->mac.type == e1000_82571 && e1000_get_laa_state_82571(hw)) diff --git a/sys/dev/e1000/if_em.h b/sys/dev/e1000/if_em.h index 62e783307b59..5beb3e09fcad 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 stats_pending; u32 fatal_error_state; u32 fatal_error_icr; u32 fatal_error_pbeccsts;