Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp2235571pxf; Sat, 13 Mar 2021 12:32:07 -0800 (PST) X-Google-Smtp-Source: ABdhPJzL93bWAnYk+qr5PcTkO1rE/MfSjWH11SukQuovlBZr2TVAVIyRHFWlj2rMG+LPU0lM59u9 X-Received: by 2002:a05:6402:35c9:: with SMTP id z9mr21573865edc.94.1615667527191; Sat, 13 Mar 2021 12:32:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1615667527; cv=none; d=google.com; s=arc-20160816; b=dUNgtPvNBI2W20INvlLvRq3W2gF4O3yLjkHgFgn7gR9Ohagpv2JYqdB9KFUENleawA byOu6hzwZOfgkwINZs1dvXMBRNZCa4H9xa3mHy6zPBaf+mS+9UYwDPTTw4MdIdbcBIVg PMUWN8Of0cb4b9x3wohOAsVCJgRu+CVf+Lij/a2DHvzMjL6Dfg8WU6PF0izpYR02Qnzu UlOg/G6hp6aN7XWbCugkz5OlpO43/U1zVOc8AFspXzjXgzYbaxLy8RV4icP6YN32BVMe nncdTB1nqcM770lQQDsDXyXCJIhHv+RHGPIZ6hfCnWRl7UXN8xR0+GvIwYEsH+0WKkJ3 D9kg== 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 :message-id:subject:reply-to:cc:from:to:dkim-signature:date; bh=sKq9mciRke6VPBD51VxE705FzzXLemerqlyrFNFi8+0=; b=K9BoHjapHaHgBEY0nmtE2AKxh0zFcSEDmDfsuh0EnrQq6IfWcjh9FhVTvNftdfGtbA 4gvLiNaT7dJcjRiP02wWbBzsrQjiMzaZv4M2rdczSOvPmi4hQzTEWJjPf8MV53hHVV+k dCBS3RYuuNAD5KXtG0HakHmqGbubGdOmqqQdCavUdZZLpTXTGLzBvfVCp85KRL+EDFHc L1cGthWEJCkqsS2VJQVnD0BPg+mue1d4Su6ntyCzIWcKoC8SGbwZSPK5UZwXVTq33re2 gw7+ZbbqXU9sBaQyZ5uXaM9yaZJpFODAIl3lSR9moyp22Zx8x1uVaEz4YFIRqiDfJghz drZw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@pm.me header.s=protonmail header.b=av+jDWvO; 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 gx26si2232474ejb.246.2021.03.13.12.31.43; Sat, 13 Mar 2021 12:32:07 -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=av+jDWvO; 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 S234555AbhCMUaV (ORCPT + 99 others); Sat, 13 Mar 2021 15:30:21 -0500 Received: from mail-40134.protonmail.ch ([185.70.40.134]:61042 "EHLO mail-40134.protonmail.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233635AbhCMUaC (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 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 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(-) -- 2.30.2