git: 67661c59f887 - stable/15 - tcp: Unifidef use of rss software hash in syncache

From: Kevin Bowling <kbowling_at_FreeBSD.org>
Date: Thu, 29 Oct 2026 07:41:28 UTC
The branch stable/15 has been updated by kbowling:

URL: https://cgit.FreeBSD.org/src/commit/?id=67661c59f887247ca2535c4cebfc5f902c6d84d5

commit 67661c59f887247ca2535c4cebfc5f902c6d84d5
Author:     Andrew Gallatin <gallatin@FreeBSD.org>
AuthorDate: 2026-01-05 19:54:35 +0000
Commit:     Kevin Bowling <kbowling@FreeBSD.org>
CommitDate: 2026-10-29 07:37:58 +0000

    tcp: Unifidef use of rss software hash in syncache
    
    Ever since "d9c55b2e8cd6 rss: Enable portions of RSS globally.."
    exposed the RSS software hashing functions, it has been possible
    to use them without "ifdef RSS".   Do so now in the syncache
    so as to get flowids recorded.
    
    Note that the use of the rss hash functions is conditional on IP versions,
    so we must ifdef INET to ensure rss_proto_software_hash_v4() is available.
    
    Fixes 73fe85e486d2
    Sponsored by: Netflix
    Reviewed by: glebius, p.mousavizadeh_protonmail.com, nickbanks_netflix.com, tuexen
    Differential Revision: https://reviews.freebsd.org/D54534
    
    (cherry picked from commit 21865c970888ad0e2cde06db843ae2a05af550e7)
---
 sys/netinet/tcp_syncache.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/sys/netinet/tcp_syncache.c b/sys/netinet/tcp_syncache.c
index 912ef6223ee1..84f19a3ee35d 100644
--- a/sys/netinet/tcp_syncache.c
+++ b/sys/netinet/tcp_syncache.c
@@ -36,7 +36,6 @@
 #include "opt_inet.h"
 #include "opt_inet6.h"
 #include "opt_ipsec.h"
-#include "opt_rss.h"
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -887,7 +886,6 @@ syncache_socket(struct syncache *sc, struct socket *lso, struct mbuf *m)
 	if (sc->sc_flowtype != M_HASHTYPE_NONE) {
 		inp->inp_flowid = sc->sc_flowid;
 		inp->inp_flowtype = sc->sc_flowtype;
-#ifdef	RSS
 	} else {
 		  /* assign flowid by software RSS hash */
 #ifdef INET6
@@ -902,6 +900,7 @@ syncache_socket(struct syncache *sc, struct socket *lso, struct mbuf *m)
 		  } else
 #endif	/* INET6 */
 		  {
+#ifdef INET
 			rss_proto_software_hash_v4(inp->inp_faddr,
 						   inp->inp_laddr,
 						   inp->inp_fport,
@@ -909,8 +908,8 @@ syncache_socket(struct syncache *sc, struct socket *lso, struct mbuf *m)
 						   IPPROTO_TCP,
 						   &inp->inp_flowid,
 						   &inp->inp_flowtype);
+#endif /* INET */
 		  }
-#endif	/* RSS */
 	}
 #ifdef NUMA
 	inp->inp_numa_domain = sc->sc_numa_domain;