From patchwork Sat Mar 13 20:29:56 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Lobakin X-Patchwork-Id: 12137085 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id BD726C433E0 for ; Sat, 13 Mar 2021 20:30:53 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 7FE0864DF3 for ; Sat, 13 Mar 2021 20:30:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234579AbhCMUaW (ORCPT ); Sat, 13 Mar 2021 15:30:22 -0500 Received: from mail-40133.protonmail.ch ([185.70.40.133]:26503 "EHLO mail-40133.protonmail.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234385AbhCMUaC (ORCPT ); Sat, 13 Mar 2021 15:30:02 -0500 Date: Sat, 13 Mar 2021 20:29:56 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pm.me; s=protonmail; t=1615667400; bh=sKq9mciRke6VPBD51VxE705FzzXLemerqlyrFNFi8+0=; h=Date:To:From:Cc:Reply-To:Subject:From; b=av+jDWvOqaJCjjUYzBzBNrDI7ecLUylCDLntF2aXK3wFYMTIOfaubIVR3f8AeCd3h wnn6LPoAmHxlnM4T9OE3atPF1gnkA6R09cr7WjEqIRbQ7QPSNaUo0BsmUjowpMxpNM d/6g6Dct7fI74auqcGnLyyZHt6ZymZTe6oiwZr4CjVimv+6ypMkrIz8PwLZ+hspS7N qHjVM5OS1RFKVmUdwaERb6bA2f925j0WfdFIFRQQtKv7bj4JkKzsbDEqzc+OMcEWcM sUyg3YX7vSlrFftbKHBb6mh9ZpblwNsosPEEvAXvoVhPknpaCNQDwrvn1y7ZSO9URq I6t1d0/+z7neg== To: "David S. Miller" , Jakub Kicinski From: Alexander Lobakin Cc: Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko , Alexander Lobakin , Eric Dumazet , Wei Wang , Cong Wang , Taehee Yoo , netdev@vger.kernel.org, linux-kernel@vger.kernel.org Reply-To: Alexander Lobakin Subject: [PATCH v2 net-next 0/3] gro: micro-optimize dev_gro_receive() Message-ID: <20210313202946.59729-1-alobakin@pm.me> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org This random series addresses some of suboptimal constructions used in the main GRO entry point. The main body is gro_list_prepare() simplification and pointer usage optimization in dev_gro_receive() itself. Being mostly cosmetic, it gives like +10 Mbps on my setup to both TCP and UDP (both single- and multi-flow). Since v1 [0]: - drop the replacement of bucket index calculation with reciprocal_scale() since it makes absolutely no sense (Eric); - improve stack usage in dev_gro_receive() (Eric); - reverse the order of patches to avoid changes superseding. [0] https://lore.kernel.org/netdev/20210312162127.239795-1-alobakin@pm.me Alexander Lobakin (3): gro: simplify gro_list_prepare() gro: consistentify napi->gro_hash[x] access in dev_gro_receive() gro: give 'hash' variable in dev_gro_receive() a less confusing name net/core/dev.c | 40 ++++++++++++++++++---------------------- 1 file changed, 18 insertions(+), 22 deletions(-) Reviewed-by: Eric Dumazet --- 2.30.2