From: Eric Dumazet <hidden> Date: 2022-02-01 18:46:47
From: Eric Dumazet <edumazet@google.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@google.com>
Cc: Paolo Abeni <pabeni@redhat.com>
Cc: Mat Martineau <redacted>
Cc: Talal Ahmad <redacted>
Cc: Arjun Roy <redacted>
Cc: Soheil Hassas Yeganeh <redacted>
Cc: Willem de Bruijn <willemb@google.com>
---
net/ipv4/tcp_input.c | 2 ++
1 file changed, 2 insertions(+)
On Tue, Feb 1, 2022 at 1:46 PM Eric Dumazet [off-list ref] wrote:
From: Eric Dumazet <edumazet@google.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@google.com>
Cc: Paolo Abeni <pabeni@redhat.com>
Cc: Mat Martineau <redacted>
Cc: Talal Ahmad <redacted>
Cc: Arjun Roy <redacted>
Cc: Soheil Hassas Yeganeh <redacted>
Cc: Willem de Bruijn <willemb@google.com>
Acked-by: Soheil Hassas Yeganeh <redacted>
I wish there were some packetdrill tests for MPTCP. Thank you for the fix!
From: Mat Martineau <hidden> Date: 2022-02-01 20:01:25
On Tue, 1 Feb 2022, Soheil Hassas Yeganeh wrote:
On Tue, Feb 1, 2022 at 1:46 PM Eric Dumazet [off-list ref] wrote:
quoted
From: Eric Dumazet <edumazet@google.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@google.com>
Cc: Paolo Abeni <pabeni@redhat.com>
Cc: Mat Martineau <redacted>
Cc: Talal Ahmad <redacted>
Cc: Arjun Roy <redacted>
Cc: Soheil Hassas Yeganeh <redacted>
Cc: Willem de Bruijn <willemb@google.com>
Acked-by: Soheil Hassas Yeganeh <redacted>
I wish there were some packetdrill tests for MPTCP. Thank you for the fix!
Soheil -
I have good news, there are packetdrill tests for MPTCP:
https://github.com/multipath-tcp/packetdrill
This is still in a fork. I think Davide has talked to Neal about
upstreaming the MPTCP changes before but there may be some code that needs
refactoring before that could happen.
From: Paolo Abeni <pabeni@redhat.com> Date: 2022-02-02 09:38:27
On Tue, 2022-02-01 at 12:01 -0800, Mat Martineau wrote:
On Tue, 1 Feb 2022, Soheil Hassas Yeganeh wrote:
quoted
On Tue, Feb 1, 2022 at 1:46 PM Eric Dumazet [off-list ref] wrote:
quoted
From: Eric Dumazet <edumazet@google.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.
Indeed it looks like it could cause MPTCP data stream corruption, in
case of multiple substreams, if we hit this code-path. Thanks for
catching and fixing it!
quoted
quoted
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@google.com>
Cc: Paolo Abeni <pabeni@redhat.com>
Cc: Mat Martineau <redacted>
Cc: Talal Ahmad <redacted>
Cc: Arjun Roy <redacted>
Cc: Soheil Hassas Yeganeh <redacted>
Cc: Willem de Bruijn <willemb@google.com>
Acked-by: Soheil Hassas Yeganeh <redacted>
Acked-by: Paolo Abeni <pabeni@redhat.com>
quoted
I wish there were some packetdrill tests for MPTCP. Thank you for the fix!
Do you have by chance a drill for the zero-copy case? it may help
creating the MPTCP one, too.
Thanks!
Paolo
Hello:
This patch was applied to netdev/net.git (master)
by Jakub Kicinski [off-list ref]:
On Tue, 1 Feb 2022 10:46:40 -0800 you wrote:
From: Eric Dumazet <edumazet@google.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.
[...]