All of lore.kernel.org
 help / color / mirror / Atom feed
From: Gerrit Renker <gerrit@erg.abdn.ac.uk>
To: dccp@vger.kernel.org
Subject: Re: [PATCH 3/6]: Fix calculation of t_ipi time of scheduled transmission
Date: Thu, 23 Nov 2006 11:59:43 +0000	[thread overview]
Message-ID: <200611231159.43164@strip-the-willow> (raw)
In-Reply-To: <5640c7e00611210945l39bc33f5q3ab38c0bba022c1a@mail.gmail.com>

Quoting Ian McDonald:
|  > +                * if (t_now > t_nom - delta)
|  > +                *       // send the packet now
|  > +                * else
|  > +                *       // send the packet in (t_nom - t_now) milliseconds.
|  > +                */
|  > +               if (delay < hctx->ccid3hctx_delta)
|  > +                       rc = 0;
|  > +               else
|  > +                       rc = delay/1000L;
|  
|  Shouldn't that last line be rc = (delay-hctx->ccid3hctx_delta)/1000 as
|  you're not taking the delta into account on the else clause.

The value of `delay' is the difference between t_nom = t_(i+1) and t_now:

	delay = timeval_delta(&hctx->ccid3hctx_t_nom, &now);

If this difference is less than delta (which includes the case when t_now is
later than t_nom such that the difference is negative), then the packet is sent now.

If the difference is greater than delta then t_now < t_nom and the packet is too early
to be sent; [RFC 3448, 4.6] says to reschedule in 

          t_ipi - (t_now - t_i) = t_ipi - (t_now - t_i) = (t_i + t_ipi) - t_now
                                                        = t_(i+1)       - t_now
                                                        = t_nom         - t_now

Hence we can reuse the timeval_delta. Maybe the variable should be renamed to highlight
the fact that it is a time difference, but I quite liked `delay'.

  parent reply	other threads:[~2006-11-23 11:59 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-11-21 17:45 [PATCH 3/6]: Fix calculation of t_ipi time of scheduled transmission Ian McDonald
2006-11-22 17:59 ` Ian McDonald
2006-11-22 18:06 ` Ian McDonald
2006-11-23  9:46 ` Gerrit Renker
2006-11-23 11:59 ` Gerrit Renker [this message]
2006-11-23 17:50 ` Ian McDonald
2006-11-24 22:14 ` Ian McDonald
2006-11-26 17:32 ` Arnaldo Carvalho de Melo
2006-11-27 10:04 ` Gerrit Renker
  -- strict thread matches above, loose matches on Subject: below --
2006-11-21 15:45 Gerrit Renker

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200611231159.43164@strip-the-willow \
    --to=gerrit@erg.abdn.ac.uk \
    --cc=dccp@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.