Skip to content

Commit

Permalink
tcp: fix tcp_xmit_retransmit_queue() after rbtree introduction
Browse files Browse the repository at this point in the history
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 <edumazet@google.com>
Reported-by: Yuchung Cheng <ycheng@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Eric Dumazet authored and David S. Miller committed Oct 18, 2017
1 parent b082af7 commit b9f1f1c
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions net/ipv4/tcp_output.c
Original file line number Diff line number Diff line change
Expand Up @@ -2921,19 +2921,16 @@ int tcp_retransmit_skb(struct sock *sk, struct sk_buff *skb, int segs)
void tcp_xmit_retransmit_queue(struct sock *sk)
{
const struct inet_connection_sock *icsk = inet_csk(sk);
struct sk_buff *skb, *rtx_head = NULL, *hole = NULL;
struct sk_buff *skb, *rtx_head, *hole = NULL;
struct tcp_sock *tp = tcp_sk(sk);
u32 max_segs;
int mib_idx;

if (!tp->packets_out)
return;

skb = tp->retransmit_skb_hint;
if (!skb) {
rtx_head = tcp_rtx_queue_head(sk);
skb = rtx_head;
}
rtx_head = tcp_rtx_queue_head(sk);
skb = tp->retransmit_skb_hint ?: rtx_head;
max_segs = tcp_tso_segs(sk, tcp_current_mss(sk));
skb_rbtree_walk_from(skb) {
__u8 sacked;
Expand Down

0 comments on commit b9f1f1c

Please sign in to comment.