From owner-freebsd-net@FreeBSD.ORG Mon Feb 23 20:38:56 2015 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.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id F1EAEAA0 for ; Mon, 23 Feb 2015 20:38:56 +0000 (UTC) Received: from mail-ie0-x22b.google.com (mail-ie0-x22b.google.com [IPv6:2607:f8b0:4001:c03::22b]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BA3D3B8D for ; Mon, 23 Feb 2015 20:38:56 +0000 (UTC) Received: by iecrl12 with SMTP id rl12so26708026iec.2 for ; Mon, 23 Feb 2015 12:38:56 -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=6Ba/JnbNMN9XrsVAEJ84+frQlchHUboJg3o6RIa3g+Q=; b=eb5BqanQzAmp7qx9QYi1Sa+eToKoBiyvWerUrOMtuWUY83SYKERw2FvAwRWZf5EQ/K QTJAiE2aW0e+fqjPPqs6710479KnxccU1J/4cpRo26OrfPO/zdyRtq2EeN3quWsbTCvX wCnOcCIwudRJPrtCJ6G+xTZKT7JtTOIOMdySBr2OwPS0qw3R7I9ClrcrS93uTVNzvrfQ MHJsfXiea2jOAUt3tFZzSDemw/6r68aV+6/G74GP4WwbRA3DFS78aXdXveCKSUMGnlHe sZC3va6ZFX7ou/XF54qEQDlYcytn6mRVEGljDePdeyAuZvyCFQlM6ZBZP+Bkz9nJZEX7 1PZw== MIME-Version: 1.0 X-Received: by 10.50.107.7 with SMTP id gy7mr15351329igb.49.1424723936019; Mon, 23 Feb 2015 12:38:56 -0800 (PST) Sender: adrian.chadd@gmail.com Received: by 10.36.17.66 with HTTP; Mon, 23 Feb 2015 12:38:55 -0800 (PST) Date: Mon, 23 Feb 2015 12:38:55 -0800 X-Google-Sender-Auth: CAMfXzP19_ZD5REfAxiPq1kQCu4 Message-ID: Subject: Looking for help with RSS IPv6 - need software hash code! From: Adrian Chadd To: FreeBSD Net Content-Type: text/plain; charset=UTF-8 X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Feb 2015 20:38:57 -0000 Hi! The last annoyingish bit for IPv6 RSS support is a full software hash routine to calculate an RSS hash based on the various fields in the IPv6 header. I'm unfortunately out of spare cycles to try and finish it so I'm asking for help. In order to support this in the kernel we need to not only know what to do with the hardware RSS, but also have a fallover path to software hashing if the NIC doesn't hash it for us, or doesn't hash it correctly. For example, if we get IPv4/IPv6 fragments (which yes, are a thing, don't tell me they're not), we need to reassemble the fragments into a single frame, and then re-calculate the RSS hash on the reassembled frame header to figure out where it would've gone. We have to do this because the RSS hash value is also used as an index into the PCBGROUP hash table array - so no matter whether packets in a flow are fragmented or not, they're correctly serialised into the same netisr queue and the PCB information for that flow is in the same PCBGROUP array bucket. For doing "correct" RSS, we need to have support for hashing various fields and this isn't just limited to 2-tuple / 4-tuple hashing. IPv6 has a bunch of mobility header options and RSS has support for these (the TCP_EX and UDP_EX fields.) I've done the software hashing path for IPv4, but I need someone to help me do the IPv6 RSS hash calculation for all the variations - IPv6 2-tuple IPv6 TCP, IPv6 UDP, IPv6 TCP_EX (mobility), UDP_EX (mobility.) The microsoft RSS specification is online and freely available; it has all of these as examples. So, I'm asking for help. If you're able to help, please look at the code in -HEAD in sys/netinet/in_rss.c and sys/netinet6/in6_rss.c. You'll see what's missing. You don't need a NIC that has RSS enabled; if you enable RSS and PCBGROUPS in the kernel (and bump up the number of netisr queues; that still isn't auto-set at boot time) then you'll see that traffic will get distributed by software hashing of the packet headers. Thanks! -adrian