Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp1387521pxf; Fri, 12 Mar 2021 08:23:39 -0800 (PST) X-Google-Smtp-Source: ABdhPJyrg2D5Q4rzUK6FRx/L/31kLan46xWtYbqaCNjnyD5XNu8YmLMjWUnlcJSXJzEpOj+MJegu X-Received: by 2002:a17:906:1e50:: with SMTP id i16mr9406557ejj.466.1615566219180; Fri, 12 Mar 2021 08:23:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1615566219; cv=none; d=google.com; s=arc-20160816; b=XdtuVtEqM62PQdp/ClggS0X3D3rXm+BphzJ8I2CztuetZi/porVdWLs6Eq7gCi0Bew NwR9BIx15t+l4mjwMQLJZZn1iwrcGTZzHQOdEp0TNPyhk0gmMUevqopg+TtCd0oikm49 kYifXmsS86CJFexQuZjd7uWhOqSkTVvjzTNyGucLji6JzuaCnQjno8/So67358fG5fmv TTdC0cNlpCPY/Qpil/v3X/T9Hp3c4nV7bR0PkYAt+qLpr6FDbHZQuJ4qiiZDU0FZF6Ul klLPaxUY73ywFixYMkoDLQLAAGvBXz99iScppljpsYVph82/ztUpJF9d8t8WX376Mvdu 88Gg== 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=EPyxtkpOV0rtQrrZHCg1xpqZt46LZWrmCOQTPzRuzYA=; b=LDMohVhRuLFxAd6yXcBnW7f5XB5X7P66B8+uG5HbwtG5fKl5ULJ8CKhdgg9oZiRODU srC4vtISyS9TWTiCsYx16JWlYLcuF7/SnnVwFVwGB93+x7yX2465Slcr8HsFW5KzKxa7 Ew15PDxnSBQke7vbhrZ1//VKmsUtt2TxerEEI7CJmfyDa8nElpfORWubmwdfOsko8vcw JHKuaeKHilr8SSib2O8ZR+r5SGs7XmxGqNeOR1SbRr84cwbR5TX1rji0yhhiEcttBtyu Xq6Yi5DI+qWtpXhcKsM8GwO93MTnT7cHcO9kU2ASVe/0LT+IAZumM3o7cPcb6CmfSHok a6bA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@pm.me header.s=protonmail header.b=EKHGhAMk; 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 h1si4590743ejf.242.2021.03.12.08.23.16; Fri, 12 Mar 2021 08:23:39 -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=EKHGhAMk; 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 S232348AbhCLQWT (ORCPT + 99 others); Fri, 12 Mar 2021 11:22:19 -0500 Received: from mail-40133.protonmail.ch ([185.70.40.133]:58374 "EHLO mail-40133.protonmail.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231894AbhCLQWB (ORCPT ); Fri, 12 Mar 2021 11:22:01 -0500 Date: Fri, 12 Mar 2021 16:21:49 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pm.me; s=protonmail; t=1615566120; bh=EPyxtkpOV0rtQrrZHCg1xpqZt46LZWrmCOQTPzRuzYA=; h=Date:To:From:Cc:Reply-To:Subject:From; b=EKHGhAMkK4ER+10mdzNmG6VdJIIEzgJEKBv6kMYaC6tcb0/6RjLBl1IcRC1y0OZRr un88+YNB3sIM7aoVUJ1w3i3Y7VK8vMhpFfPpT7U89H7gnjxTUXiuJdGhQhpAZ00NlY eD+rLcQ3KA9XPa3O443qF+ocURhPhhJAFvr19BAB1M2C6vxXN11D5n8KrRAfzH7gxZ 0plt2RWiKDyOGVZyJapPNOGd6V/o4UpWTp+RIw3FkXtPTS8NlDkPMrI98jAdSt1+uX y1EvbNpSVI62awMGnNWOM9vOh1mTVvec9/eVaO75eHukN6AMoVooo2f3xxSjy72DXo M/4SLt0KAn6Yg== 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 net-next 0/4] gro: micro-optimize dev_gro_receive() Message-ID: <20210312162127.239795-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 paths used in the main GRO entry point. The main body is patches 3-4 which simplify the code and improve flow distribution. Two others are mostly cosmetic to make code more readable. The benetifs are not so huge and mostly depend on NIC RSS hash function and a number of Rx flows per single NAPI instance. I got something like +10-15 Mbps on 4-8 flows NATing. Alexander Lobakin (4): gro: give 'hash' variable in dev_gro_receive() a less confusing name gro: don't dereference napi->gro_hash[x] multiple times in dev_gro_receive() gro: simplify gro_list_prepare() gro: improve flow distribution across GRO buckets in dev_gro_receive() net/core/dev.c | 31 ++++++++++++++----------------- 1 file changed, 14 insertions(+), 17 deletions(-) -- 2.30.2