git: cc68c479d4d3 - stable/15 - if_bnxt: Collect hw stats every 250 milliseconds

From: Kevin Bowling <kbowling_at_FreeBSD.org>
Date: Thu, 29 Oct 2026 23:37:10 UTC
The branch stable/15 has been updated by kbowling:

URL: https://cgit.FreeBSD.org/src/commit/?id=cc68c479d4d3569328b693de3a10120b46732066

commit cc68c479d4d3569328b693de3a10120b46732066
Author:     Sumit Saxena <sumit.saxena@broadcom.com>
AuthorDate: 2026-07-31 15:49:32 +0000
Commit:     Kevin Bowling <kbowling@FreeBSD.org>
CommitDate: 2026-10-29 23:15:19 +0000

    if_bnxt: Collect hw stats every 250 milliseconds
    
    bnxt_if_timer() only scheduled bnxt_update_admin_status(), which
    polls HW stats, once per second. Drop the interval to 250ms so stats
    collection is timely.
    
    Reviewed by:    gallatin
    Sponsored by:   Broadcom Inc.
    Differential Revision:  https://reviews.freebsd.org/D58610
    
    (cherry picked from commit 492bd0db44bace9475e15dfebdc17076b536533f)
---
 sys/dev/bnxt/bnxt_en/if_bnxt.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/sys/dev/bnxt/bnxt_en/if_bnxt.c b/sys/dev/bnxt/bnxt_en/if_bnxt.c
index 21befd82938d..9cab563b1c71 100644
--- a/sys/dev/bnxt/bnxt_en/if_bnxt.c
+++ b/sys/dev/bnxt/bnxt_en/if_bnxt.c
@@ -4007,6 +4007,10 @@ bnxt_update_admin_status(if_ctx_t ctx)
 	return;
 }
 
+/* Poll interval for bnxt_update_admin_status(); not sysctl-tunable, unlike
+ * other driver intervals. */
+#define BNXT_ADMIN_POLL_TICKS (hz / 4)		/* 250ms */
+
 static void
 bnxt_if_timer(if_ctx_t ctx, uint16_t qid)
 {
@@ -4014,8 +4018,7 @@ bnxt_if_timer(if_ctx_t ctx, uint16_t qid)
 	struct bnxt_softc *softc = iflib_get_softc(ctx);
 	uint64_t ticks_now = ticks;
 
-        /* Schedule bnxt_update_admin_status() once per sec */
-	if (ticks_now - softc->admin_ticks >= hz) {
+	if (ticks_now - softc->admin_ticks >= BNXT_ADMIN_POLL_TICKS) {
 		softc->admin_ticks = ticks_now;
 		iflib_admin_intr_deferred(ctx);
 	}