Skip to content

Commit

Permalink
mptcp: fix missing wakeup
Browse files Browse the repository at this point in the history
__mptcp_clean_una() can free write memory and should wake-up
user-space processes when needed.

When such function is invoked by the MPTCP receive path, the wakeup
is not needed, as the TCP stack will later trigger subflow_write_space
which will do the wakeup as needed.

Other __mptcp_clean_una() call sites need an additional wakeup check
Let's bundle the relevant code in a new helper and use it.

Closes: #165
Fixes: 6e628cd ("mptcp: use mptcp release_cb for delayed tasks")
Fixes: 64b9cea ("mptcp: fix spurious retransmissions")
Tested-by: Matthieu Baerts <matthieu.baerts@tessares.net>
Reviewed-by: Mat Martineau <mathew.j.martineau@linux.intel.com>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
  • Loading branch information
Paolo Abeni authored and matttbe committed Feb 25, 2021
1 parent 9e7f2e9 commit 72f4432
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions net/mptcp/protocol.c
Original file line number Diff line number Diff line change
Expand Up @@ -1061,6 +1061,12 @@ static void __mptcp_clean_una(struct sock *sk)
}
}

static void __mptcp_clean_una_wakeup(struct sock *sk)
{
__mptcp_clean_una(sk);
mptcp_write_space(sk);
}

static void mptcp_enter_memory_pressure(struct sock *sk)
{
struct mptcp_subflow_context *subflow;
Expand Down Expand Up @@ -2263,7 +2269,7 @@ static void __mptcp_retrans(struct sock *sk)
struct sock *ssk;
int ret;

__mptcp_clean_una(sk);
__mptcp_clean_una_wakeup(sk);
dfrag = mptcp_rtx_head(sk);
if (!dfrag)
return;
Expand Down Expand Up @@ -2977,7 +2983,7 @@ static void mptcp_release_cb(struct sock *sk)
}

if (test_and_clear_bit(MPTCP_CLEAN_UNA, &mptcp_sk(sk)->flags))
__mptcp_clean_una(sk);
__mptcp_clean_una_wakeup(sk);
if (test_and_clear_bit(MPTCP_ERROR_REPORT, &mptcp_sk(sk)->flags))
__mptcp_error_report(sk);

Expand Down

0 comments on commit 72f4432

Please sign in to comment.