Commit e95ae2f2 authored by Neal Cardwell's avatar Neal Cardwell Committed by David S. Miller

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: default avatarNeal Cardwell <ncardwell@google.com>
Acked-by: default avatarIlpo Järvinen <ilpo.jarvinen@helsinki.fi>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 5628adf1
...@@ -3805,10 +3805,14 @@ static int tcp_ack(struct sock *sk, const struct sk_buff *skb, int flag) ...@@ -3805,10 +3805,14 @@ static int tcp_ack(struct sock *sk, const struct sk_buff *skb, int flag)
return -1; return -1;
old_ack: old_ack:
/* If data was SACKed, tag it and see if we should send more data.
* If data was DSACKed, see if we can undo a cwnd reduction.
*/
if (TCP_SKB_CB(skb)->sacked) { if (TCP_SKB_CB(skb)->sacked) {
tcp_sacktag_write_queue(sk, skb, prior_snd_una); flag |= tcp_sacktag_write_queue(sk, skb, prior_snd_una);
if (icsk->icsk_ca_state == TCP_CA_Open) newly_acked_sacked = tp->sacked_out - prior_sacked;
tcp_try_keep_open(sk); tcp_fastretrans_alert(sk, pkts_acked, newly_acked_sacked,
is_dupack, flag);
} }
SOCK_DEBUG(sk, "Ack %u before %u:%u\n", ack, tp->snd_una, tp->snd_nxt); SOCK_DEBUG(sk, "Ack %u before %u:%u\n", ack, tp->snd_una, tp->snd_nxt);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment