git: dddc7c128c33 - stable/15 - axgbe: Use the common RSS key without options RSS

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

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

commit dddc7c128c332bce1edeca38d5a4217ead7c8f25
Author:     Kevin Bowling <kbowling@FreeBSD.org>
AuthorDate: 2026-09-18 08:29:17 +0000
Commit:     Kevin Bowling <kbowling@FreeBSD.org>
CommitDate: 2026-10-29 06:46:26 +0000

    axgbe: Use the common RSS key without options RSS
    
    Fetch the common key in the PCI iflib frontend regardless of options RSS
    and make the key API declaration available in both configurations.
    Retain the existing hash-field selection and queue-placement branches.
    The independent ARM frontend is unchanged.
    
    Reviewed by:    gallatin
    Sponsored by:   BBOX.io
    Differential Revision:  https://reviews.freebsd.org/D59794
    
    (cherry picked from commit e94de94f8d14ede98d38c9fc506ddf5c77ee9788)
---
 sys/dev/axgbe/if_axgbe_pci.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/sys/dev/axgbe/if_axgbe_pci.c b/sys/dev/axgbe/if_axgbe_pci.c
index 7cf74b49e339..47a2db91821c 100644
--- a/sys/dev/axgbe/if_axgbe_pci.c
+++ b/sys/dev/axgbe/if_axgbe_pci.c
@@ -59,8 +59,8 @@
 #include "opt_inet6.h"
 #include "opt_rss.h"
 
-#ifdef RSS
 #include <net/rss_config.h>
+#ifdef RSS
 #include <netinet/in_rss.h>
 #endif
 
@@ -723,13 +723,17 @@ axgbe_initialize_rss_mapping(struct xgbe_prv_data *pdata)
 {
 	int i;
 
-	/* Get RSS key */
 #ifdef	RSS
 	int	qid;
 	uint32_t	rss_hash_config = 0;
+#endif
 
+	/* Get RSS key independently of software RSS queue placement. */
+	_Static_assert(sizeof(pdata->rss_key) == RSS_KEYSIZE,
+	    "RSS key size mismatch");
 	rss_getkey((uint8_t *)&pdata->rss_key);
 
+#ifdef	RSS
 	rss_hash_config = rss_gethashconfig();
 
 	if (rss_hash_config & RSS_HASHTYPE_RSS_IPV4)
@@ -739,8 +743,6 @@ axgbe_initialize_rss_mapping(struct xgbe_prv_data *pdata)
 	if (rss_hash_config & RSS_HASHTYPE_RSS_UDP_IPV4)
 		XGMAC_SET_BITS(pdata->rss_options, MAC_RSSCR, UDP4TE, 1);
 #else
-	arc4rand(&pdata->rss_key, ARRAY_SIZE(pdata->rss_key), 0);
-
 	XGMAC_SET_BITS(pdata->rss_options, MAC_RSSCR, IP2TE, 1);
 	XGMAC_SET_BITS(pdata->rss_options, MAC_RSSCR, TCP4TE, 1);
 	XGMAC_SET_BITS(pdata->rss_options, MAC_RSSCR, UDP4TE, 1);