From owner-freebsd-net@FreeBSD.ORG Thu May 15 04:43:40 2014 Return-Path: Delivered-To: freebsd-net@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 16DAE833; Thu, 15 May 2014 04:43:40 +0000 (UTC) Received: from mail-qc0-x22f.google.com (mail-qc0-x22f.google.com [IPv6:2607:f8b0:400d:c01::22f]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B86F32FAE; Thu, 15 May 2014 04:43:39 +0000 (UTC) Received: by mail-qc0-f175.google.com with SMTP id w7so917205qcr.34 for ; Wed, 14 May 2014 21:43:38 -0700 (PDT) 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=jhKEnfy+S3LIg3ExmQD+qvQG9QGh1+sT6wjto8q98/8=; b=ncf+edh1PaJ/r5WdUIrf7jqbfol5+jv+HsfNotJ/ogctKh/BN0EvL1HIX9eGeK+1EZ JaWBv1Yu7DADTixbB1usDWOEj3LqKw4IciZNA+pgd0N4K0JFmNeyqhB8bGmBR2d+CGVZ nSwIQHnpyw2QEzYtTVN4ecbS7mnExlY8gXzge/JcKPlkF33OBKyXNScdF3tiI6aFPdbv MJNAR03Llc8vRBo9LJCUoEEJ1Vfw/LD7Mx7SaARD6Fk3N3JwBIPN9m+vJUJnI9IDT0IO hV1Rr1qBtfFKf7+ECWBxrY541gveYsOv230wMn9EMbeoI60DaVaPPDybOoYWef9dJHu4 v9NA== MIME-Version: 1.0 X-Received: by 10.224.16.199 with SMTP id p7mr9666950qaa.76.1400129018305; Wed, 14 May 2014 21:43:38 -0700 (PDT) Sender: adrian.chadd@gmail.com Received: by 10.224.191.201 with HTTP; Wed, 14 May 2014 21:43:38 -0700 (PDT) Date: Wed, 14 May 2014 21:43:38 -0700 X-Google-Sender-Auth: 615EBagYUG4pOjyHhtu_W3pPu-E Message-ID: Subject: [rfc] tcp timer update for RSS From: Adrian Chadd To: "freebsd-arch@freebsd.org" , FreeBSD Net Content-Type: text/plain; charset=UTF-8 X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.18 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, 15 May 2014 04:43:40 -0000 Hi, here's a completely untested patch for discussion. I'm emailing it out mostly as a "is this a good idea" patch rather than a "it should just be committed" patch. The RSS stuff from Robert maps connections to pcbgroups based on the RSS hash, but it doesn't map the TCP timers the same way. So by default they're all on swi0 and the per CPU timers don't take the hash type or correctly choose the CPU. This patch: http://people.freebsd.org/~adrian/norse/20140514-tcp-rss-timers-1.diff does a few things: * it stores the hashtype in the inp as well as the flowid; * the rss code grows a new method that maps the flowid/hashtype to a cpuid * .. and the existing mbuf to cpuid method now uses this; * the tcp timer code now has an inline function that knows about RSS and defaults to the existing way of doing things if RSS isn't enabled. There's still a bunch of work left before all the lock contention compartmentalization and balancing of RSS is realised. I'm just chewing off the little corner bits that are easy to get done now. So, any comments? I'll give it a proper whirl on some 10G hardware in a few days but I thought I'd at least get the general idea out there for comment. Thanks, -a