Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp2496121pxb; Mon, 18 Jan 2021 21:11:37 -0800 (PST) X-Google-Smtp-Source: ABdhPJzRIBU81BKzVYE3gRczzh17GXbhCKa1QBjMoIA8t0aOdO1YitE7w28DeM5r35zn4XXC0JDz X-Received: by 2002:a17:906:1d5a:: with SMTP id o26mr1885063ejh.301.1611033097284; Mon, 18 Jan 2021 21:11:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611033097; cv=none; d=google.com; s=arc-20160816; b=s0KV5jHawZS9QN3y0m+L+EvdK245rtaH2fVDhvAXVkwJrJW6RUeBJ19hpmWlLPacWq 1HykouZ3G5TLHTQOpHy7xh2MR0pT10XUGWS3XdU7kheFaZBb0gTSYKEUJstvyinLqXL9 4N30kWiikRuBRZK+jYXnyUjvRfnsm3Twcf7ZxK+cwxOIs+EARrFsFO8gpVr0NMSVbOzq uAXwcJdw085lYw4zfrZ8ph5aVGzGMyZ5a11Yvyz2dhD2KNq6fKEYWBpSYRJ8izXZBLGr nsdOBA38GRXEwo6qfuirGV939FacLuo6p9KVd6WCjfrjpEJNXZQBO++7X1oHvoWozfiY fTOQ== 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=z2BgOHJQihEnZJluF+2PjwdFI80xZFFK5NdPVZjc2KU=; b=mcWkzbtCVls0vrMD2TfPPMu7wvQKK5pIQhZ3QEpm4pe/NkzhghZ+4Q5fbuuHGW0U3H Qn+E6vZYv64Rdlat45v2BE+C3OOVpt1lXtYjhOrxKJfhClenFLZnzr/aAmJyTEMbMg0p mbByz7SKlYLz+rd4sN6Mjl9NV9jjVmMpmyBstjvtAG31iN3FJUMkVvuJxreJKgh9+Eg8 M1OoaP0SvDzy+90Hf9caVxJph8Ymk7xfPAp1Ez2sZF3NjvlNlW/Pg/ELZP4PfWWLlpdJ N/I3nJkmw5PKOFG80oeIfRTY/hrIvNoXBq6Qw4f5ZmFwk0Jw9YRnra24dboW/IDizsQa Rdww== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@pm.me header.s=protonmail header.b=RtXGISrj; 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 a18si7538772ejf.618.2021.01.18.21.11.14; Mon, 18 Jan 2021 21:11:37 -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=RtXGISrj; 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 S2394099AbhARTmW (ORCPT + 99 others); Mon, 18 Jan 2021 14:42:22 -0500 Received: from mail1.protonmail.ch ([185.70.40.18]:49746 "EHLO mail1.protonmail.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2437340AbhARTdr (ORCPT ); Mon, 18 Jan 2021 14:33:47 -0500 Date: Mon, 18 Jan 2021 19:32:51 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pm.me; s=protonmail; t=1610998379; bh=z2BgOHJQihEnZJluF+2PjwdFI80xZFFK5NdPVZjc2KU=; h=Date:To:From:Cc:Reply-To:Subject:In-Reply-To:References:From; b=RtXGISrjXU7lTSaAaDTkKXl/3TbgsmZk3CMUU+Y/Lv4b/vdC9DIOMcC9GiK0tMUVR pclzQoZkmqRAczGjRuTKEgbg+L8HMcSBxS41Uyb3qbDsSVlc29Xk7pzunDBx0IbjW/ Uun5Ri1kLZrGZOpHWwnnQcvlWhuEcAloXEgWWNvrB3YSLUIwiDwzCFXPjUPsD0Lxjs rtcZo1z+m+nIqfk5925u7dVy/1I1GYmWEgsCy2IBThOg7WlV5J4UF+3RwNsAUCUEQ6 mmdjqD3D8B+JQgvdZl3vPSvVY4Vb+VLPDsqcaPhCRHDJgpu/wW1GXg7MR7/gf/LCNO d5FYEWbBU8/Cg== To: "David S. Miller" , Jakub Kicinski From: Alexander Lobakin Cc: Hideaki YOSHIFUJI , Willem de Bruijn , Steffen Klassert , Alexander Duyck , Paolo Abeni , Alexander Lobakin , Igor Russkikh , Mauro Carvalho Chehab , Miaohe Lin , Antoine Tenart , Michal Kubecek , Andrew Lunn , Meir Lichtinger , Aya Levin , Florian Fainelli , linux-kernel@vger.kernel.org, netdev@vger.kernel.org Reply-To: Alexander Lobakin Subject: [PATCH net-next 1/2] net: introduce UDP GRO netdev feature Message-ID: <20210118193232.87583-1-alobakin@pm.me> In-Reply-To: <20210118193122.87271-1-alobakin@pm.me> References: <20210118193122.87271-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 Introduce a new netdev_feature, NETIF_F_GRO_UDP, to allow user to turn UDP GRO on and off when there is no socket, e.g. when forwarding. Defaults to off to not change current datapath. Suggested-by: Paolo Abeni Signed-off-by: Alexander Lobakin --- include/linux/netdev_features.h | 4 +++- net/ethtool/common.c | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/include/linux/netdev_features.h b/include/linux/netdev_feature= s.h index 934de56644e7..c6526aa13684 100644 --- a/include/linux/netdev_features.h +++ b/include/linux/netdev_features.h @@ -84,6 +84,7 @@ enum { =09NETIF_F_GRO_FRAGLIST_BIT,=09/* Fraglist GRO */ =20 =09NETIF_F_HW_MACSEC_BIT,=09=09/* Offload MACsec operations */ +=09NETIF_F_GRO_UDP_BIT,=09=09/* Enable UDP GRO */ =20 =09/* =09 * Add your fresh new feature above and remember to update @@ -157,6 +158,7 @@ enum { #define NETIF_F_GRO_FRAGLIST=09__NETIF_F(GRO_FRAGLIST) #define NETIF_F_GSO_FRAGLIST=09__NETIF_F(GSO_FRAGLIST) #define NETIF_F_HW_MACSEC=09__NETIF_F(HW_MACSEC) +#define NETIF_F_GRO_UDP=09=09__NETIF_F(GRO_UDP) =20 /* Finds the next feature with the highest number of the range of start ti= ll 0. */ @@ -234,7 +236,7 @@ static inline int find_next_netdev_feature(u64 feature,= unsigned long start) #define NETIF_F_SOFT_FEATURES=09(NETIF_F_GSO | NETIF_F_GRO) =20 /* Changeable features with no special hardware requirements that defaults= to off. */ -#define NETIF_F_SOFT_FEATURES_OFF=09NETIF_F_GRO_FRAGLIST +#define NETIF_F_SOFT_FEATURES_OFF=09(NETIF_F_GRO_FRAGLIST | NETIF_F_GRO_UD= P) =20 #define NETIF_F_VLAN_FEATURES=09(NETIF_F_HW_VLAN_CTAG_FILTER | \ =09=09=09=09 NETIF_F_HW_VLAN_CTAG_RX | \ diff --git a/net/ethtool/common.c b/net/ethtool/common.c index 24036e3055a1..e45128882372 100644 --- a/net/ethtool/common.c +++ b/net/ethtool/common.c @@ -68,6 +68,7 @@ const char netdev_features_strings[NETDEV_FEATURE_COUNT][= ETH_GSTRING_LEN] =3D { =09[NETIF_F_HW_TLS_RX_BIT] =3D=09 "tls-hw-rx-offload", =09[NETIF_F_GRO_FRAGLIST_BIT] =3D=09 "rx-gro-list", =09[NETIF_F_HW_MACSEC_BIT] =3D=09 "macsec-hw-offload", +=09[NETIF_F_GRO_UDP_BIT] =3D=09=09 "rx-gro-udp", }; =20 const char --=20 2.30.0