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  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <de811bf3-e2d8-f727-72bc-c8a754a9d929@tessares.net>
Date:   Thu, 2 Feb 2023 10:24:10 +0100
From:   Matthieu Baerts <matthieu.baerts@...sares.net>
To:     Xin Long <lucien.xin@...il.com>,
        network dev <netdev@...r.kernel.org>
Cc:     davem@...emloft.net, kuba@...nel.org,
        Eric Dumazet <edumazet@...gle.com>,
        Paolo Abeni <pabeni@...hat.com>,
        David Ahern <dsahern@...il.com>,
        Hideaki YOSHIFUJI <yoshfuji@...ux-ipv6.org>
Subject: Re: [PATCHv4 net-next 10/10] net: add support for ipv4 big tcp:
 manual merge

Hello,

(I reduced the Cc list to the maintainers of the files modified by this
patch)

On 28/01/2023 16:58, Xin Long wrote:
> Similar to Eric's IPv6 BIG TCP, this patch is to enable IPv4 BIG TCP.
> 
> Firstly, allow sk->sk_gso_max_size to be set to a value greater than
> GSO_LEGACY_MAX_SIZE by not trimming gso_max_size in sk_trim_gso_size()
> for IPv4 TCP sockets.
> 
> Then on TX path, set IP header tot_len to 0 when skb->len > IP_MAX_MTU
> in __ip_local_out() to allow to send BIG TCP packets, and this implies
> that skb->len is the length of a IPv4 packet; On RX path, use skb->len
> as the length of the IPv4 packet when the IP header tot_len is 0 and
> skb->len > IP_MAX_MTU in ip_rcv_core(). As the API iph_set_totlen() and
> skb_ip_totlen() are used in __ip_local_out() and ip_rcv_core(), we only
> need to update these APIs.
> 
> Also in GRO receive, add the check for ETH_P_IP/IPPROTO_TCP, and allows
> the merged packet size >= GRO_LEGACY_MAX_SIZE in skb_gro_receive(). In
> GRO complete, set IP header tot_len to 0 when the merged packet size
> greater than IP_MAX_MTU in iph_set_totlen() so that it can be processed
> on RX path.
> 
> Note that by checking skb_is_gso_tcp() in API iph_totlen(), it makes
> this implementation safe to use iph->len == 0 indicates IPv4 BIG TCP
> packets.

(...)

> diff --git a/net/core/gro.c b/net/core/gro.c
> index 506f83d715f8..b15f85546bdd 100644
> --- a/net/core/gro.c
> +++ b/net/core/gro.c
> @@ -162,16 +162,18 @@ int skb_gro_receive(struct sk_buff *p, struct sk_buff *skb)
>  	struct sk_buff *lp;
>  	int segs;
>  
> -	/* pairs with WRITE_ONCE() in netif_set_gro_max_size() */
> -	gro_max_size = READ_ONCE(p->dev->gro_max_size);
> +	/* pairs with WRITE_ONCE() in netif_set_gro(_ipv4)_max_size() */
> +	gro_max_size = p->protocol == htons(ETH_P_IPV6) ?
> +			READ_ONCE(p->dev->gro_max_size) :
> +				READ_ONCE(p->dev->gro_ipv4_max_size);
>  
FYI, we got a small conflict when merging -net in net-next in the MPTCP
tree due to another patch from -net:

  7d2c89b32587 ("skb: Do mix page pool and page referenced frags in GRO")

and this one applied in net-next:

  b1a78b9b9886 ("net: add support for ipv4 big tcp")

The conflict has been resolved on our side[1] by keeping the
modifications from both sides and the resolution we suggest is attached
to this email.

Cheers,
Matt

[1] https://github.com/multipath-tcp/mptcp_net-next/commit/56e08652439a
-- 
Tessares | Belgium | Hybrid Access Solutions
www.tessares.net
View attachment "56e08652439ad5b87d5dc668e8a40ab934b58a45.patch" of type "text/x-patch" (992 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ