Skip to content

Commit b9f1f1c

Browse files
edumazetdavem330
authored andcommitted
tcp: fix tcp_xmit_retransmit_queue() after rbtree introduction
I tried to hard avoiding a call to rb_first() (via tcp_rtx_queue_head) in tcp_xmit_retransmit_queue(). But this was probably too bold. Quoting Yuchung : We might miss re-arming the RTO if tp->retransmit_skb_hint is not NULL. This can happen when RACK marks the first packet lost again and resets tp->retransmit_skb_hint for example (tcp_rack_mark_skb_lost()) Fixes: 75c119a ("tcp: implement rb-tree based retransmit queue") Signed-off-by: Eric Dumazet <[email protected]> Reported-by: Yuchung Cheng <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent b082af7 commit b9f1f1c

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

net/ipv4/tcp_output.c

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2921,19 +2921,16 @@ int tcp_retransmit_skb(struct sock *sk, struct sk_buff *skb, int segs)
29212921
void tcp_xmit_retransmit_queue(struct sock *sk)
29222922
{
29232923
const struct inet_connection_sock *icsk = inet_csk(sk);
2924-
struct sk_buff *skb, *rtx_head = NULL, *hole = NULL;
2924+
struct sk_buff *skb, *rtx_head, *hole = NULL;
29252925
struct tcp_sock *tp = tcp_sk(sk);
29262926
u32 max_segs;
29272927
int mib_idx;
29282928

29292929
if (!tp->packets_out)
29302930
return;
29312931

2932-
skb = tp->retransmit_skb_hint;
2933-
if (!skb) {
2934-
rtx_head = tcp_rtx_queue_head(sk);
2935-
skb = rtx_head;
2936-
}
2932+
rtx_head = tcp_rtx_queue_head(sk);
2933+
skb = tp->retransmit_skb_hint ?: rtx_head;
29372934
max_segs = tcp_tso_segs(sk, tcp_current_mss(sk));
29382935
skb_rbtree_walk_from(skb) {
29392936
__u8 sacked;

0 commit comments

Comments
 (0)