diff options
author | Ilpo Järvinen <ilpo.jarvinen@helsinki.fi> | 2008-09-21 00:25:52 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-09-21 00:25:52 -0400 |
commit | 90638a04ad8484b6b6c567656fb3f6d0689e23da (patch) | |
tree | 87a14ffe430d4663ec4df268459c78d07a4e75a2 /net | |
parent | ef9da47c7cc64d69526331f315e76b5680d4048f (diff) |
tcp: don't clear lost_skb_hint when not necessary
Most importantly avoid doing it with cumulative ACK. However,
since we have lost_cnt_hint in the picture as well needing
adjustments, it's not as trivial as dealing with
retransmit_skb_hint (and cannot be done in the all place we
could trivially leave retransmit_skb_hint untouched).
With the previous patch, this should mostly remove O(n^2)
behavior while cumulative ACKs start flowing once rexmit
after a lossy round-trip made it through.
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@helsinki.fi>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r-- | net/ipv4/tcp_input.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c index 44a4fffc2cc3..85627f83665f 100644 --- a/net/ipv4/tcp_input.c +++ b/net/ipv4/tcp_input.c | |||
@@ -2844,6 +2844,7 @@ static int tcp_clean_rtx_queue(struct sock *sk, int prior_fackets) | |||
2844 | int flag = 0; | 2844 | int flag = 0; |
2845 | u32 pkts_acked = 0; | 2845 | u32 pkts_acked = 0; |
2846 | u32 reord = tp->packets_out; | 2846 | u32 reord = tp->packets_out; |
2847 | u32 prior_sacked = tp->sacked_out; | ||
2847 | s32 seq_rtt = -1; | 2848 | s32 seq_rtt = -1; |
2848 | s32 ca_seq_rtt = -1; | 2849 | s32 ca_seq_rtt = -1; |
2849 | ktime_t last_ackt = net_invalid_timestamp(); | 2850 | ktime_t last_ackt = net_invalid_timestamp(); |
@@ -2925,9 +2926,11 @@ static int tcp_clean_rtx_queue(struct sock *sk, int prior_fackets) | |||
2925 | 2926 | ||
2926 | tcp_unlink_write_queue(skb, sk); | 2927 | tcp_unlink_write_queue(skb, sk); |
2927 | sk_wmem_free_skb(sk, skb); | 2928 | sk_wmem_free_skb(sk, skb); |
2928 | tcp_clear_retrans_hints_partial(tp); | 2929 | tp->scoreboard_skb_hint = NULL; |
2929 | if (skb == tp->retransmit_skb_hint) | 2930 | if (skb == tp->retransmit_skb_hint) |
2930 | tp->retransmit_skb_hint = NULL; | 2931 | tp->retransmit_skb_hint = NULL; |
2932 | if (skb == tp->lost_skb_hint) | ||
2933 | tp->lost_skb_hint = NULL; | ||
2931 | } | 2934 | } |
2932 | 2935 | ||
2933 | if (skb && (TCP_SKB_CB(skb)->sacked & TCPCB_SACKED_ACKED)) | 2936 | if (skb && (TCP_SKB_CB(skb)->sacked & TCPCB_SACKED_ACKED)) |
@@ -2946,6 +2949,15 @@ static int tcp_clean_rtx_queue(struct sock *sk, int prior_fackets) | |||
2946 | /* Non-retransmitted hole got filled? That's reordering */ | 2949 | /* Non-retransmitted hole got filled? That's reordering */ |
2947 | if (reord < prior_fackets) | 2950 | if (reord < prior_fackets) |
2948 | tcp_update_reordering(sk, tp->fackets_out - reord, 0); | 2951 | tcp_update_reordering(sk, tp->fackets_out - reord, 0); |
2952 | |||
2953 | /* No need to care for underflows here because | ||
2954 | * the lost_skb_hint gets NULLed if we're past it | ||
2955 | * (or something non-trivial happened) | ||
2956 | */ | ||
2957 | if (tcp_is_fack(tp)) | ||
2958 | tp->lost_cnt_hint -= pkts_acked; | ||
2959 | else | ||
2960 | tp->lost_cnt_hint -= prior_sacked - tp->sacked_out; | ||
2949 | } | 2961 | } |
2950 | 2962 | ||
2951 | tp->fackets_out -= min(pkts_acked, tp->fackets_out); | 2963 | tp->fackets_out -= min(pkts_acked, tp->fackets_out); |