Received: by 2002:a05:6a10:9e8c:0:0:0:0 with SMTP id y12csp2110276pxx; Sat, 31 Oct 2020 08:24:42 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyQewm4Zz8bmHbHm01I5nVqAp3c6X/YAtJM6d59GRHhXtV0Z94PhwPGWMxMiY4H/eQKbK00 X-Received: by 2002:a05:6402:503:: with SMTP id m3mr8341390edv.368.1604157882491; Sat, 31 Oct 2020 08:24:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1604157882; cv=none; d=google.com; s=arc-20160816; b=o8JN1+Qw+PLv2f/XaK3F3v4Q7i6QJijXJqpHrwdY7cL+0P8TpW90YZL9NSbRStB1wV 72T++Q+pnrnPBwNlruK4EssogkmirgobMwQbCj2GjF5+Tjck1C1bVLKbY4Stcv7oapPZ tgKzzj/cRaGOj+zGvb4ep/i12FS/lvLETJFNAB+BIvc2U7a67zCWhh+PbgDsLDMoj4/1 XbnZv8SF710N9bRTQG/qrgU7udv1O7GMGvMiCfuicvUGYc5Qdl5YUD1oJm9bEJuyUdem xJmvfmWp+JzcgLfhpDrKCEaO0wjvgVKHCDjYaGaAd4leanWb1hGv1fYpB1Bbo2moulTl tJoA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=4W4oQhRIlWZIFSlIURKMXHUi44ZUwx3dAHZVQ86rrfE=; b=a0/RuZLMG/5srU1rTmySHSu/eiaDqRzpYlGstJ/y1ebW7gLkuhBaa/MgLD6aDluBRS EHfxQCb6DKdhgf2XQsOwQa/KKTR9Itnt3cxo8zon4Tb+e+jd4mPP48a0gOw5N9ckQDXE e1OJHARh5gjy8F7+EfeHIIDtaLqioGLzbqnk6rCHGYcN0IQE+cv48oegt3LbibMoYvNK f16BYpK3MqI/PHxTSIl5sJru4GR5Fi/gCCeMA2MPdMd0pXI8FigLo4oakO8uHtszNaBF pbOUHBnwUgHG+MKv8IzUO1Kjt9NRlgpN1pltWsgrkHeNfjdHUUkRCOoDUAzOTlRuGzMT zX1w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=L0uh1LvK; 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=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id z7si7103553edm.477.2020.10.31.08.24.19; Sat, 31 Oct 2020 08:24:42 -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=@gmail.com header.s=20161025 header.b=L0uh1LvK; 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=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727950AbgJaPVu (ORCPT + 99 others); Sat, 31 Oct 2020 11:21:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39226 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726089AbgJaPVs (ORCPT ); Sat, 31 Oct 2020 11:21:48 -0400 Received: from mail-vs1-xe42.google.com (mail-vs1-xe42.google.com [IPv6:2607:f8b0:4864:20::e42]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 99B5AC0617A6 for ; Sat, 31 Oct 2020 08:21:48 -0700 (PDT) Received: by mail-vs1-xe42.google.com with SMTP id h5so5069324vsp.3 for ; Sat, 31 Oct 2020 08:21:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=4W4oQhRIlWZIFSlIURKMXHUi44ZUwx3dAHZVQ86rrfE=; b=L0uh1LvKqpLiL52HsiQ4lrCXnVGadBFd37Z9PviB2uYHLh6T9pd1YCQHXYdA2HW7AY zrgLNSZhz3bt1n4ms0ICegXY9ZS87q13TGF+2g8o6a6rKUmgjSP/N9HEDmfNzHT5LIzr Dm+3mE61wzy6exwgy7FqslSoTTGqbLzu2AF1h+iOR+1/7bV+b74zwlqxE3W0Bnt+ukya 049s59nMC0BZYnGv7L8loaVBXMYbcFKvzsr56Ha2hYD4yteWhW8MjAcgfY9mZFd9oGNA 0PdWcELY2X4VCr4xUxBvsaXrR3by7Pu5oRAjR+yPBCOerXgJ4v9xJQqqnQZFmjWWo3Jr bWyA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=4W4oQhRIlWZIFSlIURKMXHUi44ZUwx3dAHZVQ86rrfE=; b=OnKUC3vXxYcV49yg1DnwCQCt+oARcLKTYd69QGTLXa8tyU0JAKLpgPiSfDHlsZwRE4 hRVtWOf14nZYeYG1VoEYer0kdBwTj7vou7w752vJVp7ZLYDxJueT7udunst2LNmCGhql lKZ/mvl/r0w9EZ0xsZ/Mm54M8/c3YfgTwIFpx8ilNc+FL7+JmFGYq3k8DwQNvEdFvmqz Bk/FYp2VDtAFHDy2uFZTkxcef9gN/UnWZn8HoF7mfLGipUgiByjavDgSZKNiAiXwtr2k vHh2Ho7gxdMj4vzm569s6CQLYcRULx7axnkmpxA75Jk/cUMjVUMGcIG2PKNyHHzSZBKp iktg== X-Gm-Message-State: AOAM5314NlP04fvZVcg1RXOIi+Ag+MWmdyweaY7cW3hwIWwvDCWsaiCs eMJj+h8qgtU73jiod8ma1bjDBLe82rs= X-Received: by 2002:a67:fd83:: with SMTP id k3mr4583339vsq.34.1604157706514; Sat, 31 Oct 2020 08:21:46 -0700 (PDT) Received: from mail-vk1-f171.google.com (mail-vk1-f171.google.com. [209.85.221.171]) by smtp.gmail.com with ESMTPSA id e10sm1137958uar.19.2020.10.31.08.21.45 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 31 Oct 2020 08:21:45 -0700 (PDT) Received: by mail-vk1-f171.google.com with SMTP id y10so2086748vkl.5 for ; Sat, 31 Oct 2020 08:21:45 -0700 (PDT) X-Received: by 2002:a1f:c149:: with SMTP id r70mr10043246vkf.1.1604157704723; Sat, 31 Oct 2020 08:21:44 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Willem de Bruijn Date: Sat, 31 Oct 2020 11:21:07 -0400 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH net-next] net: avoid unneeded UDP L4 and fraglist GSO resegmentation To: Alexander Lobakin Cc: Willem de Bruijn , "David S. Miller" , Jakub Kicinski , Steffen Klassert , Antoine Tenart , Mauro Carvalho Chehab , Miaohe Lin , Network Development , linux-kernel Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Oct 31, 2020 at 6:31 AM Alexander Lobakin wrote: > > On Saturday, 31 October 2020, 2:12, Willem de Bruijn wrote: > > Hi Willem, > > > On Fri, Oct 30, 2020 at 2:33 PM Alexander Lobakin alobakin@pm.me wrote: > > > > > 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 alobakin@pm.me > > > > > > ------------------------------------------------ > > > > > > 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) > > > > > > > > > > What exactly do you mean by resegmenting? > > I mean pts 5-6 from the full path: > 1. Our NIC driver advertises a support for fraglists, GSO UDP L4, GSO fraglists. I see. This was the part I missed. The commit message mentions that no mainline driver advertises h/w offload support. I had missed that there may be non-mainline drivers that do ;) Yes, then the use case is perfectly clear. Great to see these features getting offload support.