diff options
author | Ilpo Järvinen <ilpo.jarvinen@helsinki.fi> | 2008-09-21 00:25:15 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-09-21 00:25:15 -0400 |
commit | ef9da47c7cc64d69526331f315e76b5680d4048f (patch) | |
tree | 97407b83c7c339dbe1fd0948c30f35e1680562ec /net/ipv4/tcp_output.c | |
parent | f0ceb0ed86b4792a4ed9d3438f5f7572e48f9803 (diff) |
tcp: don't clear retransmit_skb_hint when not necessary
Most importantly avoid doing it with cumulative ACK. Not clearing
means that we no longer need n^2 processing in resolution of each
fast recovery.
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@helsinki.fi>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4/tcp_output.c')
-rw-r--r-- | net/ipv4/tcp_output.c | 8 |
1 files changed, 5 insertions, 3 deletions
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; |