Skip to content

Commit a7abf3c

Browse files
edumazetdavem330
authored andcommitted
tcp: consider using standard rtx logic in tcp_rcv_fastopen_synack()
Jakub reported Data included in a Fastopen SYN that had to be retransmit would have to wait for an RTO if TX completions are slow, even with prior fix. This is because tcp_rcv_fastopen_synack() does not use standard rtx logic, meaning TSQ handler exits early in tcp_tsq_write() because tp->lost_out == tp->retrans_out Lets make tcp_rcv_fastopen_synack() use standard rtx logic, by using tcp_mark_skb_lost() on the skb thats needs to be sent again. Not this raised a warning in tcp_fastretrans_alert() during my tests since we consider the data not being aknowledged by the receiver does not mean packet was lost on the network. Signed-off-by: Eric Dumazet <[email protected]> Reported-by: Jakub Kicinski <[email protected]> Cc: Neal Cardwell <[email protected]> Cc: Yuchung Cheng <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent f4dae54 commit a7abf3c

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

net/ipv4/tcp_input.c

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2914,7 +2914,7 @@ static void tcp_fastretrans_alert(struct sock *sk, const u32 prior_snd_una,
29142914
/* D. Check state exit conditions. State can be terminated
29152915
* when high_seq is ACKed. */
29162916
if (icsk->icsk_ca_state == TCP_CA_Open) {
2917-
WARN_ON(tp->retrans_out != 0);
2917+
WARN_ON(tp->retrans_out != 0 && !tp->syn_data);
29182918
tp->retrans_stamp = 0;
29192919
} else if (!before(tp->snd_una, tp->high_seq)) {
29202920
switch (icsk->icsk_ca_state) {
@@ -5994,11 +5994,9 @@ static bool tcp_rcv_fastopen_synack(struct sock *sk, struct sk_buff *synack,
59945994
tp->fastopen_client_fail = TFO_SYN_RETRANSMITTED;
59955995
else
59965996
tp->fastopen_client_fail = TFO_DATA_NOT_ACKED;
5997-
skb_rbtree_walk_from(data) {
5998-
if (__tcp_retransmit_skb(sk, data, 1))
5999-
break;
6000-
}
6001-
tcp_rearm_rto(sk);
5997+
skb_rbtree_walk_from(data)
5998+
tcp_mark_skb_lost(sk, data);
5999+
tcp_xmit_retransmit_queue(sk);
60026000
NET_INC_STATS(sock_net(sk),
60036001
LINUX_MIB_TCPFASTOPENACTIVEFAIL);
60046002
return true;

0 commit comments

Comments
 (0)