Skip to content

Commit

Permalink
mptcp: use mptcp release_cb for delayed tasks
Browse files Browse the repository at this point in the history
We have some tasks triggered by the subflow receive path
which require to access the msk socket status, specifically:
mptcp_clean_una() and mptcp_push_pending()

We have almost everything in place to defer to the msk
release_cb such tasks when the msk sock is owned.

Since the worker is no more used to clean the acked data,
for fallback sockets we need to explicitly flush them.

As an added bonus we can move the wake-up code in __mptcp_clean_una(),
simplify a lot mptcp_poll() and move the timer update under
the data lock.

The worker is now used only to process and send DATA_FIN
packets and do the mptcp-level retransmissions.

Acked-by: Florian Westphal <fw@strlen.de>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Reviewed-by: Mat Martineau <mathew.j.martineau@linux.intel.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
  • Loading branch information
Paolo Abeni authored and kuba-moo committed Dec 1, 2020
1 parent 7439d68 commit 6e628cd
Show file tree
Hide file tree
Showing 4 changed files with 168 additions and 117 deletions.
18 changes: 14 additions & 4 deletions net/mptcp/options.c
Original file line number Diff line number Diff line change
Expand Up @@ -830,7 +830,7 @@ static u64 expand_ack(u64 old_ack, u64 cur_ack, bool use_64bit)
}

static void ack_update_msk(struct mptcp_sock *msk,
const struct sock *ssk,
struct sock *ssk,
struct mptcp_options_received *mp_opt)
{
u64 new_wnd_end, new_snd_una, snd_nxt = READ_ONCE(msk->snd_nxt);
Expand All @@ -854,8 +854,7 @@ static void ack_update_msk(struct mptcp_sock *msk,

if (after64(new_wnd_end, msk->wnd_end)) {
msk->wnd_end = new_wnd_end;
if (mptcp_send_head(sk))
mptcp_schedule_work(sk);
__mptcp_wnd_updated(sk, ssk);
}

if (after64(new_snd_una, old_snd_una)) {
Expand Down Expand Up @@ -915,8 +914,19 @@ void mptcp_incoming_options(struct sock *sk, struct sk_buff *skb)
struct mptcp_options_received mp_opt;
struct mptcp_ext *mpext;

if (__mptcp_check_fallback(msk))
if (__mptcp_check_fallback(msk)) {
/* Keep it simple and unconditionally trigger send data cleanup and
* pending queue spooling. We will need to acquire the data lock
* for more accurate checks, and once the lock is acquired, such
* helpers are cheap.
*/
mptcp_data_lock(subflow->conn);
if (mptcp_send_head(subflow->conn))
__mptcp_wnd_updated(subflow->conn, sk);
__mptcp_data_acked(subflow->conn);
mptcp_data_unlock(subflow->conn);
return;
}

mptcp_get_options(skb, &mp_opt);
if (!check_fully_established(msk, sk, subflow, skb, &mp_opt))
Expand Down
Loading

0 comments on commit 6e628cd

Please sign in to comment.