From owner-freebsd-arch@FreeBSD.ORG Sun Jan 19 23:23:25 2014 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 311A9E37; Sun, 19 Jan 2014 23:23:25 +0000 (UTC) Received: from mail-qe0-x231.google.com (mail-qe0-x231.google.com [IPv6:2607:f8b0:400d:c02::231]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id D2FCD161F; Sun, 19 Jan 2014 23:23:24 +0000 (UTC) Received: by mail-qe0-f49.google.com with SMTP id w4so5750736qeb.22 for ; Sun, 19 Jan 2014 15:23:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:content-type; bh=0q9dJTb7RECFfSOKXxbQE0tEBBCzypoq/yY+yAF2pq0=; b=VxNRa0gUj1e/U6QMWUvLVXp2SAg+23iwQ1pkWwDvYGncazFNhXKpq+EoMa4oj3XMjd jOY6DgY0tIY0hUtv1rQmc0mQYjV8yKDq98SVqem3YKiF3MNxWtdR3Ddpxfj3ktOsseoS VdxsLhAR2om3CE4aa7KM218eqRc4ppX6suQ7fSE6Alqsjc/OJqtyrPdOD934/79KY6Nj 5WdhTni39SOsehwYG/QMuaDO3oHHvCkgzBGO4ribVJToFT2D8QxGv7Nte/hBLd1RsNEl ksmGFh5IFTrfwLhXljyF/cIBNTtr8PRFE8g4L7IsXoILoTUebc2e9GT6LpygOhgIDvRK jWiw== MIME-Version: 1.0 X-Received: by 10.140.96.180 with SMTP id k49mr19171647qge.4.1390173804048; Sun, 19 Jan 2014 15:23:24 -0800 (PST) Sender: adrian.chadd@gmail.com Received: by 10.224.52.8 with HTTP; Sun, 19 Jan 2014 15:23:23 -0800 (PST) In-Reply-To: References: Date: Sun, 19 Jan 2014 15:23:23 -0800 X-Google-Sender-Auth: OPdobZwUZScu0Q6itl6_OEu-NrY Message-ID: Subject: Re: [rfc] set inp_flowid on initial TCP connection From: Adrian Chadd To: FreeBSD Net , "freebsd-arch@freebsd.org" Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Jan 2014 23:23:25 -0000 Ok, I've committed this to -HEAD. Thanks, -a On 16 January 2014 12:28, Adrian Chadd wrote: > Hi, > > This patch sets the inp_flowid on incoming connections. Without this, > the initial connection has no flowid, so things like the per-CPU TCP > callwheel stuff would map to a different CPU on the initial incoming > setup. > > > > -a > > Index: sys/netinet/tcp_syncache.c > =================================================================== > --- sys/netinet/tcp_syncache.c (revision 260499) > +++ sys/netinet/tcp_syncache.c (working copy) > @@ -722,6 +722,16 @@ > #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.