From owner-freebsd-net@freebsd.org Fri Jul 22 01:54:10 2016 Return-Path: Delivered-To: freebsd-net@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8E4A2BA0B2D for ; Fri, 22 Jul 2016 01:54:10 +0000 (UTC) (envelope-from sepherosa@gmail.com) Received: from mail-vk0-x22e.google.com (mail-vk0-x22e.google.com [IPv6:2607:f8b0:400c:c05::22e]) (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 51AB51171; Fri, 22 Jul 2016 01:54:10 +0000 (UTC) (envelope-from sepherosa@gmail.com) Received: by mail-vk0-x22e.google.com with SMTP id n129so93072428vke.3; Thu, 21 Jul 2016 18:54:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=GZAhGKgtlep3n5lAGiN/Cp6MCbRPS7NI5LzoVvreNO0=; b=PqI06/yzdHROwGAIsyMPxL5KJKBlsgV2r6rg72N1KwvkO61jodVl1B/9EoTxkoX7rE be4v6LIzE5zjnGbr0IV5WUtEH5Pf0fCSiflHi1rwBCiWudC2u+G4nFIcti7n2UYiUyh+ 4Ry9v+CNYRh6Wu38Z/vhozMMr0drssJMezJptdvrBhDtkD2UGW0fpRaV50qyZ744xZv7 tB4DvkMco3otJ1/EVhjbf+8zTzgtK03MvBK0lN/gWyAcMiLv2hVyTQFjsJrWWudpC2Ko I8FcaUN52u8BdaxFHXFGmeS3GQFR5WNRfmfiDHyj9qGJWtWIRAPqCNS2/QU1hQqWMNHj Zq6g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=GZAhGKgtlep3n5lAGiN/Cp6MCbRPS7NI5LzoVvreNO0=; b=Ogmds4trac38GvsxgEoyLs+ocCkPsC4iZCYHPryqDGFI5/HmnSOlsY5SwWwRsiQYM/ cfHOFM5j7l27Y190sq3R+hVYgTWrdCyJs/WrNfhljcwuKdHHaZGJY+hwgNMJ6RWhjPKx Qutf2BsX7+eqf5elJDM+dA/F/1bIqDiM92x9kfjLOpwoHJsgvoJB/yymPelcikY0gjwx 9aa/pKPefhFHGxs4HVtFDPdB6UsQlt0QKQzn9piFUz21jfAiosCd3wAeoleJy4KGsYs+ PrIgyw0MhORULaXcZlUodlHppFjRug5ft0GcNog5ULTD6NNSwlodLddM/cVAW81wCxJM mKBQ== X-Gm-Message-State: AEkoousIRphMTCCCvZpaQtpifOOqmVsjWsSaPrjUeten0eJWKgrAs7Mn7N0NEsNvY8dS7n/L5pxragdYa3/Uew== X-Received: by 10.159.40.167 with SMTP id d36mr608648uad.60.1469152449033; Thu, 21 Jul 2016 18:54:09 -0700 (PDT) MIME-Version: 1.0 Received: by 10.176.83.101 with HTTP; Thu, 21 Jul 2016 18:54:08 -0700 (PDT) In-Reply-To: References: <306af514-70ff-f3bf-5b4f-da7ac1ec6580@cs.duke.edu> From: Sepherosa Ziehau Date: Fri, 22 Jul 2016 09:54:08 +0800 Message-ID: Subject: Re: proposal: splitting NIC RSS up from stack RSS To: Adrian Chadd Cc: Andrew Gallatin , FreeBSD Net Content-Type: text/plain; charset=UTF-8 X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 Jul 2016 01:54:10 -0000 On Fri, Jul 22, 2016 at 6:39 AM, Adrian Chadd wrote: > hi, > > Cool! Yeah, the RSS bits thing can be removed, as it's just doing a > bitmask instead of a % operator to do mapping. I think we can just go > to % and if people need the extra speed from a power-of-two operation, > they can reintroduce it. I thought about it a while ago (the most popular E5-2560v{1,2,3} only has 6 cores, but E5-2560v4 has 8 cores! :). Since the raw RSS hash value is '& 0x1f' (I believe most of the NICs use 128 entry indirect table as defined by MS RSS) to select an entry in the indirect table, simply '%' on the raw RSS hash value probably will not work properly; you will need (hash&0x1f)%mp_ncpus at least. And well, since the indirect table's size if 128, you still will get some uneven CPU workload for non-power-of-2 cpus. And if you take cpu affinity into consideration, the situation will be even more complex ... Thanks, sephe