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.
This commit is contained in:
Adrian Chadd 2014-01-18 23:48:20 +00:00
parent 95fbe4d0cc
commit 9db69902c6
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=260871

View File

@ -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