Received: by 2002:a05:6a10:2785:0:0:0:0 with SMTP id ia5csp59688pxb; Tue, 12 Jan 2021 20:04:59 -0800 (PST) X-Google-Smtp-Source: ABdhPJwbAYHBTnYsVsawOssJuxTsZDnzGPn2IRWR9NIazJWIVqYaH9zcXN5eN99No1vmNZJXFXRz X-Received: by 2002:a05:6402:1516:: with SMTP id f22mr224907edw.382.1610510699668; Tue, 12 Jan 2021 20:04:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1610510699; cv=none; d=google.com; s=arc-20160816; b=ISZYyOBGkQWEs69A4Oekl6d5uL9zbvhrTmZUtzaQrP4lxz7rnbGxiu0GgGE9cpfxnE 49fvYexNa2EpoE4x1wyhleWF5DXb4IUo0hg3g71/pXdNBsRj25qHJAWG+k5jAWi8Fw46 4AAx7UxY4NoKvX9UatdyRMamJV8n/094denvYz+8QsAZD9W4vjIbEQy9FL3t8x02axRz BNIHjst3Scs5OrD+SNtS/qDjphQAuqgBoNHeXitcVESmS61BRSer2HZcPhwF3DBbsXqY wLet89TpEcjV2xmF4BfVlkjOmxak5wdmhpg03fOmP/Fs9fEgZC9Fn+mbh1079mRRB6q2 7QRA== 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=u3+4dtI12OmkQzaD7GjfxNXM1iUxv1TVQoI7JU869+E=; b=hbnu+9qkIe/VSNqRSHsg3w81pPAii8Lsp6e2Peb7oNFnD9Wf4FzpewDsWSAUjkqd2f 3htJBJyDg9V+S6/P8I7Gg6XCGAoaranrBAaf5XRBo1VcrvXDNHJlSjN1IP0YG3KP5iol d/0G+eif6D2Ylp+M5NkMUEnqtHJEgQoKm8OUDcjZtDzbz1Sx6dMvTe+2CvKCDxCr8uJX 6EMN+AY10xrlUIIZOEVCi3KyxLweCdYXWW83gJlwFa2pawCnk7X51heRLJXUToonENUs 7GrDt1PQXSUoi0kxXU6XKzIqziqHNtd0j3o0AfT+p14HcJ0KERfK7BNU7MJ680HXO+gF yESA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@pm.me header.s=protonmail header.b=AU3JUpGU; 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 s5si388476eji.671.2021.01.12.20.04.36; Tue, 12 Jan 2021 20:04:59 -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=AU3JUpGU; 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 S2393285AbhALVf5 (ORCPT + 99 others); Tue, 12 Jan 2021 16:35:57 -0500 Received: from mail-40133.protonmail.ch ([185.70.40.133]:58653 "EHLO mail-40133.protonmail.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2437137AbhALVRK (ORCPT ); Tue, 12 Jan 2021 16:17:10 -0500 Date: Tue, 12 Jan 2021 21:16:17 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pm.me; s=protonmail; t=1610486185; bh=u3+4dtI12OmkQzaD7GjfxNXM1iUxv1TVQoI7JU869+E=; h=Date:To:From:Cc:Reply-To:Subject:From; b=AU3JUpGUyjwX/rK4G8Gl0j95eog5GBxUw8OsqyF60R0HDEAf/Eczl2QEWG2ymKaYE 8/wFdVe7AsEADbDH+jA5CTk2rzsERtj7ZDwMVwV+zCYZn37sNOE5dcVa+Yd+kmA7kc 56Kb3GIlJiPPPOAEtkzm+idAeZQTQ6HrxngOzogKFnzNrgX3ds3D+Mqc2RoCunJIEv r1RRwmJSNdlfa7WGxpPhCR9IWWqZ5FznmMmYZxVP+vM6fnClGEeEx1UAElPCk+IHf6 cCkEn7Ria8I/p3+bkcSidM3qN5zQ2AAS6XDpNI5BZssUd65/JfSQTo7yEBYj7SFObm +QRk+z8TPtpwQ== To: "David S. Miller" , Jakub Kicinski From: Alexander Lobakin Cc: Eric Dumazet , Edward Cree , Willem de Bruijn , Steffen Klassert , Alexey Kuznetsov , Hideaki YOSHIFUJI , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Alexander Lobakin Reply-To: Alexander Lobakin Subject: [PATCH net-next] udp: allow forwarding of plain (non-fraglisted) UDP GRO packets Message-ID: <20210112211536.261172-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 Commit 9fd1ff5d2ac7 ("udp: Support UDP fraglist GRO/GSO.") actually not only added a support for fraglisted UDP GRO, but also tweaked some logics the way that non-fraglisted UDP GRO started to work for forwarding too. Tests showed that currently forwarding and NATing of plain UDP GRO packets are performed fully correctly, regardless if the target netdevice has a support for hardware/driver GSO UDP L4 or not. Add the last element and allow to form plain UDP GRO packets if there is no socket -> we are on forwarding path. Plain UDP GRO forwarding even shows better performance than fraglisted UDP GRO in some cases due to not wasting one skbuff_head per every segment. Signed-off-by: Alexander Lobakin --- net/ipv4/udp_offload.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/net/ipv4/udp_offload.c b/net/ipv4/udp_offload.c index ff39e94781bf..9d71df3d52ce 100644 --- a/net/ipv4/udp_offload.c +++ b/net/ipv4/udp_offload.c @@ -460,12 +460,13 @@ struct sk_buff *udp_gro_receive(struct list_head *hea= d, struct sk_buff *skb, =09if (skb->dev->features & NETIF_F_GRO_FRAGLIST) =09=09NAPI_GRO_CB(skb)->is_flist =3D sk ? !udp_sk(sk)->gro_enabled: 1; =20 -=09if ((sk && udp_sk(sk)->gro_enabled) || NAPI_GRO_CB(skb)->is_flist) { +=09if (!sk || (sk && udp_sk(sk)->gro_enabled) || +=09 NAPI_GRO_CB(skb)->is_flist) { =09=09pp =3D call_gro_receive(udp_gro_receive_segment, head, skb); =09=09return pp; =09} =20 -=09if (!sk || NAPI_GRO_CB(skb)->encap_mark || +=09if (NAPI_GRO_CB(skb)->encap_mark || =09 (skb->ip_summed !=3D CHECKSUM_PARTIAL && =09 NAPI_GRO_CB(skb)->csum_cnt =3D=3D 0 && =09 !NAPI_GRO_CB(skb)->csum_valid) || --=20 2.30.0