aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4/tcp_output.c
diff options
context:
space:
mode:
authorEric Dumazet <edumazet@google.com>2017-10-16 22:38:35 -0400
committerDavid S. Miller <davem@davemloft.net>2017-10-18 09:19:26 -0400
commitb9f1f1ce866c28e3d9b86202441b220244754a69 (patch)
treea4d2e4e627de150fbb6b72a754f511aaf7bd0537 /net/ipv4/tcp_output.c
parentb082af73bf527aa5180c8979d4620e450494c07b (diff)
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: 75c119afe14f ("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>
Diffstat (limited to 'net/ipv4/tcp_output.c')
-rw-r--r--net/ipv4/tcp_output.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c
index 6c74f2a39778..53dc1267c85e 100644
--- a/net/ipv4/tcp_output.c
+++ b/net/ipv4/tcp_output.c
@@ -2921,7 +2921,7 @@ int tcp_retransmit_skb(struct sock *sk, struct sk_buff *skb, int segs)
2921void tcp_xmit_retransmit_queue(struct sock *sk) 2921void tcp_xmit_retransmit_queue(struct sock *sk)
2922{ 2922{
2923 const struct inet_connection_sock *icsk = inet_csk(sk); 2923 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;
2925 struct tcp_sock *tp = tcp_sk(sk); 2925 struct tcp_sock *tp = tcp_sk(sk);
2926 u32 max_segs; 2926 u32 max_segs;
2927 int mib_idx; 2927 int mib_idx;
@@ -2929,11 +2929,8 @@ void tcp_xmit_retransmit_queue(struct sock *sk)
2929 if (!tp->packets_out) 2929 if (!tp->packets_out)
2930 return; 2930 return;
2931 2931
2932 skb = tp->retransmit_skb_hint; 2932 rtx_head = tcp_rtx_queue_head(sk);
2933 if (!skb) { 2933 skb = tp->retransmit_skb_hint ?: rtx_head;
2934 rtx_head = tcp_rtx_queue_head(sk);
2935 skb = rtx_head;
2936 }
2937 max_segs = tcp_tso_segs(sk, tcp_current_mss(sk)); 2934 max_segs = tcp_tso_segs(sk, tcp_current_mss(sk));
2938 skb_rbtree_walk_from(skb) { 2935 skb_rbtree_walk_from(skb) {
2939 __u8 sacked; 2936 __u8 sacked;