Commit 101f6f85 authored by Florian Westphal's avatar Florian Westphal Committed by David S. Miller

mptcp: add and use mptcp_data_ready helper

allows us to schedule the work queue to drain the ssk receive queue in
a followup patch.

This is needed to avoid sending all-to-pessimistic mptcp-level
acknowledgements.  At this time, the ack_seq is what was last read by
userspace instead of the highest in-sequence number queued for reading.
Signed-off-by: default avatarFlorian Westphal <fw@strlen.de>
Reviewed-by: default avatarMat Martineau <mathew.j.martineau@linux.intel.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 5cd129dd
...@@ -111,6 +111,14 @@ static struct sock *mptcp_subflow_get(const struct mptcp_sock *msk) ...@@ -111,6 +111,14 @@ static struct sock *mptcp_subflow_get(const struct mptcp_sock *msk)
return NULL; return NULL;
} }
void mptcp_data_ready(struct sock *sk)
{
struct mptcp_sock *msk = mptcp_sk(sk);
set_bit(MPTCP_DATA_READY, &msk->flags);
sk->sk_data_ready(sk);
}
static bool mptcp_ext_cache_refill(struct mptcp_sock *msk) static bool mptcp_ext_cache_refill(struct mptcp_sock *msk)
{ {
if (!msk->cached_ext) if (!msk->cached_ext)
......
...@@ -201,6 +201,7 @@ void mptcp_get_options(const struct sk_buff *skb, ...@@ -201,6 +201,7 @@ void mptcp_get_options(const struct sk_buff *skb,
struct tcp_options_received *opt_rx); struct tcp_options_received *opt_rx);
void mptcp_finish_connect(struct sock *sk); void mptcp_finish_connect(struct sock *sk);
void mptcp_data_ready(struct sock *sk);
int mptcp_token_new_request(struct request_sock *req); int mptcp_token_new_request(struct request_sock *req);
void mptcp_token_destroy_request(u32 token); void mptcp_token_destroy_request(u32 token);
......
...@@ -554,11 +554,8 @@ static void subflow_data_ready(struct sock *sk) ...@@ -554,11 +554,8 @@ static void subflow_data_ready(struct sock *sk)
return; return;
} }
if (mptcp_subflow_data_available(sk)) { if (mptcp_subflow_data_available(sk))
set_bit(MPTCP_DATA_READY, &mptcp_sk(parent)->flags); mptcp_data_ready(parent);
parent->sk_data_ready(parent);
}
} }
static void subflow_write_space(struct sock *sk) static void subflow_write_space(struct sock *sk)
...@@ -690,11 +687,8 @@ static void subflow_state_change(struct sock *sk) ...@@ -690,11 +687,8 @@ static void subflow_state_change(struct sock *sk)
* a fin packet carrying a DSS can be unnoticed if we don't trigger * a fin packet carrying a DSS can be unnoticed if we don't trigger
* the data available machinery here. * the data available machinery here.
*/ */
if (parent && subflow->mp_capable && mptcp_subflow_data_available(sk)) { if (parent && subflow->mp_capable && mptcp_subflow_data_available(sk))
set_bit(MPTCP_DATA_READY, &mptcp_sk(parent)->flags); mptcp_data_ready(parent);
parent->sk_data_ready(parent);
}
if (parent && !(parent->sk_shutdown & RCV_SHUTDOWN) && if (parent && !(parent->sk_shutdown & RCV_SHUTDOWN) &&
!subflow->rx_eof && subflow_is_done(sk)) { !subflow->rx_eof && subflow_is_done(sk)) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment