svn commit: r260871 - head/sys/netinet

Adrian Chadd adrian at FreeBSD.org
Sat Jan 18 23:48:21 UTC 2014


Author: adrian
Date: Sat Jan 18 23:48:20 2014
New Revision: 260871
URL: http://svnweb.freebsd.org/changeset/base/260871

Log:
  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.

Modified:
  head/sys/netinet/tcp_syncache.c

Modified: head/sys/netinet/tcp_syncache.c
==============================================================================
--- head/sys/netinet/tcp_syncache.c	Sat Jan 18 23:24:51 2014	(r260870)
+++ head/sys/netinet/tcp_syncache.c	Sat Jan 18 23:48:20 2014	(r260871)
@@ -722,6 +722,16 @@ syncache_socket(struct syncache *sc, str
 #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 svn-src-head mailing list