Date: Tue, 5 May 2009 07:31:34 GMT From: Andre Oppermann <andre@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 161597 for review Message-ID: <200905050731.n457VYxi003753@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=161597 Change 161597 by andre@andre_t61 on 2009/05/05 07:31:23 Extend duplicate ACK detection. Affected files ... .. //depot/projects/tcp_new/netinet/tcp_input.c#10 edit Differences ... ==== //depot/projects/tcp_new/netinet/tcp_input.c#10 (text+ko) ==== @@ -2941,10 +2941,11 @@ * XXXAO: This is not entirely correct as it allows for other * packets between the duplicate ACKs. */ - if (sacked > 0 || - (tlen == 0 && acked == 0 && SEQ_LT(tp->snd_una, tp->snd_nxt) && tp->snd_wnd == tiwin)) - tp->snd_dupack += 1; - else if (acked > 0 && tp->snd_dupack > 0) + if ((sacked > 0 && th->th_ack == tp->snd_una) || + (tlen == 0 && acked == 0 && SEQ_LT(tp->snd_una, tp->snd_nxt) && + th->th_ack == tp->snd_una && tp->snd_wnd == tiwin)) + tp->snd_dupack++; + else if (tp->snd_dupack > 0 && (acked > 0 || SEQ_GT(th->th_seq, tp->snd_una))) tp->snd_dupack = 0; KASSERT(SEQ_LT(tp->snd_una, tp->snd_nxt) || tp->snd_dupack == 0, @@ -2953,14 +2954,20 @@ /* * Advance the unacknowledged pointer. */ - tp->snd_una += acked; + if (acked > 0) + tp->snd_una += acked; + + KASSERT(tp->snd_una == tp->snd_nxt || tcp_timer_active(TT_RXMIT), + ("%s: outstanding data but RXMIT timer not active", __func__)); /* * Stop the retransmit timer if all data we sent has been - * acknowledged. Otherwise restart it if we still have + * acknowledged. Otherwise move it forward if we still have * outstanding data. + * + * XXXAO: Handle backoff on multiple retransmits. */ - if (tp->snd_una == tp->snd_nxt) + if (acked > 0 && tp->snd_una == tp->snd_nxt) tcp_timer_activate(TT_RXMIT, 0); else if (acked > 0) tcp_timer_activate(TT_RXMIT, tp->snd_rto);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200905050731.n457VYxi003753>