From owner-p4-projects@FreeBSD.ORG Tue May 5 07:31:35 2009 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 58132106566C; Tue, 5 May 2009 07:31:35 +0000 (UTC) Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 069E91065675 for ; Tue, 5 May 2009 07:31:35 +0000 (UTC) (envelope-from andre@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id 4C24E8FC23 for ; Tue, 5 May 2009 07:31:34 +0000 (UTC) (envelope-from andre@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.3/8.14.3) with ESMTP id n457VYSH003755 for ; Tue, 5 May 2009 07:31:34 GMT (envelope-from andre@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id n457VYxi003753 for perforce@freebsd.org; Tue, 5 May 2009 07:31:34 GMT (envelope-from andre@freebsd.org) Date: Tue, 5 May 2009 07:31:34 GMT Message-Id: <200905050731.n457VYxi003753@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to andre@freebsd.org using -f From: Andre Oppermann To: Perforce Change Reviews Cc: Subject: PERFORCE change 161597 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 May 2009 07:31:39 -0000 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);