From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stephen Hemminger Subject: Re: [PATCH] net: improve ipv4 performances Date: Sun, 1 Apr 2018 11:50:44 -0700 Message-ID: <20180401115044.17f7ccb4@xeon-e3> References: <20180401183121.13022-1-agaceph@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org To: Anton Gary Ceph Return-path: Received: from mail-pf0-f194.google.com ([209.85.192.194]:36747 "EHLO mail-pf0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753830AbeDASur (ORCPT ); Sun, 1 Apr 2018 14:50:47 -0400 Received: by mail-pf0-f194.google.com with SMTP id g14so8117143pfh.3 for ; Sun, 01 Apr 2018 11:50:47 -0700 (PDT) In-Reply-To: <20180401183121.13022-1-agaceph@gmail.com> Sender: netdev-owner@vger.kernel.org List-ID: On Sun, 1 Apr 2018 20:31:21 +0200 Anton Gary Ceph wrote: > As the Linux networking stack is growing, more and more protocols are > added, increasing the complexity of stack itself. > Modern processors, contrary to common belief, are very bad in branch > prediction, so it's our task to give hints to the compiler when possible. > > After a few profiling and analysis, turned out that the ethertype field > of the packets has the following distribution: > > 92.1% ETH_P_IP > 3.2% ETH_P_ARP > 2.7% ETH_P_8021Q > 1.4% ETH_P_PPP_SES > 0.6% don't know/no opinion > > From a projection on statistics collected by Google about IPv6 adoption[1], > IPv6 should peak at 25% usage at the beginning of 2030. Hence, we should > give proper hints to the compiler about the low IPv6 usage. > > Here is an iperf3 run before and after the patch: > > Before: > [ ID] Interval Transfer Bandwidth Retr > [ 4] 0.00-100.00 sec 100 GBytes 8.60 Gbits/sec 0 sender > [ 4] 0.00-100.00 sec 100 GBytes 8.60 Gbits/sec receiver > > After > [ ID] Interval Transfer Bandwidth Retr > [ 4] 0.00-100.00 sec 109 GBytes 9.35 Gbits/sec 0 sender > [ 4] 0.00-100.00 sec 109 GBytes 9.35 Gbits/sec receiver > > [1] https://www.google.com/intl/en/ipv6/statistics.html > > Signed-off-by: Anton Gary Ceph I am surprised it makes that much of an impact. It would be easier to manage future bisection if the big patch was split into several pieces. Bridge, bonding, netfilter, etc. There doesn't appear to be any direct cross dependencies.