aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4/tcp_input.c
diff options
context:
space:
mode:
authorNeal Cardwell <ncardwell@google.com>2011-11-16 03:58:03 -0500
committerDavid S. Miller <davem@davemloft.net>2011-11-27 18:54:09 -0500
commite95ae2f2cf10f7bf27b492aa6188f3cd745de162 (patch)
tree2808047891b1c8e3eae559c55d09a5cfeef79fdb /net/ipv4/tcp_input.c
parent5628adf1a0ff39b9e76e1a8e1c94dadabfd46914 (diff)
tcp: use SACKs and DSACKs that arrive on ACKs below snd_una
The bug: When the ACK field is below snd_una (which can happen when ACKs are reordered), senders ignored DSACKs (preventing undo) and did not call tcp_fastretrans_alert, so they did not increment prr_delivered to reflect newly-SACKed sequence ranges, and did not call tcp_xmit_retransmit_queue, thus passing up chances to send out more retransmitted and new packets based on any newly-SACKed packets. The change: When the ACK field is below snd_una (the "old_ack" goto label), call tcp_fastretrans_alert to allow undo based on any newly-arrived DSACKs and try to send out more packets based on newly-SACKed packets. Other patches in this series will provide other changes that are necessary to fully fix this problem. Signed-off-by: Neal Cardwell <ncardwell@google.com> Acked-by: Ilpo Järvinen <ilpo.jarvinen@helsinki.fi> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4/tcp_input.c')
-rw-r--r--net/ipv4/tcp_input.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c
index b49e41864037..751d39060fb8 100644
--- a/net/ipv4/tcp_input.c
+++ b/net/ipv4/tcp_input.c
@@ -3805,10 +3805,14 @@ invalid_ack:
3805 return -1; 3805 return -1;
3806 3806
3807old_ack: 3807old_ack:
3808 /* If data was SACKed, tag it and see if we should send more data.
3809 * If data was DSACKed, see if we can undo a cwnd reduction.
3810 */
3808 if (TCP_SKB_CB(skb)->sacked) { 3811 if (TCP_SKB_CB(skb)->sacked) {
3809 tcp_sacktag_write_queue(sk, skb, prior_snd_una); 3812 flag |= tcp_sacktag_write_queue(sk, skb, prior_snd_una);
3810 if (icsk->icsk_ca_state == TCP_CA_Open) 3813 newly_acked_sacked = tp->sacked_out - prior_sacked;
3811 tcp_try_keep_open(sk); 3814 tcp_fastretrans_alert(sk, pkts_acked, newly_acked_sacked,
3815 is_dupack, flag);
3812 } 3816 }
3813 3817
3814 SOCK_DEBUG(sk, "Ack %u before %u:%u\n", ack, tp->snd_una, tp->snd_nxt); 3818 SOCK_DEBUG(sk, "Ack %u before %u:%u\n", ack, tp->snd_una, tp->snd_nxt);