From 62c80d76f7dc960f430cb34f88c2a549612e3e93 Mon Sep 17 00:00:00 2001 From: Kevin Bowling Date: Fri, 18 Sep 2026 01:29:18 -0700 Subject: [PATCH] bnxt: Initialize RSS with the common key Use rss_getkey() for the initial VNIC key instead of generating a per-attachment private key. Preserve the writable rss_key sysctl, its override lifetime, the hardware DMA representation, and all hash and indirection settings. Reviewed by: gallatin MFC after: 2 weeks Sponsored by: BBOX.io Differential Revision: https://reviews.freebsd.org/D59795 --- sys/dev/bnxt/bnxt_en/if_bnxt.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/sys/dev/bnxt/bnxt_en/if_bnxt.c b/sys/dev/bnxt/bnxt_en/if_bnxt.c index 432dceb6bfb2..deb5a62347bd 100644 --- a/sys/dev/bnxt/bnxt_en/if_bnxt.c +++ b/sys/dev/bnxt/bnxt_en/if_bnxt.c @@ -47,6 +47,7 @@ #include #include #include +#include #define WANT_NATIVE_PCI_GET_SLOT #include @@ -2893,7 +2894,9 @@ bnxt_attach_pre(if_ctx_t ctx) goto failed; } - arc4rand(softc->vnic_info.rss_hash_key, HW_HASH_KEY_SIZE, 0); + _Static_assert(HW_HASH_KEY_SIZE == RSS_KEYSIZE, + "RSS key size mismatch"); + rss_getkey(softc->vnic_info.rss_hash_key); softc->vnic_info.rss_hash_type = HWRM_VNIC_RSS_CFG_INPUT_HASH_TYPE_IPV4 | HWRM_VNIC_RSS_CFG_INPUT_HASH_TYPE_TCP_IPV4 |