Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 15 Jul 2012 18:26:02 +0800
From:      Sepherosa Ziehau <sepherosa@gmail.com>
To:        Reese Faucette <reese@myri.com>
Cc:        freebsd-net@freebsd.org
Subject:   Re: question in tcp_do_segment()
Message-ID:  <CAMOc5cyCQ=be8%2B2fRM=wMyRhwyw2_OMoCSTL5cWNfM58vFWFGQ@mail.gmail.com>
In-Reply-To: <500060DB.3090407@myri.com>
References:  <4FFF9E48.6000403@myri.com> <500060DB.3090407@myri.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sat, Jul 14, 2012 at 1:54 AM, Reese Faucette <reese@myri.com> wrote:
> Hi, freebsd-net-
>
> I don't have a testcase for this at the moment, but there's a test
> in tcp_do_segment that looks backwards to me...
>
> http://svnweb.freebsd.org/base/release/9.0.0/sys/netinet/tcp_input.c?view=markup
>
> line 2398 -
>         if (!tcp_timer_active(tp, TT_REXMT) ||
>             th->th_ack != tp->snd_una)
>                tp->t_dupacks = 0;
>
> says "If we get a DUP ack and the retransmit timer is NOT
> fired, then ignore it and reset DUP ACK count."
>
> Isn't that exactly backwards?  I could see ignoring the DUP ACK if we
> know the retransmit timer HAS fired, and we don't want to interfere with
> its retransmission efforts.  The way the code is written now, as far as
> I can see, completely defeats retransmission based on DUP acks.  I
> accidentally ran across this by breaking the timer, so that the
> retransmit timer never fires, and my streams get stuck, even with plenty of
> DUP ACKs.
>
> Am I missing something, or should that "!" go ?

!tcp_timer_active() means that the connection's retransmit timer is
not _set_ yet (please note, it is _not_ "has fired").  As far as I
understand this code, it in turn means that this connection doesn't
have any segments that were sent but not yet ACKed.

Best Regards,
sephe

-- 
Tomorrow Will Never Die



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAMOc5cyCQ=be8%2B2fRM=wMyRhwyw2_OMoCSTL5cWNfM58vFWFGQ>