Skip to content
This repository has been archived by the owner on Apr 18, 2024. It is now read-only.

Commit

Permalink
Revert "mptcp: Restart sending missing data when falling back at the …
Browse files Browse the repository at this point in the history
…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 <matthieu.baerts@tessares.net>
  • Loading branch information
matttbe committed Mar 9, 2022
1 parent 142af6d commit ddf21bd
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 15 deletions.
5 changes: 2 additions & 3 deletions net/mptcp/mptcp_ctrl.c
Original file line number Diff line number Diff line change
Expand Up @@ -1746,8 +1746,8 @@ void mptcp_close(struct sock *meta_sk, long timeout)
int data_was_unread = 0;
int state;

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

WARN_ON(atomic_inc_not_zero(&mpcb->mpcb_refcnt) == 0);
mutex_lock(&mpcb->mpcb_mutex);
Expand Down Expand Up @@ -1778,7 +1778,6 @@ void mptcp_close(struct sock *meta_sk, long timeout)
mptcp_for_each_sk_safe(mpcb, sk_it, tmpsk) {
if (tcp_sk(sk_it)->send_mp_fclose)
continue;

mptcp_sub_close(sk_it, 0);
}
goto adjudge_to_death;
Expand Down
22 changes: 10 additions & 12 deletions net/mptcp/mptcp_input.c
Original file line number Diff line number Diff line change
Expand Up @@ -582,28 +582,28 @@ static int mptcp_prevalidate_skb(struct sock *sk, struct sk_buff *skb)
return 0;
}

static void mptcp_restart_sending(struct sock *meta_sk, uint32_t in_flight_seq)
static void mptcp_restart_sending(struct sock *meta_sk)
{
struct tcp_sock *meta_tp = tcp_sk(meta_sk);
struct mptcp_cb *mpcb = meta_tp->mpcb;

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

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

/* If the snd_nxt already wrapped around, we have to
* undo the wrapping, as we are restarting from in_flight_seq
* undo the wrapping, as we are restarting from snd_una
* on.
*/
if (meta_tp->snd_nxt < in_flight_seq) {
if (meta_tp->snd_nxt < meta_tp->snd_una) {
mpcb->snd_high_order[mpcb->snd_hiseq_index] -= 2;
mpcb->snd_hiseq_index = mpcb->snd_hiseq_index ? 0 : 1;
}
meta_tp->snd_nxt = in_flight_seq;
meta_tp->snd_nxt = meta_tp->snd_una;

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

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

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

/* data_seq and so on are set correctly */

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

mptcp_sub_force_close_all(mpcb, sk);

mptcp_restart_sending(tp->meta_sk, tp->mptcp->last_end_data_seq);

MPTCP_INC_STATS(sock_net(sk), MPTCP_MIB_FBACKINIT);

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

mptcp_restart_sending(meta_sk, tcp_sk(meta_sk)->snd_una);
mptcp_restart_sending(meta_sk);

mptcp_sub_force_close_all(mpcb, sk);
}
Expand Down

0 comments on commit ddf21bd

Please sign in to comment.