aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbigJ <bigj@solanavibestation.com>2026-03-01 20:14:49 +0000
committerPouria Mousavizadeh Tehrani <pouria@FreeBSD.org>2026-03-16 08:52:35 +0000
commit283ef95d1677b873903f8b8fa077fbfa3a5e0036 (patch)
treee3b3d973dba4090893335f33e2bd0e6ff758c8c2
parente6083790f217ba7f89cd2957922bd45e35466359 (diff)
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
-rw-r--r--sys/net/rss_config.c34
1 files 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);
}
/*