Date: Thu, 16 Jan 2014 12:28:38 -0800 From: Adrian Chadd <adrian@freebsd.org> To: FreeBSD Net <freebsd-net@freebsd.org>, "freebsd-arch@freebsd.org" <freebsd-arch@freebsd.org> Subject: [rfc] set inp_flowid on initial TCP connection Message-ID: <CAJ-VmonO3i7bdY7t8gWyFOcDRA8g_5GYX_0ijhkCxnQkkBwaww@mail.gmail.com>
next in thread | raw e-mail | index | archive | help
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.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAJ-VmonO3i7bdY7t8gWyFOcDRA8g_5GYX_0ijhkCxnQkkBwaww>
