The branch main has been updated by kbowling: URL: https://cgit.FreeBSD.org/src/commit/?id=449fc84f370b079619eaa0d70008391ac07718f5
commit 449fc84f370b079619eaa0d70008391ac07718f5 Author: Kevin Bowling <[email protected]> AuthorDate: 2026-09-18 08:56:00 +0000 Commit: Kevin Bowling <[email protected]> CommitDate: 2026-09-18 23:10:30 +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 MFC after: 2 weeks Sponsored by: BBOX.io Differential Revision: https://reviews.freebsd.org/D59805 --- 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); }
