lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Sat, 31 Oct 2020 11:21:07 -0400
From:   Willem de Bruijn <willemdebruijn.kernel@...il.com>
To:     Alexander Lobakin <alobakin@...me>
Cc:     Willem de Bruijn <willemdebruijn.kernel@...il.com>,
        "David S. Miller" <davem@...emloft.net>,
        Jakub Kicinski <kuba@...nel.org>,
        Steffen Klassert <steffen.klassert@...unet.com>,
        Antoine Tenart <atenart@...nel.org>,
        Mauro Carvalho Chehab <mchehab+huawei@...nel.org>,
        Miaohe Lin <linmiaohe@...wei.com>,
        Network Development <netdev@...r.kernel.org>,
        linux-kernel <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH net-next] net: avoid unneeded UDP L4 and fraglist GSO resegmentation

On Sat, Oct 31, 2020 at 6:31 AM Alexander Lobakin <alobakin@...me> wrote:
>
> On Saturday, 31 October 2020, 2:12, Willem de Bruijn <willemdebruijn.kernel@...il.com> wrote:
>
> Hi Willem,
>
> > On Fri, Oct 30, 2020 at 2:33 PM Alexander Lobakin alobakin@...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@...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.

Powered by blists - more mailing lists