Skip to content
This repository was archived by the owner on Nov 19, 2025. It is now read-only.

Commit ddf21bd

Browse files
committed
Revert "mptcp: Restart sending missing data when falling back at the beginning"
This reverts commit 142af6d. This commit depends on commit 1285e39 ("mptcp: Build-Fix"), linked to commit c61bc63 ("Merge tag 'v4.15-rc3' into mptcp_trunk"). Indeed since this commit, the TCP RB tree needs to be modified. With this patch in < v4.15, data are resend but as "new" data, not as retransmitted data. Signed-off-by: Matthieu Baerts <[email protected]>
1 parent 142af6d commit ddf21bd

File tree

2 files changed

+12
-15
lines changed

2 files changed

+12
-15
lines changed

net/mptcp/mptcp_ctrl.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1746,8 +1746,8 @@ void mptcp_close(struct sock *meta_sk, long timeout)
17461746
int data_was_unread = 0;
17471747
int state;
17481748

1749-
mptcp_debug("%s: Close of meta_sk with tok %#x state %u\n",
1750-
__func__, mpcb->mptcp_loc_token, meta_sk->sk_state);
1749+
mptcp_debug("%s: Close of meta_sk with tok %#x\n",
1750+
__func__, mpcb->mptcp_loc_token);
17511751

17521752
WARN_ON(atomic_inc_not_zero(&mpcb->mpcb_refcnt) == 0);
17531753
mutex_lock(&mpcb->mpcb_mutex);
@@ -1778,7 +1778,6 @@ void mptcp_close(struct sock *meta_sk, long timeout)
17781778
mptcp_for_each_sk_safe(mpcb, sk_it, tmpsk) {
17791779
if (tcp_sk(sk_it)->send_mp_fclose)
17801780
continue;
1781-
17821781
mptcp_sub_close(sk_it, 0);
17831782
}
17841783
goto adjudge_to_death;

net/mptcp/mptcp_input.c

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -582,28 +582,28 @@ static int mptcp_prevalidate_skb(struct sock *sk, struct sk_buff *skb)
582582
return 0;
583583
}
584584

585-
static void mptcp_restart_sending(struct sock *meta_sk, uint32_t in_flight_seq)
585+
static void mptcp_restart_sending(struct sock *meta_sk)
586586
{
587587
struct tcp_sock *meta_tp = tcp_sk(meta_sk);
588588
struct mptcp_cb *mpcb = meta_tp->mpcb;
589589

590-
/* We resend everything that has not been acknowledged and is not in-flight */
590+
/* We resend everything that has not been acknowledged */
591591
meta_sk->sk_send_head = tcp_write_queue_head(meta_sk);
592592

593-
/* We artificially restart parts of the send-queue. Thus,
594-
* it is as if no packets are in flight, minus the one that are.
593+
/* We artificially restart the whole send-queue. Thus,
594+
* it is as if no packets are in flight
595595
*/
596596
meta_tp->packets_out = 0;
597597

598598
/* If the snd_nxt already wrapped around, we have to
599-
* undo the wrapping, as we are restarting from in_flight_seq
599+
* undo the wrapping, as we are restarting from snd_una
600600
* on.
601601
*/
602-
if (meta_tp->snd_nxt < in_flight_seq) {
602+
if (meta_tp->snd_nxt < meta_tp->snd_una) {
603603
mpcb->snd_high_order[mpcb->snd_hiseq_index] -= 2;
604604
mpcb->snd_hiseq_index = mpcb->snd_hiseq_index ? 0 : 1;
605605
}
606-
meta_tp->snd_nxt = in_flight_seq;
606+
meta_tp->snd_nxt = meta_tp->snd_una;
607607

608608
/* Trigger a sending on the meta. */
609609
mptcp_push_pending_frames(meta_sk);
@@ -706,9 +706,9 @@ static int mptcp_detect_mapping(struct sock *sk, struct sk_buff *skb)
706706
data_len = skb->len + (mptcp_is_data_fin(skb) ? 1 : 0);
707707
sub_seq = tcb->seq;
708708

709-
mptcp_sub_force_close_all(mpcb, sk);
709+
mptcp_restart_sending(tp->meta_sk);
710710

711-
mptcp_restart_sending(tp->meta_sk, meta_tp->snd_una);
711+
mptcp_sub_force_close_all(mpcb, sk);
712712

713713
/* data_seq and so on are set correctly */
714714

@@ -1640,8 +1640,6 @@ bool mptcp_handle_ack_in_infinite(struct sock *sk, const struct sk_buff *skb,
16401640

16411641
mptcp_sub_force_close_all(mpcb, sk);
16421642

1643-
mptcp_restart_sending(tp->meta_sk, tp->mptcp->last_end_data_seq);
1644-
16451643
MPTCP_INC_STATS(sock_net(sk), MPTCP_MIB_FBACKINIT);
16461644

16471645
/* The acknowledged data-seq at the subflow-level is:
@@ -2185,7 +2183,7 @@ static void mptcp_mp_fail_rcvd(struct sock *sk, const struct tcphdr *th)
21852183
if (!th->rst && !mpcb->infinite_mapping_snd) {
21862184
mpcb->send_infinite_mapping = 1;
21872185

2188-
mptcp_restart_sending(meta_sk, tcp_sk(meta_sk)->snd_una);
2186+
mptcp_restart_sending(meta_sk);
21892187

21902188
mptcp_sub_force_close_all(mpcb, sk);
21912189
}

0 commit comments

Comments
 (0)