[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CACSApvZ8vXXJ_zKf_HpoVgACwWxS2UvBw9QCv1ZnPX9ZpF3D_g@mail.gmail.com>
Date: Tue, 1 Feb 2022 13:47:58 -0500
From: Soheil Hassas Yeganeh <soheil@...gle.com>
To: Eric Dumazet <eric.dumazet@...il.com>
Cc: "David S . Miller" <davem@...emloft.net>,
Jakub Kicinski <kuba@...nel.org>,
netdev <netdev@...r.kernel.org>,
Eric Dumazet <edumazet@...gle.com>,
Paolo Abeni <pabeni@...hat.com>,
Mat Martineau <mathew.j.martineau@...ux.intel.com>,
Talal Ahmad <talalahmad@...gle.com>,
Arjun Roy <arjunroy@...gle.com>,
Willem de Bruijn <willemb@...gle.com>
Subject: Re: [PATCH net] tcp: add missing tcp_skb_can_collapse() test in tcp_shift_skb_data()
On Tue, Feb 1, 2022 at 1:46 PM Eric Dumazet <eric.dumazet@...il.com> wrote:
>
> From: Eric Dumazet <edumazet@...gle.com>
>
> tcp_shift_skb_data() might collapse three packets into a larger one.
>
> P_A, P_B, P_C -> P_ABC
>
> Historically, it used a single tcp_skb_can_collapse_to(P_A) call,
> because it was enough.
>
> In commit 85712484110d ("tcp: coalesce/collapse must respect MPTCP extensions"),
> this call was replaced by a call to tcp_skb_can_collapse(P_A, P_B)
>
> But the now needed test over P_C has been missed.
>
> This probably broke MPTCP.
>
> Then later, commit 9b65b17db723 ("net: avoid double accounting for pure zerocopy skbs")
> added an extra condition to tcp_skb_can_collapse(), but the missing call
> from tcp_shift_skb_data() is also breaking TCP zerocopy, because P_A and P_C
> might have different skb_zcopy_pure() status.
>
> Fixes: 85712484110d ("tcp: coalesce/collapse must respect MPTCP extensions")
> Fixes: 9b65b17db723 ("net: avoid double accounting for pure zerocopy skbs")
> Signed-off-by: Eric Dumazet <edumazet@...gle.com>
> Cc: Paolo Abeni <pabeni@...hat.com>
> Cc: Mat Martineau <mathew.j.martineau@...ux.intel.com>
> Cc: Talal Ahmad <talalahmad@...gle.com>
> Cc: Arjun Roy <arjunroy@...gle.com>
> Cc: Soheil Hassas Yeganeh <soheil@...gle.com>
> Cc: Willem de Bruijn <willemb@...gle.com>
Acked-by: Soheil Hassas Yeganeh <soheil@...gle.com>
I wish there were some packetdrill tests for MPTCP. Thank you for the fix!
> ---
> net/ipv4/tcp_input.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c
> index dc49a3d551eb919baf5ad812ef21698c5c7b9679..bfe4112e000c09ba9d7d8b64392f52337b9053e9 100644
> --- a/net/ipv4/tcp_input.c
> +++ b/net/ipv4/tcp_input.c
> @@ -1660,6 +1660,8 @@ static struct sk_buff *tcp_shift_skb_data(struct sock *sk, struct sk_buff *skb,
> (mss != tcp_skb_seglen(skb)))
> goto out;
>
> + if (!tcp_skb_can_collapse(prev, skb))
> + goto out;
> len = skb->len;
> pcount = tcp_skb_pcount(skb);
> if (tcp_skb_shift(prev, skb, pcount, len))
> --
> 2.35.0.rc2.247.g8bbb082509-goog
>
Powered by blists - more mailing lists