Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 18 Jan 2014 23:48:20 +0000 (UTC)
From:      Adrian Chadd <adrian@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r260871 - head/sys/netinet
Message-ID:  <201401182348.s0INmK8S002466@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
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.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201401182348.s0INmK8S002466>