Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 16 Jul 2012 09:53:09 +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:  <CAMOc5czkZQsW9cYhYe8yDavXr-4YGhvGcBCdmazLCcUw4j3B-Q@mail.gmail.com>
In-Reply-To: <5002E616.8050202@myri.com>
References:  <4FFF9E48.6000403@myri.com> <500060DB.3090407@myri.com> <CAMOc5cyCQ=be8%2B2fRM=wMyRhwyw2_OMoCSTL5cWNfM58vFWFGQ@mail.gmail.com> <5002E616.8050202@myri.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sun, Jul 15, 2012 at 11:47 PM, Reese Faucette <reese@myri.com> wrote:
> On 7/15/2012 3:26 AM, Sepherosa Ziehau wrote:
>
>> !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.
>
>
> You'd think that was the case from the name, but tcp_timer_active() calls
> callout_active() which checks for fired.  If you want to check for "timer

Hmm, callout_active() is not used to check for whether the callout is
fired or not; it is used to check whether callout_reset() has been
called but callout_stop() is not yet been called.  IMO,
callout_reset() is "set" the callout, callout_stop() is "unset" the
callout.

AFAIR, callout_pending() is kinda check for whether the callback
function of the callout "is being executed" or not (PENDING bit is
probably cleared immediately before running the callback function).

Best Regards,
sephe

> set" you need to use callout_pending().
> -reese
>
>



-- 
Tomorrow Will Never Die



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAMOc5czkZQsW9cYhYe8yDavXr-4YGhvGcBCdmazLCcUw4j3B-Q>