git: 2174d5db8d5a - stable/15 - e1000: Use the common RSS key for 82574
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Thu, 29 Oct 2026 06:46:15 UTC
The branch stable/15 has been updated by kbowling:
URL: https://cgit.FreeBSD.org/src/commit/?id=2174d5db8d5aeef61d13020859373c10c15a2cd2
commit 2174d5db8d5aeef61d13020859373c10c15a2cd2
Author: Kevin Bowling <kbowling@FreeBSD.org>
AuthorDate: 2026-09-18 08:29:16 +0000
Commit: Kevin Bowling <kbowling@FreeBSD.org>
CommitDate: 2026-10-29 06:46:06 +0000
e1000: Use the common RSS key for 82574
Use rss_getkey() in the older em multi-queue RSS path, which is reached
by 82574 with two receive queues. This replaces a private key generated
on each initialization and matches the common-key policy already used
by the igb path.
Decode each register word with le32dec() and remove the private assembly
macro, avoiding signed integer shifts while preserving the register byte
order. Leave the redirection table and hash fields unchanged. This does
not change single-queue em devices or PF-owned igb VF RSS settings.
Reviewed by: erj, gallatin
Sponsored by: BBOX.io
Differential Revision: https://reviews.freebsd.org/D59792
(cherry picked from commit a666f1564501734d3d7ec05ab516e40309e81454)
---
sys/dev/e1000/if_em.c | 6 ++++--
sys/dev/e1000/if_em.h | 5 -----
2 files changed, 4 insertions(+), 7 deletions(-)
diff --git a/sys/dev/e1000/if_em.c b/sys/dev/e1000/if_em.c
index 8d17116129d6..bfcb8d808344 100644
--- a/sys/dev/e1000/if_em.c
+++ b/sys/dev/e1000/if_em.c
@@ -4688,11 +4688,13 @@ em_initialize_rss_mapping(struct e1000_softc *sc)
/*
* Configure RSS key
*/
- arc4rand(rss_key, sizeof(rss_key), 0);
+ _Static_assert(sizeof(rss_key) == RSS_KEYSIZE,
+ "RSS key size mismatch");
+ rss_getkey(rss_key);
for (i = 0; i < RSSKEYLEN; ++i) {
uint32_t rssrk = 0;
- rssrk = EM_RSSRK_VAL(rss_key, i);
+ rssrk = le32dec(rss_key + i * sizeof(rssrk));
E1000_WRITE_REG(hw,E1000_RSSRK(i), rssrk);
}
diff --git a/sys/dev/e1000/if_em.h b/sys/dev/e1000/if_em.h
index 2971872fb600..7c6354c04c74 100644
--- a/sys/dev/e1000/if_em.h
+++ b/sys/dev/e1000/if_em.h
@@ -693,9 +693,4 @@ typedef struct _em_vendor_info_t {
void em_dump_rs(struct e1000_softc *);
-#define EM_RSSRK_SIZE 4
-#define EM_RSSRK_VAL(key, i) (key[(i) * EM_RSSRK_SIZE] | \
- key[(i) * EM_RSSRK_SIZE + 1] << 8 | \
- key[(i) * EM_RSSRK_SIZE + 2] << 16 | \
- key[(i) * EM_RSSRK_SIZE + 3] << 24)
#endif /* _EM_H_DEFINED_ */