netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stephen Hemminger <shemminger@linux-foundation.org>
To: "Ilpo =?UTF-8?B?SsOkcnZpbmVuIg==?=
	<ilpo.jarvinen@helsinki.fi>"@smtp2.linux-foundation.org
Cc: David Miller <davem@davemloft.net>, Netdev <netdev@vger.kernel.org>
Subject: Re: [RFC PATCH net-2.6] [TCP]: Congestion control API RTT sampling fix
Date: Tue, 12 Jun 2007 08:23:08 -0700	[thread overview]
Message-ID: <20070612082308.2e93f2c8@localhost> (raw)
In-Reply-To: <Pine.LNX.4.64.0706121500530.15358@kivilampi-30.cs.helsinki.fi>

On Tue, 12 Jun 2007 15:06:57 +0300 (EEST)
"Ilpo Järvinen" <ilpo.jarvinen@helsinki.fi> wrote:

> I was thinking something like this to fix the cc module breakage 
> introduced by the API change (haven't tested it besides compile):
> 
> 
> [RFC PATCH net-2.6] [TCP]: Congestion control API RTT sampling fix
> 
> 
> Commit 164891aadf1721fca4dce473bb0e0998181537c6 broke RTT
> sampling of congestion control modules. Inaccurate timestamps
> could be fed to them without providing any way for them to
> identify such cases. Previously RTT sampler was called only if
> FLAG_RETRANS_DATA_ACKED was not set filtering inaccurate
> timestamps nicely. In addition, the new behavior could give an
> invalid timestamp (zero) to RTT sampler if only skbs with
> TCPCB_RETRANS were ACKed. This solves both problems.
> 
> Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@helsinki.fi>
> ---
>  include/linux/ktime.h   |   18 ++++++++++++++++++
>  include/linux/skbuff.h  |    4 ++++
>  net/ipv4/tcp_illinois.c |    3 +++
>  net/ipv4/tcp_input.c    |    6 +++++-
>  net/ipv4/tcp_lp.c       |    3 ++-
>  net/ipv4/tcp_vegas.c    |    3 +++
>  net/ipv4/tcp_veno.c     |    3 +++
>  7 files changed, 38 insertions(+), 2 deletions(-)
> 
> diff --git a/include/linux/ktime.h b/include/linux/ktime.h
> index c762954..9f7fa3e 100644
> --- a/include/linux/ktime.h
> +++ b/include/linux/ktime.h
> @@ -102,6 +102,12 @@ static inline ktime_t ktime_set(const long secs, const unsigned long nsecs)
>  #define ktime_add_ns(kt, nsval) \
>  		({ (ktime_t){ .tv64 = (kt).tv64 + (nsval) }; })
>  
> +/* Compare two ktime_t variables, returns 1 if equal */
> +static inline int ktime_equal(const ktime_t cmp1, const ktime_t cmp2)
> +{
> +	return cmp1.tv64 == cmp2.tv64;
> +}
> +
>  /* convert a timespec to ktime_t format: */
>  static inline ktime_t timespec_to_ktime(struct timespec ts)
>  {
> @@ -200,6 +206,18 @@ static inline ktime_t ktime_add(const ktime_t add1, const ktime_t add2)
>  extern ktime_t ktime_add_ns(const ktime_t kt, u64 nsec);
>  
>  /**
> + * ktime_equal - Compares two ktime_t variables to see if they are equal
> + * @cmp1:	comparable1
> + * @cmp2:	comparable2
> + *
> + * Compare two ktime_t variables, returns 1 if equal
> + */
> +static inline int ktime_equal(const ktime_t cmp1, const ktime_t cmp2)
> +{
> +	return !((cmp1.tv.sec ^ cmp2.tv.sec) | (cmp1.tv.usec ^ cmp2.tv.usec));
> +}

Since ktime is a union just comparing the two 64bit values should
be simpler.

static inline int ktime_equal(const ktime_t t1, const ktime_t t2)
{
	return t1.s64 == t2.s64;
}


      reply	other threads:[~2007-06-12 15:28 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-06-12 12:06 [RFC PATCH net-2.6] [TCP]: Congestion control API RTT sampling fix Ilpo Järvinen
2007-06-12 15:23 ` Stephen Hemminger [this message]

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=20070612082308.2e93f2c8@localhost \
    --to=shemminger@linux-foundation.org \
    --cc="Ilpo =?UTF-8?B?SsOkcnZpbmVuIg==?= <ilpo.jarvinen@helsinki.fi>"@smtp2.linux-foundation.org \
    --cc=davem@davemloft.net \
    --cc=netdev@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).