aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/net/tcp.h7
-rw-r--r--net/ipv4/tcp_input.c4
-rw-r--r--net/ipv4/tcp_output.c8
3 files changed, 14 insertions, 5 deletions
diff --git a/include/net/tcp.h b/include/net/tcp.h
index 220f54cf42ec..ea815723d414 100644
--- a/include/net/tcp.h
+++ b/include/net/tcp.h
@@ -1037,10 +1037,15 @@ static inline void tcp_mib_init(struct net *net)
1037} 1037}
1038 1038
1039/* from STCP */ 1039/* from STCP */
1040static inline void tcp_clear_all_retrans_hints(struct tcp_sock *tp) 1040static inline void tcp_clear_retrans_hints_partial(struct tcp_sock *tp)
1041{ 1041{
1042 tp->lost_skb_hint = NULL; 1042 tp->lost_skb_hint = NULL;
1043 tp->scoreboard_skb_hint = NULL; 1043 tp->scoreboard_skb_hint = NULL;
1044}
1045
1046static inline void tcp_clear_all_retrans_hints(struct tcp_sock *tp)
1047{
1048 tcp_clear_retrans_hints_partial(tp);
1044 tp->retransmit_skb_hint = NULL; 1049 tp->retransmit_skb_hint = NULL;
1045} 1050}
1046 1051
diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c
index d017aed6edd7..44a4fffc2cc3 100644
--- a/net/ipv4/tcp_input.c
+++ b/net/ipv4/tcp_input.c
@@ -2925,7 +2925,9 @@ static int tcp_clean_rtx_queue(struct sock *sk, int prior_fackets)
2925 2925
2926 tcp_unlink_write_queue(skb, sk); 2926 tcp_unlink_write_queue(skb, sk);
2927 sk_wmem_free_skb(sk, skb); 2927 sk_wmem_free_skb(sk, skb);
2928 tcp_clear_all_retrans_hints(tp); 2928 tcp_clear_retrans_hints_partial(tp);
2929 if (skb == tp->retransmit_skb_hint)
2930 tp->retransmit_skb_hint = NULL;
2929 } 2931 }
2930 2932
2931 if (skb && (TCP_SKB_CB(skb)->sacked & TCPCB_SACKED_ACKED)) 2933 if (skb && (TCP_SKB_CB(skb)->sacked & TCPCB_SACKED_ACKED))
diff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c
index f900fae8b87e..239cea7b6c0e 100644
--- a/net/ipv4/tcp_output.c
+++ b/net/ipv4/tcp_output.c
@@ -750,7 +750,7 @@ int tcp_fragment(struct sock *sk, struct sk_buff *skb, u32 len,
750 750
751 BUG_ON(len > skb->len); 751 BUG_ON(len > skb->len);
752 752
753 tcp_clear_all_retrans_hints(tp); 753 tcp_clear_retrans_hints_partial(tp);
754 nsize = skb_headlen(skb) - len; 754 nsize = skb_headlen(skb) - len;
755 if (nsize < 0) 755 if (nsize < 0)
756 nsize = 0; 756 nsize = 0;
@@ -1823,7 +1823,9 @@ static void tcp_retrans_try_collapse(struct sock *sk, struct sk_buff *skb,
1823 tp->packets_out -= tcp_skb_pcount(next_skb); 1823 tp->packets_out -= tcp_skb_pcount(next_skb);
1824 1824
1825 /* changed transmit queue under us so clear hints */ 1825 /* changed transmit queue under us so clear hints */
1826 tcp_clear_all_retrans_hints(tp); 1826 tcp_clear_retrans_hints_partial(tp);
1827 if (next_skb == tp->retransmit_skb_hint)
1828 tp->retransmit_skb_hint = skb;
1827 1829
1828 sk_wmem_free_skb(sk, next_skb); 1830 sk_wmem_free_skb(sk, next_skb);
1829} 1831}
@@ -1853,7 +1855,7 @@ void tcp_simple_retransmit(struct sock *sk)
1853 } 1855 }
1854 } 1856 }
1855 1857
1856 tcp_clear_all_retrans_hints(tp); 1858 tcp_clear_retrans_hints_partial(tp);
1857 1859
1858 if (prior_lost == tp->lost_out) 1860 if (prior_lost == tp->lost_out)
1859 return; 1861 return;