PERFORCE change 161597 for review
    Andre Oppermann 
    andre at FreeBSD.org
       
    Tue May  5 07:31:39 UTC 2009
    
    
  
http://perforce.freebsd.org/chv.cgi?CH=161597
Change 161597 by andre at 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);
    
    
More information about the p4-projects
mailing list