diff options
author | David S. Miller <davem@davemloft.net> | 2013-05-24 19:48:28 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2013-05-24 19:48:28 -0400 |
commit | e6ff4c75f9095f61b3a66c2a78e47b62864022dd (patch) | |
tree | 425ea9463cbec0b1975b8a33d9a56817143055d0 /net/ipv4/tcp_input.c | |
parent | ee9c799c231324de681eb21e06d8bf4842768b75 (diff) | |
parent | 0e255f1c0c9add2f0c920240ac4cadc28ae274c3 (diff) |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Merge net into net-next because some upcoming net-next changes
build on top of bug fixes that went into net.
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4/tcp_input.c')
-rw-r--r-- | net/ipv4/tcp_input.c | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c index d7d369428ae4..8230cd6243aa 100644 --- a/net/ipv4/tcp_input.c +++ b/net/ipv4/tcp_input.c | |||
@@ -2679,8 +2679,8 @@ static void tcp_process_loss(struct sock *sk, int flag, bool is_dupack) | |||
2679 | * tcp_xmit_retransmit_queue(). | 2679 | * tcp_xmit_retransmit_queue(). |
2680 | */ | 2680 | */ |
2681 | static void tcp_fastretrans_alert(struct sock *sk, int pkts_acked, | 2681 | static void tcp_fastretrans_alert(struct sock *sk, int pkts_acked, |
2682 | int prior_sacked, bool is_dupack, | 2682 | int prior_sacked, int prior_packets, |
2683 | int flag) | 2683 | bool is_dupack, int flag) |
2684 | { | 2684 | { |
2685 | struct inet_connection_sock *icsk = inet_csk(sk); | 2685 | struct inet_connection_sock *icsk = inet_csk(sk); |
2686 | struct tcp_sock *tp = tcp_sk(sk); | 2686 | struct tcp_sock *tp = tcp_sk(sk); |
@@ -2740,7 +2740,8 @@ static void tcp_fastretrans_alert(struct sock *sk, int pkts_acked, | |||
2740 | tcp_add_reno_sack(sk); | 2740 | tcp_add_reno_sack(sk); |
2741 | } else | 2741 | } else |
2742 | do_lost = tcp_try_undo_partial(sk, pkts_acked); | 2742 | do_lost = tcp_try_undo_partial(sk, pkts_acked); |
2743 | newly_acked_sacked = pkts_acked + tp->sacked_out - prior_sacked; | 2743 | newly_acked_sacked = prior_packets - tp->packets_out + |
2744 | tp->sacked_out - prior_sacked; | ||
2744 | break; | 2745 | break; |
2745 | case TCP_CA_Loss: | 2746 | case TCP_CA_Loss: |
2746 | tcp_process_loss(sk, flag, is_dupack); | 2747 | tcp_process_loss(sk, flag, is_dupack); |
@@ -2754,7 +2755,8 @@ static void tcp_fastretrans_alert(struct sock *sk, int pkts_acked, | |||
2754 | if (is_dupack) | 2755 | if (is_dupack) |
2755 | tcp_add_reno_sack(sk); | 2756 | tcp_add_reno_sack(sk); |
2756 | } | 2757 | } |
2757 | newly_acked_sacked = pkts_acked + tp->sacked_out - prior_sacked; | 2758 | newly_acked_sacked = prior_packets - tp->packets_out + |
2759 | tp->sacked_out - prior_sacked; | ||
2758 | 2760 | ||
2759 | if (icsk->icsk_ca_state <= TCP_CA_Disorder) | 2761 | if (icsk->icsk_ca_state <= TCP_CA_Disorder) |
2760 | tcp_try_undo_dsack(sk); | 2762 | tcp_try_undo_dsack(sk); |
@@ -3265,9 +3267,10 @@ static int tcp_ack(struct sock *sk, const struct sk_buff *skb, int flag) | |||
3265 | bool is_dupack = false; | 3267 | bool is_dupack = false; |
3266 | u32 prior_in_flight; | 3268 | u32 prior_in_flight; |
3267 | u32 prior_fackets; | 3269 | u32 prior_fackets; |
3268 | int prior_packets; | 3270 | int prior_packets = tp->packets_out; |
3269 | int prior_sacked = tp->sacked_out; | 3271 | int prior_sacked = tp->sacked_out; |
3270 | int pkts_acked = 0; | 3272 | int pkts_acked = 0; |
3273 | int previous_packets_out = 0; | ||
3271 | 3274 | ||
3272 | /* If the ack is older than previous acks | 3275 | /* If the ack is older than previous acks |
3273 | * then we can probably ignore it. | 3276 | * then we can probably ignore it. |
@@ -3338,14 +3341,14 @@ static int tcp_ack(struct sock *sk, const struct sk_buff *skb, int flag) | |||
3338 | sk->sk_err_soft = 0; | 3341 | sk->sk_err_soft = 0; |
3339 | icsk->icsk_probes_out = 0; | 3342 | icsk->icsk_probes_out = 0; |
3340 | tp->rcv_tstamp = tcp_time_stamp; | 3343 | tp->rcv_tstamp = tcp_time_stamp; |
3341 | prior_packets = tp->packets_out; | ||
3342 | if (!prior_packets) | 3344 | if (!prior_packets) |
3343 | goto no_queue; | 3345 | goto no_queue; |
3344 | 3346 | ||
3345 | /* See if we can take anything off of the retransmit queue. */ | 3347 | /* See if we can take anything off of the retransmit queue. */ |
3348 | previous_packets_out = tp->packets_out; | ||
3346 | flag |= tcp_clean_rtx_queue(sk, prior_fackets, prior_snd_una); | 3349 | flag |= tcp_clean_rtx_queue(sk, prior_fackets, prior_snd_una); |
3347 | 3350 | ||
3348 | pkts_acked = prior_packets - tp->packets_out; | 3351 | pkts_acked = previous_packets_out - tp->packets_out; |
3349 | 3352 | ||
3350 | if (tcp_ack_is_dubious(sk, flag)) { | 3353 | if (tcp_ack_is_dubious(sk, flag)) { |
3351 | /* Advance CWND, if state allows this. */ | 3354 | /* Advance CWND, if state allows this. */ |
@@ -3353,7 +3356,7 @@ static int tcp_ack(struct sock *sk, const struct sk_buff *skb, int flag) | |||
3353 | tcp_cong_avoid(sk, ack, prior_in_flight); | 3356 | tcp_cong_avoid(sk, ack, prior_in_flight); |
3354 | is_dupack = !(flag & (FLAG_SND_UNA_ADVANCED | FLAG_NOT_DUP)); | 3357 | is_dupack = !(flag & (FLAG_SND_UNA_ADVANCED | FLAG_NOT_DUP)); |
3355 | tcp_fastretrans_alert(sk, pkts_acked, prior_sacked, | 3358 | tcp_fastretrans_alert(sk, pkts_acked, prior_sacked, |
3356 | is_dupack, flag); | 3359 | prior_packets, is_dupack, flag); |
3357 | } else { | 3360 | } else { |
3358 | if (flag & FLAG_DATA_ACKED) | 3361 | if (flag & FLAG_DATA_ACKED) |
3359 | tcp_cong_avoid(sk, ack, prior_in_flight); | 3362 | tcp_cong_avoid(sk, ack, prior_in_flight); |
@@ -3376,7 +3379,7 @@ no_queue: | |||
3376 | /* If data was DSACKed, see if we can undo a cwnd reduction. */ | 3379 | /* If data was DSACKed, see if we can undo a cwnd reduction. */ |
3377 | if (flag & FLAG_DSACKING_ACK) | 3380 | if (flag & FLAG_DSACKING_ACK) |
3378 | tcp_fastretrans_alert(sk, pkts_acked, prior_sacked, | 3381 | tcp_fastretrans_alert(sk, pkts_acked, prior_sacked, |
3379 | is_dupack, flag); | 3382 | prior_packets, is_dupack, flag); |
3380 | /* If this ack opens up a zero window, clear backoff. It was | 3383 | /* If this ack opens up a zero window, clear backoff. It was |
3381 | * being used to time the probes, and is probably far higher than | 3384 | * being used to time the probes, and is probably far higher than |
3382 | * it needs to be for normal retransmission. | 3385 | * it needs to be for normal retransmission. |
@@ -3399,7 +3402,7 @@ old_ack: | |||
3399 | if (TCP_SKB_CB(skb)->sacked) { | 3402 | if (TCP_SKB_CB(skb)->sacked) { |
3400 | flag |= tcp_sacktag_write_queue(sk, skb, prior_snd_una); | 3403 | flag |= tcp_sacktag_write_queue(sk, skb, prior_snd_una); |
3401 | tcp_fastretrans_alert(sk, pkts_acked, prior_sacked, | 3404 | tcp_fastretrans_alert(sk, pkts_acked, prior_sacked, |
3402 | is_dupack, flag); | 3405 | prior_packets, is_dupack, flag); |
3403 | } | 3406 | } |
3404 | 3407 | ||
3405 | SOCK_DEBUG(sk, "Ack %u before %u:%u\n", ack, tp->snd_una, tp->snd_nxt); | 3408 | SOCK_DEBUG(sk, "Ack %u before %u:%u\n", ack, tp->snd_una, tp->snd_nxt); |