summaryrefslogtreecommitdiffstats
path: root/sys/netinet
diff options
context:
space:
mode:
authoradrian <adrian@FreeBSD.org>2014-01-18 23:48:20 +0000
committeradrian <adrian@FreeBSD.org>2014-01-18 23:48:20 +0000
commitea15a84683afb8d5458f1b934244dedec05043fd (patch)
tree7661ed08767b2bf2d1eac7f4916dece486d4b596 /sys/netinet
parent881c9e28bfecd7527db2dc2584a7ab19e733c821 (diff)
downloadFreeBSD-src-ea15a84683afb8d5458f1b934244dedec05043fd.zip
FreeBSD-src-ea15a84683afb8d5458f1b934244dedec05043fd.tar.gz
If the flowid is available for the mbuf that finalised the creation
of a syncache connection, copy it into the inp_flowid field. Without this, an incoming TCP connection won't have an inp_flowid marked until some data comes in, and this means that things like the per-CPU TCP timer option will choose a different CPU for the timer work. (It also means that if one grabbed the flowid via an ioctl from userland, it won't be available until some data has been received.) Sponsored by: Netflix, Inc.
Diffstat (limited to 'sys/netinet')
-rw-r--r--sys/netinet/tcp_syncache.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/sys/netinet/tcp_syncache.c b/sys/netinet/tcp_syncache.c
index 29d9d53..af30ad1 100644
--- a/sys/netinet/tcp_syncache.c
+++ b/sys/netinet/tcp_syncache.c
@@ -722,6 +722,16 @@ syncache_socket(struct syncache *sc, struct socket *lso, struct mbuf *m)
#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.
OpenPOWER on IntegriCloud