git: 283ef95d1677 - main - rss_config: Add option to enable rss udp hashing
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Mon, 16 Mar 2026 08:59:12 UTC
The branch main has been updated by pouria:
URL: https://cgit.FreeBSD.org/src/commit/?id=283ef95d1677b873903f8b8fa077fbfa3a5e0036
commit 283ef95d1677b873903f8b8fa077fbfa3a5e0036
Author: bigJ <bigj@solanavibestation.com>
AuthorDate: 2026-03-01 20:14:49 +0000
Commit: Pouria Mousavizadeh Tehrani <pouria@FreeBSD.org>
CommitDate: 2026-03-16 08:52:35 +0000
rss_config: Add option to enable rss udp hashing
Added optional system tunable parameter to enable
4-tuple rss udp hashing.
Signed-off-by: bigJ <bigj@solanavibestation.com>
Reviewed by: adrian, pouria
Pull Request: https://github.com/freebsd/freebsd-src/pull/2057
---
sys/net/rss_config.c | 34 ++++++++++++++++++++++------------
1 file changed, 22 insertions(+), 12 deletions(-)
diff --git a/sys/net/rss_config.c b/sys/net/rss_config.c
index 5be5aecd15d9..9b805085d5ce 100644
--- a/sys/net/rss_config.c
+++ b/sys/net/rss_config.c
@@ -150,6 +150,11 @@ int rss_debug = 0;
SYSCTL_INT(_net_inet_rss, OID_AUTO, debug, CTLFLAG_RWTUN, &rss_debug, 0,
"RSS debug level");
+static u_int rss_udp_4tuple = 0;
+SYSCTL_INT(_net_inet_rss, OID_AUTO, udp_4tuple, CTLFLAG_RDTUN,
+ &rss_udp_4tuple, 0,
+ "Enable UDP 4-tuple RSS hashing (src/dst IP + src/dst port)");
+
/*
* RSS secret key, intended to prevent attacks on load-balancing. Its
* effectiveness may be limited by algorithm choice and available entropy
@@ -488,19 +493,24 @@ rss_gethashconfig(void)
* So for now disable UDP 4-tuple hashing until all of the other
* pieces are in place.
*/
- return (
+ u_int config;
+
+ config =
RSS_HASHTYPE_RSS_IPV4
- | RSS_HASHTYPE_RSS_TCP_IPV4
- | RSS_HASHTYPE_RSS_IPV6
- | RSS_HASHTYPE_RSS_TCP_IPV6
- | RSS_HASHTYPE_RSS_IPV6_EX
- | RSS_HASHTYPE_RSS_TCP_IPV6_EX
-#if 0
- | RSS_HASHTYPE_RSS_UDP_IPV4
- | RSS_HASHTYPE_RSS_UDP_IPV6
- | RSS_HASHTYPE_RSS_UDP_IPV6_EX
-#endif
- );
+ | RSS_HASHTYPE_RSS_TCP_IPV4
+ | RSS_HASHTYPE_RSS_IPV6
+ | RSS_HASHTYPE_RSS_TCP_IPV6
+ | RSS_HASHTYPE_RSS_IPV6_EX
+ | RSS_HASHTYPE_RSS_TCP_IPV6_EX;
+
+ if (rss_udp_4tuple) {
+ config |=
+ RSS_HASHTYPE_RSS_UDP_IPV4
+ | RSS_HASHTYPE_RSS_UDP_IPV6
+ | RSS_HASHTYPE_RSS_UDP_IPV6_EX;
+ }
+
+ return (config);
}
/*