git: d93919dc9b6e - stable/15 - enetc: Use the common RSS key
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Thu, 29 Oct 2026 06:49:08 UTC
The branch stable/15 has been updated by kbowling:
URL: https://cgit.FreeBSD.org/src/commit/?id=d93919dc9b6eb5ce3c5ec92b3dcb8d762da25beb
commit d93919dc9b6eb5ce3c5ec92b3dcb8d762da25beb
Author: Kevin Bowling <kbowling@FreeBSD.org>
AuthorDate: 2026-09-18 08:56:00 +0000
Commit: Kevin Bowling <kbowling@FreeBSD.org>
CommitDate: 2026-10-29 06:48:06 +0000
enetc: Use the common RSS key
Replace the random register words with rss_getkey() and decode each
four-byte chunk with le32dec() before writing the port's key registers.
Keep the RSS capability check and existing queue-count and indirection
table programming unchanged.
Reviewed by: gallatin
Sponsored by: BBOX.io
Differential Revision: https://reviews.freebsd.org/D59805
(cherry picked from commit 449fc84f370b079619eaa0d70008391ac07718f5)
---
sys/dev/enetc/if_enetc.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/sys/dev/enetc/if_enetc.c b/sys/dev/enetc/if_enetc.c
index 81e59dc10559..228eb0e26b03 100644
--- a/sys/dev/enetc/if_enetc.c
+++ b/sys/dev/enetc/if_enetc.c
@@ -44,6 +44,7 @@
#include <net/if_types.h>
#include <net/if_media.h>
#include <net/iflib.h>
+#include <net/rss_config.h>
#include <dev/enetc/enetc_hw.h>
#include <dev/enetc/enetc.h>
@@ -603,6 +604,7 @@ enetc_setup_rss(struct enetc_softc *sc)
{
struct iflib_dma_info dma;
int error, i, buckets_num = 0;
+ uint8_t rss_key[RSS_KEYSIZE];
uint8_t *rss_table;
uint32_t reg;
@@ -614,8 +616,11 @@ enetc_setup_rss(struct enetc_softc *sc)
if (buckets_num == 0)
return (ENOTSUP);
+ _Static_assert(ENETC_RSSHASH_KEY_SIZE == RSS_KEYSIZE,
+ "RSS key size mismatch");
+ rss_getkey(rss_key);
for (i = 0; i < ENETC_RSSHASH_KEY_SIZE / sizeof(uint32_t); i++) {
- arc4rand((uint8_t *)®, sizeof(reg), 0);
+ reg = le32dec(rss_key + i * sizeof(reg));
ENETC_PORT_WR4(sc, ENETC_PRSSK(i), reg);
}