From owner-freebsd-net@FreeBSD.ORG Thu Jan 16 20:28:39 2014 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BBB44728; Thu, 16 Jan 2014 20:28:39 +0000 (UTC) Received: from mail-qe0-x229.google.com (mail-qe0-x229.google.com [IPv6:2607:f8b0:400d:c02::229]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 6C1A515AC; Thu, 16 Jan 2014 20:28:39 +0000 (UTC) Received: by mail-qe0-f41.google.com with SMTP id i11so3099659qej.28 for ; Thu, 16 Jan 2014 12:28:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:date:message-id:subject:from:to:content-type; bh=kqVwmanGwcd1AeA3L+3k/XPOonHxQuZpAx7hSNBYflg=; b=ob/9V3uagq1CACMtMUH7eU9sLDrdE1zyL8q8jEFLnkheWKsHDJXYZft5BvIXvU8rr4 zlK1unik4HbVP0zN5zippgaZ18q6HrL6g88hFQ8UHefNlLoqkrmG9FZRsfiTBiWQxYuJ a6l5GWOOX4G1Y1t1iUeyF2kL/W03bo4O9ePe4eCzpTUGEgfnMVZTZH1uMDGVufCktYop 3HY0m7PkNRiPp4NO1tLimQBSyR2PX9SFt0ehTYmEJbqQBEyo+4LfpvfOo095F0jDFBXA fW1RpsCP/iTrPb63nFwDB0pIRKrt+vMYiwlnz0f5456JxU+FxnxdUtwI1zVMSAyHcTQR WmKg== MIME-Version: 1.0 X-Received: by 10.229.122.195 with SMTP id m3mr19467158qcr.7.1389904118630; Thu, 16 Jan 2014 12:28:38 -0800 (PST) Sender: adrian.chadd@gmail.com Received: by 10.224.52.8 with HTTP; Thu, 16 Jan 2014 12:28:38 -0800 (PST) Date: Thu, 16 Jan 2014 12:28:38 -0800 X-Google-Sender-Auth: l6Xtus_xKpTZTe7V0K7MzCHciIc Message-ID: Subject: [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-net@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Jan 2014 20:28:39 -0000 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.