Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp2027423pxf; Sat, 13 Mar 2021 05:33:02 -0800 (PST) X-Google-Smtp-Source: ABdhPJwUapSPFjgkyrBazaWXE6JNoUUJ2uqapzgK6UEzP4QcmWSIuDj4bzebdwC2VX00HMWmeWJc X-Received: by 2002:aa7:d511:: with SMTP id y17mr19848078edq.275.1615642382513; Sat, 13 Mar 2021 05:33:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1615642382; cv=none; d=google.com; s=arc-20160816; b=Umh1OB/gQVAUH85LmBrWj3Zzvg30hXtXxMaCjK9cVR0SYTrMI8KbNU7icM5iDbPSLK FSKjQwlEqnjWQnP+5sw7dmbFbcr8josFjSebGMre8bhGlo5/2pJ/5WvOB0Q36ZNS0DYJ RAIGoJDWZr1aRQpB7qBYzhDHo3GjU9x8bXcEe/uDFAWUclnzgRYsFINV7wwr0ZgHRGsz FPEHIex67Ule1BCUULZS6Pk6X8WLSXetWvXbIhUzEFWxlKQmrwYTsduYIolcjeiCCqdf +TmI/nwL5ho0paBmunJBOGxloidPhiM3P0uu8AQcLjx/VioJqJCpo9yvVmjVi1VabQas 8Zuw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:reply-to:cc:from:to :dkim-signature:date; bh=6r1N5OSEeyM3HNy+jVrlMhPyXWgVSnlITt0tT5FGaWU=; b=Q8aNChw3VBQD7jJ1yIeES9aWdIUpNtz9gl6/HM0JiN7WHAA3IP9dTFyMjUTc+Lk2Ip +eG9YiPKyR1fz8qYEo0BqHFWWH0OYKd4tU0s69Z7aex0LC0ZSVeF3mlL1TneFA7MQ8MN hZp7Hw0Pi40GmwUNTftbzgJF278myBHyx7/crXprdBnka1S+1kCunxyEzcqLFOK5gGju X2xqC3uQN3AwYSWm8xcOA+0rLkOSEX9PTtp0SbG7ncjiWVSTEiKSovjkhLkj6aLtPl20 uPadCJbXwQhXLXTvsK/o1bhiWfVKFT7tg84Ig2PX9by4l3cstZXOm0GJVCXzUg74l6Ts SBhw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@pm.me header.s=protonmail header.b=CTgpkDnM; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=pm.me Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id co27si6600194edb.376.2021.03.13.05.32.39; Sat, 13 Mar 2021 05:33:02 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@pm.me header.s=protonmail header.b=CTgpkDnM; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=pm.me Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233685AbhCMNax (ORCPT + 99 others); Sat, 13 Mar 2021 08:30:53 -0500 Received: from mail-40136.protonmail.ch ([185.70.40.136]:17620 "EHLO mail-40136.protonmail.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233529AbhCMNaj (ORCPT ); Sat, 13 Mar 2021 08:30:39 -0500 Date: Sat, 13 Mar 2021 13:30:24 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pm.me; s=protonmail; t=1615642236; bh=6r1N5OSEeyM3HNy+jVrlMhPyXWgVSnlITt0tT5FGaWU=; h=Date:To:From:Cc:Reply-To:Subject:In-Reply-To:References:From; b=CTgpkDnM5DFkOhsoutj5H+n+LLd0lnuqmRm9fsR3jKhJfiCVKfBcS0G5U3xihok23 PRk8Ygz0XEKq4fu+OZrbyVk8G8/di1dlGIdBUkYF2hbJN5SOjnkFgBGB6nOUsCuUgC 8Mr2IkI9xqrbSeISjIm93HXg6Oy3UVx39hWWPOdmYqwf2q1Zj1K384wYhIxRZVH4AX IOsMfRCmlVjWbkmD81MSQzDOZGGd1CtbilKOpRTvpGZk4KcjLL2gG/pPA/BZQbCmDL zJ+BNWXHd3qDYMPQ1Am1ybNWR0S3JXXgjy7wB5NICMMByVD6YDp75ioNHrHuI4FWy0 p9Uf3yMsS8JnA== To: "David S. Miller" , Jakub Kicinski From: Alexander Lobakin Cc: Alexander Lobakin , Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko , Martin KaFai Lau , Song Liu , Yonghong Song , John Fastabend , KP Singh , Jonathan Lemon , Eric Dumazet , Willem de Bruijn , Kevin Hao , Pablo Neira Ayuso , Jakub Sitnicki , Marco Elver , Dexuan Cui , Vladimir Oltean , Ariel Levkovich , Wang Qing , Davide Caratti , Guillaume Nault , Eran Ben Elisha , Mauro Carvalho Chehab , Kirill Tkhai , Bartosz Golaszewski , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, bpf@vger.kernel.org Reply-To: Alexander Lobakin Subject: Re: [PATCH v2 net-next 0/6] skbuff: micro-optimize flow dissection Message-ID: <20210313132956.647745-1-alobakin@pm.me> In-Reply-To: <20210313113645.5949-1-alobakin@pm.me> References: <20210313113645.5949-1-alobakin@pm.me> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-1.2 required=10.0 tests=ALL_TRUSTED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF shortcircuit=no autolearn=disabled version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on mailout.protonmail.ch Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Alexander Lobakin Date: Sat, 13 Mar 2021 11:37:03 +0000 > This little number makes all of the flow dissection functions take > raw input data pointer as const (1-5) and shuffles the branches in > __skb_header_pointer() according to their hit probability. > > The result is +20 Mbps per flow/core with one Flow Dissector pass > per packet. This affects RPS (with software hashing), drivers that > use eth_get_headlen() on their Rx path and so on. > > Since v1 [0]: > - rebase on top of the latest net-next. This was super-weird, but > I double-checked that the series applies with no conflicts, and > then on Patchwork it didn't; Still failing on Patchwork. I rebased it ten thousand times, rebuilt the patches manually, tried previous stable Git version and the latest CVS snapshot, and always got the same series that successfully applies to next-next. Can you please take a look? > - no other changes. > > [0] https://lore.kernel.org/netdev/20210312194538.337504-1-alobakin@pm.me > > Alexander Lobakin (6): > flow_dissector: constify bpf_flow_dissector's data pointers > skbuff: make __skb_header_pointer()'s data argument const > flow_dissector: constify raw input @data argument > linux/etherdevice.h: misc trailing whitespace cleanup > ethernet: constify eth_get_headlen()'s @data argument > skbuff: micro-optimize {,__}skb_header_pointer() > > include/linux/etherdevice.h | 4 ++-- > include/linux/skbuff.h | 26 +++++++++++------------ > include/net/flow_dissector.h | 6 +++--- > net/core/flow_dissector.c | 41 +++++++++++++++++++----------------- > net/ethernet/eth.c | 2 +- > 5 files changed, 40 insertions(+), 39 deletions(-) > > -- > 2.30.2 Thanks, Al