aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/net/mptcp/subflow.c
diff options
context:
space:
mode:
authorFlorian Westphal <fw@strlen.de>2020-02-26 10:14:51 +0100
committerDavid S. Miller <davem@davemloft.net>2020-02-26 20:46:26 -0800
commit2e52213c79c0b94aff42ba898ad9ad57546be67d (patch)
tree87979d44054a051fdc13afd8b36474c4ced32f6a /net/mptcp/subflow.c
parentmptcp: remove mptcp_read_actor (diff)
downloadwireguard-linux-2e52213c79c0b94aff42ba898ad9ad57546be67d.tar.xz
wireguard-linux-2e52213c79c0b94aff42ba898ad9ad57546be67d.zip
mptcp: avoid work queue scheduling if possible
We can't lock_sock() the mptcp socket from the subflow data_ready callback, it would result in ABBA deadlock with the subflow socket lock. We can however grab the spinlock: if that succeeds and the mptcp socket is not owned at the moment, we can process the new skbs right away without deferring this to the work queue. This avoids the schedule_work and hence the small delay until the work item is processed. Signed-off-by: Florian Westphal <fw@strlen.de> Reviewed-by: Mat Martineau <mathew.j.martineau@linux.intel.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/mptcp/subflow.c')
-rw-r--r--net/mptcp/subflow.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/net/mptcp/subflow.c b/net/mptcp/subflow.c
index 37a4767db441..0de2a44bdaa0 100644
--- a/net/mptcp/subflow.c
+++ b/net/mptcp/subflow.c
@@ -563,7 +563,7 @@ static void subflow_data_ready(struct sock *sk)
}
if (mptcp_subflow_data_available(sk))
- mptcp_data_ready(parent);
+ mptcp_data_ready(parent, sk);
}
static void subflow_write_space(struct sock *sk)
@@ -696,7 +696,7 @@ static void subflow_state_change(struct sock *sk)
* the data available machinery here.
*/
if (parent && subflow->mp_capable && mptcp_subflow_data_available(sk))
- mptcp_data_ready(parent);
+ mptcp_data_ready(parent, sk);
if (parent && !(parent->sk_shutdown & RCV_SHUTDOWN) &&
!subflow->rx_eof && subflow_is_done(sk)) {