* [PATCH] Squash-to: "mptcp: wake-up readers only for in sequence data"
@ 2021-06-07 14:08 Paolo Abeni
2021-06-07 14:57 ` Matthieu Baerts
0 siblings, 1 reply; 3+ messages in thread
From: Paolo Abeni @ 2021-06-07 14:08 UTC (permalink / raw)
To: mptcp; +Cc: Matthieu Baerts
We need to flip the DATA_READY bit under the mptcp_data_lock()
(or before acquiring it, as the old code did), or the BH could
end-up flipping the bit after that the user-space already
flushed the just-appended data.
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
---
net/mptcp/protocol.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/net/mptcp/protocol.c b/net/mptcp/protocol.c
index 8e7cf4c480a6..8ef60e415d9a 100644
--- a/net/mptcp/protocol.c
+++ b/net/mptcp/protocol.c
@@ -687,8 +687,6 @@ static bool move_skbs_to_msk(struct mptcp_sock *msk, struct sock *ssk)
if (inet_sk_state_load(sk) == TCP_CLOSE)
return false;
- mptcp_data_lock(sk);
-
__mptcp_move_skbs_from_subflow(msk, ssk, &moved);
__mptcp_ofo_queue(msk);
if (unlikely(ssk->sk_err)) {
@@ -705,8 +703,6 @@ static bool move_skbs_to_msk(struct mptcp_sock *msk, struct sock *ssk)
*/
if (mptcp_pending_data_fin(sk, NULL))
mptcp_schedule_work(sk);
- mptcp_data_unlock(sk);
-
return moved > 0;
}
@@ -733,10 +729,12 @@ void mptcp_data_ready(struct sock *sk, struct sock *ssk)
return;
/* Wake-up the reader only for in-sequence data */
+ mptcp_data_lock(sk);
if (move_skbs_to_msk(msk, ssk)) {
set_bit(MPTCP_DATA_READY, &msk->flags);
sk->sk_data_ready(sk);
}
+ mptcp_data_unlock(sk);
}
static bool mptcp_do_flush_join_list(struct mptcp_sock *msk)
--
2.26.3
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] Squash-to: "mptcp: wake-up readers only for in sequence data"
2021-06-07 14:08 [PATCH] Squash-to: "mptcp: wake-up readers only for in sequence data" Paolo Abeni
@ 2021-06-07 14:57 ` Matthieu Baerts
2021-06-07 16:45 ` Mat Martineau
0 siblings, 1 reply; 3+ messages in thread
From: Matthieu Baerts @ 2021-06-07 14:57 UTC (permalink / raw)
To: Paolo Abeni, Mat Martineau; +Cc: mptcp
Hi Paolo, Mat,
On 07/06/2021 16:08, Paolo Abeni wrote:
> We need to flip the DATA_READY bit under the mptcp_data_lock()
> (or before acquiring it, as the old code did), or the BH could
> end-up flipping the bit after that the user-space already
> flushed the just-appended data.
>
> Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Thank you for the patch!
@Mat: I hope you don't mind if I already apply it to fix issues/201 and
apply other patches!
- b2427404975d: "squashed" in "mptcp: wake-up readers only for in
sequence data"
- Results: 3c5535f65726..e5d80c7af352
Builds and tests are now in progress:
https://cirrus-ci.com/github/multipath-tcp/mptcp_net-next/export/20210607T145646
https://github.com/multipath-tcp/mptcp_net-next/actions/workflows/build-validation.yml?query=branch:export/20210607T145646
Cheers,
Matt
--
Tessares | Belgium | Hybrid Access Solutions
www.tessares.net
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] Squash-to: "mptcp: wake-up readers only for in sequence data"
2021-06-07 14:57 ` Matthieu Baerts
@ 2021-06-07 16:45 ` Mat Martineau
0 siblings, 0 replies; 3+ messages in thread
From: Mat Martineau @ 2021-06-07 16:45 UTC (permalink / raw)
To: Matthieu Baerts; +Cc: Paolo Abeni, mptcp
On Mon, 7 Jun 2021, Matthieu Baerts wrote:
> Hi Paolo, Mat,
>
> On 07/06/2021 16:08, Paolo Abeni wrote:
>> We need to flip the DATA_READY bit under the mptcp_data_lock()
>> (or before acquiring it, as the old code did), or the BH could
>> end-up flipping the bit after that the user-space already
>> flushed the just-appended data.
>>
>> Signed-off-by: Paolo Abeni <pabeni@redhat.com>
>
> Thank you for the patch!
>
> @Mat: I hope you don't mind if I already apply it to fix issues/201 and
> apply other patches!
No problem!
>
> - b2427404975d: "squashed" in "mptcp: wake-up readers only for in
> sequence data"
> - Results: 3c5535f65726..e5d80c7af352
>
> Builds and tests are now in progress:
>
> https://cirrus-ci.com/github/multipath-tcp/mptcp_net-next/export/20210607T145646
> https://github.com/multipath-tcp/mptcp_net-next/actions/workflows/build-validation.yml?query=branch:export/20210607T145646
--
Mat Martineau
Intel
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2021-06-07 16:45 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-07 14:08 [PATCH] Squash-to: "mptcp: wake-up readers only for in sequence data" Paolo Abeni
2021-06-07 14:57 ` Matthieu Baerts
2021-06-07 16:45 ` Mat Martineau
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).