[rfc] set inp_flowid on initial TCP connection

Adrian Chadd adrian at freebsd.org
Thu Jan 16 20:28:39 UTC 2014


Hi,

This patch sets the inp_flowid on incoming connections. Without this,
the initial connection has no flowid, so things like the per-CPU TCP
callwheel stuff would map to a different CPU on the initial incoming
setup.



-a

Index: sys/netinet/tcp_syncache.c
===================================================================
--- sys/netinet/tcp_syncache.c  (revision 260499)
+++ sys/netinet/tcp_syncache.c  (working copy)
@@ -722,6 +722,16 @@
 #endif

        /*
+        * If there's an mbuf and it has a flowid, then let's initialise the
+        * inp with that particular flowid.
+        */
+       if (m != NULL && m->m_flags & M_FLOWID) {
+               inp->inp_flags |= INP_HW_FLOWID;
+               inp->inp_flags &= ~INP_SW_FLOWID;
+               inp->inp_flowid = m->m_pkthdr.flowid;
+       }
+
+       /*
         * Install in the reservation hash table for now, but don't yet
         * install a connection group since the full 4-tuple isn't yet
         * configured.


More information about the freebsd-arch mailing list