Skip to content

Commit 6e628cd

Browse files
Paolo Abenikuba-moo
Paolo Abeni
authored andcommitted
mptcp: use mptcp release_cb for delayed tasks
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 <[email protected]> Signed-off-by: Paolo Abeni <[email protected]> Reviewed-by: Mat Martineau <[email protected]> Signed-off-by: Jakub Kicinski <[email protected]>
1 parent 7439d68 commit 6e628cd

File tree

4 files changed

+168
-117
lines changed

4 files changed

+168
-117
lines changed

net/mptcp/options.c

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -830,7 +830,7 @@ static u64 expand_ack(u64 old_ack, u64 cur_ack, bool use_64bit)
830830
}
831831

832832
static void ack_update_msk(struct mptcp_sock *msk,
833-
const struct sock *ssk,
833+
struct sock *ssk,
834834
struct mptcp_options_received *mp_opt)
835835
{
836836
u64 new_wnd_end, new_snd_una, snd_nxt = READ_ONCE(msk->snd_nxt);
@@ -854,8 +854,7 @@ static void ack_update_msk(struct mptcp_sock *msk,
854854

855855
if (after64(new_wnd_end, msk->wnd_end)) {
856856
msk->wnd_end = new_wnd_end;
857-
if (mptcp_send_head(sk))
858-
mptcp_schedule_work(sk);
857+
__mptcp_wnd_updated(sk, ssk);
859858
}
860859

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

918-
if (__mptcp_check_fallback(msk))
917+
if (__mptcp_check_fallback(msk)) {
918+
/* Keep it simple and unconditionally trigger send data cleanup and
919+
* pending queue spooling. We will need to acquire the data lock
920+
* for more accurate checks, and once the lock is acquired, such
921+
* helpers are cheap.
922+
*/
923+
mptcp_data_lock(subflow->conn);
924+
if (mptcp_send_head(subflow->conn))
925+
__mptcp_wnd_updated(subflow->conn, sk);
926+
__mptcp_data_acked(subflow->conn);
927+
mptcp_data_unlock(subflow->conn);
919928
return;
929+
}
920930

921931
mptcp_get_options(skb, &mp_opt);
922932
if (!check_fully_established(msk, sk, subflow, skb, &mp_opt))

0 commit comments

Comments
 (0)