Received: by 10.213.65.68 with SMTP id h4csp3585408imn; Tue, 3 Apr 2018 07:30:17 -0700 (PDT) X-Google-Smtp-Source: AIpwx4/zogIhK4wt6H46FFbRcs8mjgC7LBJGZEbzWCFCU88Y8ObfJR5ajkPCkMBdLaohH2VnaACO X-Received: by 10.99.142.201 with SMTP id k192mr9270257pge.278.1522765817067; Tue, 03 Apr 2018 07:30:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522765817; cv=none; d=google.com; s=arc-20160816; b=ctUxkKo82KpWAeGL6n4GQi5+85bn86znu4FOdi+3On7KZIQXmDkw4aQ7cNtFQjCuzM 8j7JYnmUfFonQ6HPNXVXRa4Js3I9aegq9aBhbLCZ8robDw63V3cg8QL1MMCsOVQrrd9p yDXXVuunHQRJwkuVuPmHTbDJO0w+eNqOBYD7v+ZY12pZDlsPtQzrsxkiLX1HSx7AXlWS jmpJokR7b7NGabs9DUyBWPAoDYfm3xtdJXIAt6EWcFeDtM2J41esPDICwQUvJgczSPiu BWt4FMLUBUuaBfCTklOqXMgJWs270KkpO3dtGlWIjIr4AQZ/nQcZ623iZq2vZeXfaXeK FTUA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:to:subject:arc-authentication-results; bh=FWNa9XyqaGJe4gM4Zcg8g6xBrHFrh8h6nwQykShrIqY=; b=Ggnctre9QRY1U+lJcDC+wB0HrXQVhW5feSUOw5t/uy+xYIdevGw8wnhMbb2mZTUgjm fdf6CLeD6IMWV7RW1O28jSUM8U75dRPYtElZyGJhDQTCSOgSUZzhUbXEVtmZxnuILtqr 0/ZLU0y17abGAeotWIgE3ianG3MDJnXK3hcmCX/n+MZEHFkGcqbnSagWx7ncdyl1twuK NfuId5pgBQHjgQB06Trwq9Txc8HSXAB70csl9gXssJ8kRmwnmBNLrkbRE+W+RlNtljhw AE3endDCml7Js3Q5/uM6rIN7QnF42sV6SjOFahBYWmGLovmbFwzp7RNV7XrClA5JnUBZ abWg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 31-v6si3077657pli.226.2018.04.03.07.30.03; Tue, 03 Apr 2018 07:30:17 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751496AbeDCO2s (ORCPT + 99 others); Tue, 3 Apr 2018 10:28:48 -0400 Received: from smtp826.redehostenvio.com.br ([187.84.239.40]:47244 "EHLO smtp826.redehostenvio.com.br" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751247AbeDCO2r (ORCPT ); Tue, 3 Apr 2018 10:28:47 -0400 X-Greylist: delayed 602 seconds by postgrey-1.27 at vger.kernel.org; Tue, 03 Apr 2018 10:28:46 EDT Received: by smtp794.redehostenvio.com.br id hoe81q2dcgcb for ; Tue, 3 Apr 2018 11:20:49 -0300 (envelope-from ) Received: from mailexc06.redehost.com.br (mailexc06.redehost.com.br [187.84.231.133]) by RHCNTSCOUT03.redehost.com.br (8.14.4/8.14.4/Debian-8) with ESMTP id w33EIgUB013838 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT); Tue, 3 Apr 2018 11:18:42 -0300 Subject: Re: [PATCH] net: improve ipv4 performances To: Anton Gary Ceph , , References: <20180401183121.13022-1-agaceph@gmail.com> From: Douglas Caetano dos Santos Message-ID: Date: Tue, 3 Apr 2018 11:18:40 -0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 In-Reply-To: <20180401183121.13022-1-agaceph@gmail.com> Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [179.219.244.203] Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Anton, everyone, On 04/01/18 15:31, 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. My two cents on the matter: You should not consider favoring some parts of code in detriment of another just because of one use case. In your patch, you're considering one server that attends for IPv4 and IPv6 connections simultaneously, in a proportion seen on the Internet, but you completely disregard the use cases of servers that could serve, for example, only IPv6. What about those, just let them slow down? What I think about such hints and optimizations - someone correct me if I'm wrong - is that they should be done not with specific use cases in mind, but according to the code flow in general. For example, it could be a good idea to slow down ARP requests, because there is AFAIK not such a server that attends only ARP (not that I'm advocating for it, just using as an example). But slowing down IPv6, as Eric already said, is utterly non-sense. Again, "low IPv6 usage" doesn't mean code that is barely touched, with an IPv6-only server being the obvious example. -- Douglas