netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Shirley Ma <mashirle@us.ibm.com>
To: "David S. Miller" <davem@redhat.com>, kuznet@ms2.inr.ac.ru
Cc: netdev@oss.sgi.com, yoshfuji@linux-ipv6.org
Subject: Re: [PATCH] New Patch: Implementation for IPv6 MIB:ipv6AddressTable
Date: Thu, 9 Oct 2003 13:17:35 -0700	[thread overview]
Message-ID: <200310091317.35164.mashirle@us.ibm.com> (raw)
In-Reply-To: <200310081706.09485.mashirle@us.ibm.com>

Hi, David,

There is possible loss of precision in the new patch for the timestamp. I have 
two solutions. 

Which one do you think is better.

This one is too much math.

ci.cstamp = (__u32)(TIME_DELTA(ifa->cstamp, INITIAL_JIFFIES) / HZ * 100
		  + TIME_DELTA(ifa->cstamp, INITIAL_JIFFIES) % HZ * 100 / HZ);
ci.tstamp = (__u32)(TIME_DELTA(ifa->tstamp, INITIAL_JIFFIES) / HZ * 100
		  + TIME_DELTA(ifa->tstamp, INITIAL_JIFFIES) % HZ * 100 / HZ);

This one might overflow.

ci.cstamp = (__u32)(TIME_DELTA(ifa->cstamp, INITIAL_JIFFIES) *100 ) / HZ;
ci.tstamp = (__u32)(TIME_DELTA(ifa->tstamp, INITIAL_JIFFIES) * 100) / HZ;

Thanks
Shirley Ma
IBM Linux Technology Center
--------------------------------------------

  reply	other threads:[~2003-10-09 20:17 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-10-08 18:55 [PATCH] Implementation for IPv6 MIB:ipv6AddressTable Shirley Ma
2003-10-08 20:00 ` David S. Miller
2003-10-09  0:06   ` [PATCH] New Patch: " Shirley Ma
2003-10-09 20:17     ` Shirley Ma [this message]
2003-10-10  7:04       ` David S. Miller
2003-10-14 17:38     ` Shirley Ma
2003-10-14 22:25       ` David S. Miller
2003-10-16  5:37       ` David S. Miller
2003-10-16 16:56         ` Shirley Ma
2003-10-16 23:29           ` David S. Miller
  -- strict thread matches above, loose matches on Subject: below --
2003-10-10 21:42 Shirley Ma

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=200310091317.35164.mashirle@us.ibm.com \
    --to=mashirle@us.ibm.com \
    --cc=davem@redhat.com \
    --cc=kuznet@ms2.inr.ac.ru \
    --cc=netdev@oss.sgi.com \
    --cc=yoshfuji@linux-ipv6.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).