Skip to content

Commit d94d3b9

Browse files
committed
tcp: refactor tcp_retransmit_timer()
jira LE-3201 Rebuild_History Non-Buildable kernel-rt-4.18.0-553.22.1.rt7.363.el8_10 commit-author Eric Dumazet <edumazet@google.com> commit 0d580fb It appears linux-4.14 stable needs a backport of commit 88f8598 ("tcp: exit if nothing to retransmit on RTO timeout") Since tcp_rtx_queue_empty() is not in pre 4.15 kernels, let's refactor tcp_retransmit_timer() to only use tcp_rtx_queue_head() I will provide to stable teams the squashed patches. Signed-off-by: Eric Dumazet <edumazet@google.com> Cc: Willem de Bruijn <willemb@google.com> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Acked-by: Soheil Hassas Yeganeh <soheil@google.com> Signed-off-by: David S. Miller <davem@davemloft.net> (cherry picked from commit 0d580fb) Signed-off-by: Jonathan Maple <jmaple@ciq.com>
1 parent b2f277a commit d94d3b9

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

net/ipv4/tcp_timer.c

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -437,6 +437,7 @@ void tcp_retransmit_timer(struct sock *sk)
437437
struct net *net = sock_net(sk);
438438
struct inet_connection_sock *icsk = inet_csk(sk);
439439
struct request_sock *req;
440+
struct sk_buff *skb;
440441

441442
req = rcu_dereference_protected(tp->fastopen_rsk,
442443
lockdep_sock_is_held(sk));
@@ -449,7 +450,12 @@ void tcp_retransmit_timer(struct sock *sk)
449450
*/
450451
return;
451452
}
452-
if (!tp->packets_out || WARN_ON_ONCE(tcp_rtx_queue_empty(sk)))
453+
454+
if (!tp->packets_out)
455+
return;
456+
457+
skb = tcp_rtx_queue_head(sk);
458+
if (WARN_ON_ONCE(!skb))
453459
return;
454460

455461
tp->tlp_high_seq = 0;
@@ -483,7 +489,7 @@ void tcp_retransmit_timer(struct sock *sk)
483489
goto out;
484490
}
485491
tcp_enter_loss(sk);
486-
tcp_retransmit_skb(sk, tcp_rtx_queue_head(sk), 1);
492+
tcp_retransmit_skb(sk, skb, 1);
487493
__sk_dst_reset(sk);
488494
goto out_reset_timer;
489495
}

0 commit comments

Comments
 (0)