summaryrefslogtreecommitdiffstats
path: root/sys/netinet
diff options
context:
space:
mode:
authoradrian <adrian@FreeBSD.org>2014-02-10 06:29:05 +0000
committeradrian <adrian@FreeBSD.org>2014-02-10 06:29:05 +0000
commit3ee8d78c97a64890c03356fa83d9c33d068ea7f9 (patch)
treeef9e8815b04a812907b5970edeb46939aa3ee087 /sys/netinet
parent6ceb8edc35e932357e951e541377bd1e2dc4e88c (diff)
downloadFreeBSD-src-3ee8d78c97a64890c03356fa83d9c33d068ea7f9.zip
FreeBSD-src-3ee8d78c97a64890c03356fa83d9c33d068ea7f9.tar.gz
MFC r260871:
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 1c27d7a..2ade9ee 100644
--- a/sys/netinet/tcp_syncache.c
+++ b/sys/netinet/tcp_syncache.c
@@ -721,6 +721,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