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:   Fri, 13 May 2022 06:05:36 -0700
From:   Eric Dumazet <edumazet@...gle.com>
To:     Saeed Mahameed <saeedm@...dia.com>
Cc:     Paolo Abeni <pabeni@...hat.com>,
        Eric Dumazet <eric.dumazet@...il.com>,
        "David S . Miller" <davem@...emloft.net>,
        Jakub Kicinski <kuba@...nel.org>,
        netdev <netdev@...r.kernel.org>,
        Alexander Duyck <alexanderduyck@...com>,
        Coco Li <lixiaoyan@...gle.com>,
        Tariq Toukan <tariqt@...dia.com>,
        Leon Romanovsky <leon@...nel.org>
Subject: Re: [PATCH v6 net-next 13/13] mlx5: support BIG TCP packets

On Thu, May 12, 2022 at 10:49 PM Saeed Mahameed <saeedm@...dia.com> wrote:
>
> On 12 May 21:34, Eric Dumazet wrote:
> >On Thu, May 12, 2022 at 9:29 PM Saeed Mahameed <saeedm@...dia.com> wrote:
> >>
> >> On 12 May 11:02, Paolo Abeni wrote:
> >> >On Thu, 2022-05-12 at 01:40 -0700, Saeed Mahameed wrote:
> >> >> On 09 May 20:32, Eric Dumazet wrote:
> >> >> > From: Coco Li <lixiaoyan@...gle.com>
> >> >> >
> >> >> > mlx5 supports LSOv2.
> >> >> >
> >> >> > IPv6 gro/tcp stacks insert a temporary Hop-by-Hop header
> >> >> > with JUMBO TLV for big packets.
> >> >> >
> >> >> > We need to ignore/skip this HBH header when populating TX descriptor.
> >> >> >
> >> >>
> >> >> Sorry i didn't go through all the documentations or previous discussions,
> >> >> please bare with me, so why not clear HBH just before calling the
> >> >> driver xmit ndo ?
> >> >
> >> >I guess this way is more efficient: the driver copies IP hdr and TCP
> >> >hdr directly in the correct/final location into the tx descriptor,
> >> >otherwise the caller would have to memmove L2/L3 just before the driver
> >> >copies them again.
> >> >>
> >>
> >> memmove(sizeof(L2/L3)) is not that bad when done only every 64KB+.
> >> it's going to be hard to repeat this and maintain this across all drivers
> >> only to get this micro optimization that I doubt it will be even measurable.
> >
> >We prefer not changing skb->head, this would break tcpdump.
> >
>
> in that case we can provide a helper to the drivers to call, just before
> they start processing the skb.
>
> >Surely calling skb_cow_head() would incur a cost.
> >
>
> Sure, but the benefit of this patch outweighs this cost by orders of
> magnitude, you pay an extra 0.1$ for a cleaner code, and you still
> get your 64K$ BIG TCP cash.
>
> >As I suggested, we can respin the series without the mlx5 patch, this
> >is totally fine for us, if we can avoid missing 5.19 train.
>
> To be clear, I am not nacking, Tariq already reviewed and gave his blessing,
> and i won't resist this patch on v6. I am Just suggesting an improvement
> to code readability and scalability to other drivers.

The problem is that  skb_cow_head() can fail.

Really we have thought about this already.

A common helper for drivers is mostly unusable, you would have to
pre-allocate a per TX-ring slot to store the headers.
We would end up with adding complexity at queue creation/dismantle.

We could do that later, because some NICs do not inline the headers in
TX descriptor, but instead request
one mapped buffer for the headers part only.

BTW, I know Tariq already reviewed, the issue at hand is about
CONFIG_FORTIFY which is blocking us.

This is why I was considering not submitting mlx5 change until Kees
Cook and others come up with a solution.

Powered by blists - more mailing lists