From patchwork Fri Oct 30 18:33:00 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Lobakin X-Patchwork-Id: 11870535 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D256EC00A89 for ; Fri, 30 Oct 2020 18:33:18 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id B88A120729 for ; Fri, 30 Oct 2020 18:33:17 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=pm.me header.i=@pm.me header.b="iInLccsS" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727234AbgJ3SdQ (ORCPT ); Fri, 30 Oct 2020 14:33:16 -0400 Received: from mail-03.mail-europe.com ([91.134.188.129]:45876 "EHLO mail-03.mail-europe.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727055AbgJ3SdQ (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 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@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_features.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) NETIF_F_FSO) /* List of features with software fallbacks. */ -#define NETIF_F_GSO_SOFTWARE (NETIF_F_ALL_TSO | \ - NETIF_F_GSO_SCTP) +#define NETIF_F_GSO_SOFTWARE (NETIF_F_ALL_TSO | NETIF_F_GSO_SCTP | \ + NETIF_F_GSO_UDP_L4 | NETIF_F_GSO_FRAGLIST) /* * If one device supports one of these features, then enable them