Received: by 2002:a05:6a10:9e8c:0:0:0:0 with SMTP id y12csp1506791pxx; Fri, 30 Oct 2020 11:35:22 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx0JQ5KLhHn98d0ZjlHcfwgJMtv0gEUGnfFsQEDAJk6/1M7LZ5xShdUVp5Wo8Gv+qfgCbif X-Received: by 2002:a17:906:1e08:: with SMTP id g8mr3854681ejj.358.1604082921990; Fri, 30 Oct 2020 11:35:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1604082921; cv=none; d=google.com; s=arc-20160816; b=qd5haPFHfL0H8zEEVM/N6wNPxEvP0DiNCbNsgTCdXGPaCtVGrnBch04el9zIFwfDiN zcgaudWfU/CRa4E4fke888zzlcFO00C0cwgaBXhew4oEbJ6+m9W5XaT7A2Uy0F2GikQ1 5q0oWIfcS4HNukgnbfvL+50L73wKnjDP+gXZ6iIySAygjtVFUlQRtCW4xYi6KQVOjPDp lpoaGJZ7p/rwOPTl6Pigp0LDat+cMxlTVY66eYWOVV/6JgiEtzHjqjgpinEDriYwq9Op EgKEp8wkS3CA6dGFcF0GVvrXNTJelxPFVMss9YpvKTo17SmOaP0pbbccOOvt440DGARm eGkA== 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=LjCHrOdRA03o4xKg/F5+6+BqJIK8l1PZ5A6ied/We24=; b=C8hYeZt4h8arImwTKktaqQ4NQOsYQmXLmKvyHXNdtF00U9if29AMRsGXBv2Y4JAvMd jo2ChuDURpI8ITM8heVGhqL84CZDLO2/DOsjAolV7cwUZ3qQLinkjLAJh0Qd4BM4jfmi QVHXbeR9UETxK6Vpzdhs6IS5TXzuXMApdkE/gJ18+5PQy5ObYlSAxynMsxgEIlzlDSgp Ckv7bkKFXrjpDcUDon14FUSeJlD8dVLP0h24KDuHPDzNDDYlVrmmmcZDcwx7Ehfr4EPD fDnlyKdV46lrkIDSb3M0f1XnQnlyBDlwDh+go7jVuYDh+6EhL2KhJafxoeHr2sNsCaRc 3+wA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@pm.me header.s=protonmail header.b=iInLccsS; 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 qk3si6096000ejb.207.2020.10.30.11.34.59; Fri, 30 Oct 2020 11:35:21 -0700 (PDT) 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=iInLccsS; 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 S1727244AbgJ3SdR (ORCPT + 99 others); Fri, 30 Oct 2020 14:33:17 -0400 Received: from mail-03.mail-europe.com ([91.134.188.129]:45878 "EHLO mail-03.mail-europe.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727050AbgJ3SdQ (ORCPT ); Fri, 30 Oct 2020 14:33:16 -0400 Date: Fri, 30 Oct 2020 18:33:00 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pm.me; s=protonmail; t=1604082792; bh=LjCHrOdRA03o4xKg/F5+6+BqJIK8l1PZ5A6ied/We24=; h=Date:To:From:Cc:Reply-To:Subject:From; b=iInLccsSAHm9G0x94dqzQtSsPkfshjwiQnHvoKMjJqaLGyQU0SEfK4pGsMXLBDvgJ Wpns45I6YCiHVI3UA8Muhu0z8yk3j0bQecMxXbpibbHHeZzkUfpiQTqntv7lMQ1Xo7 5g3QANmbTiD7kLAqbCkfmY3zmkFz7Yzi82aI0DnilgLePcs3zz7DnpjwGelRJJdrsP iU2T90ICVCjizL2nDimEyTFUIbWNu0ozkOhhKvksdzrv+GHSjQhrLcnNREoFMeHBBt xnbmkOdQhYiLWJZ962jkm58q2PzW/TylWzbY4IPvmtl5DQg1JRreHz7yEIy6s1iAdw V8PFs0VQZwRMw== To: "David S. Miller" , Jakub Kicinski From: Alexander Lobakin Cc: Willem de Bruijn , Steffen Klassert , Alexander Lobakin , Antoine Tenart , Mauro Carvalho Chehab , Miaohe Lin , netdev@vger.kernel.org, linux-kernel@vger.kernel.org Reply-To: Alexander Lobakin Subject: [PATCH net-next] net: avoid unneeded UDP L4 and fraglist GSO resegmentation Message-ID: 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.") added a support for fraglist UDP L4 and fraglist GSO not only for local traffic, but also for forwarding. This works well on simple setups, but when any logical netdev (e.g. VLAN) is present, kernel stack always performs software resegmentation which actually kills the performance. Despite the fact that no mainline drivers currently supports fraglist GSO, this should and can be easily fixed by adding UDP L4 and fraglist GSO to the list of GSO types that can be passed-through the logical interfaces (NETIF_F_GSO_SOFTWARE). After this change, no resegmentation occurs (if a particular driver supports and advertises this), and the performance goes on par with e.g. 1:1 forwarding. The only logical netdevs that seem to be unaffected to this are bridge interfaces, as their code uses full NETIF_F_GSO_MASK. Tested on MIPS32 R2 router board with a WIP NIC driver in VLAN NAT: 20 Mbps baseline, 1 Gbps / link speed with this patch. Signed-off-by: Alexander Lobakin --- include/linux/netdev_features.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/linux/netdev_features.h b/include/linux/netdev_feature= s.h index 0b17c4322b09..934de56644e7 100644 --- a/include/linux/netdev_features.h +++ b/include/linux/netdev_features.h @@ -207,8 +207,8 @@ static inline int find_next_netdev_feature(u64 feature,= unsigned long start) =09=09=09=09 NETIF_F_FSO) =20 /* List of features with software fallbacks. */ -#define NETIF_F_GSO_SOFTWARE=09(NETIF_F_ALL_TSO | \ -=09=09=09=09 NETIF_F_GSO_SCTP) +#define NETIF_F_GSO_SOFTWARE=09(NETIF_F_ALL_TSO | NETIF_F_GSO_SCTP |=09 = \ +=09=09=09=09 NETIF_F_GSO_UDP_L4 | NETIF_F_GSO_FRAGLIST) =20 /* * If one device supports one of these features, then enable them --=20 2.29.2