Skip to content

Commit 4662f8e

Browse files
committed
tgupdate: merge t/DO-NOT-MERGE-mptcp-enabled-by-default into t/upstream base
2 parents 7fcf489 + 41c32d6 commit 4662f8e

File tree

4 files changed

+7
-30
lines changed

4 files changed

+7
-30
lines changed

net/mptcp/fastopen.c

Lines changed: 2 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -40,13 +40,12 @@ void mptcp_fastopen_subflow_synack_set_params(struct mptcp_subflow_context *subf
4040
tp->copied_seq += skb->len;
4141
subflow->ssn_offset += skb->len;
4242

43-
/* initialize a dummy sequence number, we will update it at MPC
44-
* completion, if needed
45-
*/
43+
/* Only the sequence delta is relevant */
4644
MPTCP_SKB_CB(skb)->map_seq = -skb->len;
4745
MPTCP_SKB_CB(skb)->end_seq = 0;
4846
MPTCP_SKB_CB(skb)->offset = 0;
4947
MPTCP_SKB_CB(skb)->has_rxtstamp = TCP_SKB_CB(skb)->has_rxtstamp;
48+
MPTCP_SKB_CB(skb)->cant_coalesce = 1;
5049

5150
mptcp_data_lock(sk);
5251
DEBUG_NET_WARN_ON_ONCE(sock_owned_by_user_nocheck(sk));
@@ -59,23 +58,3 @@ void mptcp_fastopen_subflow_synack_set_params(struct mptcp_subflow_context *subf
5958

6059
mptcp_data_unlock(sk);
6160
}
62-
63-
void __mptcp_fastopen_gen_msk_ackseq(struct mptcp_sock *msk, struct mptcp_subflow_context *subflow,
64-
const struct mptcp_options_received *mp_opt)
65-
{
66-
struct sock *sk = (struct sock *)msk;
67-
struct sk_buff *skb;
68-
69-
DEBUG_NET_WARN_ON_ONCE(sock_owned_by_user_nocheck(sk));
70-
skb = skb_peek_tail(&sk->sk_receive_queue);
71-
if (skb) {
72-
WARN_ON_ONCE(MPTCP_SKB_CB(skb)->end_seq);
73-
pr_debug("msk %p moving seq %llx -> %llx end_seq %llx -> %llx\n", sk,
74-
MPTCP_SKB_CB(skb)->map_seq, MPTCP_SKB_CB(skb)->map_seq + msk->ack_seq,
75-
MPTCP_SKB_CB(skb)->end_seq, MPTCP_SKB_CB(skb)->end_seq + msk->ack_seq);
76-
MPTCP_SKB_CB(skb)->map_seq += msk->ack_seq;
77-
MPTCP_SKB_CB(skb)->end_seq += msk->ack_seq;
78-
}
79-
80-
pr_debug("msk=%p ack_seq=%llx\n", msk, msk->ack_seq);
81-
}

net/mptcp/protocol.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,8 @@ static bool mptcp_try_coalesce(struct sock *sk, struct sk_buff *to,
124124
bool fragstolen;
125125
int delta;
126126

127-
if (MPTCP_SKB_CB(from)->offset ||
127+
if (unlikely(MPTCP_SKB_CB(to)->cant_coalesce) ||
128+
MPTCP_SKB_CB(from)->offset ||
128129
((to->len + from->len) > (sk->sk_rcvbuf >> 3)) ||
129130
!skb_try_coalesce(to, from, &fragstolen, &delta))
130131
return false;
@@ -299,6 +300,7 @@ static bool __mptcp_move_skb(struct mptcp_sock *msk, struct sock *ssk,
299300
MPTCP_SKB_CB(skb)->end_seq = MPTCP_SKB_CB(skb)->map_seq + copy_len;
300301
MPTCP_SKB_CB(skb)->offset = offset;
301302
MPTCP_SKB_CB(skb)->has_rxtstamp = has_rxtstamp;
303+
MPTCP_SKB_CB(skb)->cant_coalesce = 0;
302304

303305
if (MPTCP_SKB_CB(skb)->map_seq == msk->ack_seq) {
304306
/* in sequence */

net/mptcp/protocol.h

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,8 @@ struct mptcp_skb_cb {
130130
u64 map_seq;
131131
u64 end_seq;
132132
u32 offset;
133-
u8 has_rxtstamp:1;
133+
u8 has_rxtstamp;
134+
u8 cant_coalesce;
134135
};
135136

136137
#define MPTCP_SKB_CB(__skb) ((struct mptcp_skb_cb *)&((__skb)->cb[0]))
@@ -1056,8 +1057,6 @@ void mptcp_event_pm_listener(const struct sock *ssk,
10561057
enum mptcp_event_type event);
10571058
bool mptcp_userspace_pm_active(const struct mptcp_sock *msk);
10581059

1059-
void __mptcp_fastopen_gen_msk_ackseq(struct mptcp_sock *msk, struct mptcp_subflow_context *subflow,
1060-
const struct mptcp_options_received *mp_opt);
10611060
void mptcp_fastopen_subflow_synack_set_params(struct mptcp_subflow_context *subflow,
10621061
struct request_sock *req);
10631062
int mptcp_nl_fill_addr(struct sk_buff *skb,

net/mptcp/subflow.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -802,9 +802,6 @@ void __mptcp_subflow_fully_established(struct mptcp_sock *msk,
802802
subflow_set_remote_key(msk, subflow, mp_opt);
803803
WRITE_ONCE(subflow->fully_established, true);
804804
WRITE_ONCE(msk->fully_established, true);
805-
806-
if (subflow->is_mptfo)
807-
__mptcp_fastopen_gen_msk_ackseq(msk, subflow, mp_opt);
808805
}
809806

810807
static struct sock *subflow_syn_recv_sock(const struct sock *sk,

0 commit comments

Comments
 (0)