netdev
[Top] [All Lists]

Re: [PATCH] New Patch: Implementation for IPv6 MIB:ipv6AddressTable

To: Shirley Ma <mashirle@xxxxxxxxxx>
Subject: Re: [PATCH] New Patch: Implementation for IPv6 MIB:ipv6AddressTable
From: "David S. Miller" <davem@xxxxxxxxxx>
Date: Fri, 10 Oct 2003 00:04:13 -0700
Cc: kuznet@xxxxxxxxxxxxx, netdev@xxxxxxxxxxx, yoshfuji@xxxxxxxxxxxxxx
In-reply-to: <200310091317.35164.mashirle@xxxxxxxxxx>
References: <OF4B7AD7E2.5CA239A1-ON87256DB9.0067C527@xxxxxxxxxx> <20031008130016.559b8047.davem@xxxxxxxxxx> <200310081706.09485.mashirle@xxxxxxxxxx> <200310091317.35164.mashirle@xxxxxxxxxx>
Sender: netdev-bounce@xxxxxxxxxxx
On Thu, 9 Oct 2003 13:17:35 -0700
Shirley Ma <mashirle@xxxxxxxxxx> wrote:

> 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);

Why are you using jiffies for timestamps?  I guess these values
are measured "since bootup" or something like that?

Anyways, I prefer the "too much math" because 1) it isn't a lot of
math, most of these things are constants which make the expressions
easy to compute 2) it's only done when someone asks for the information.

<Prev in Thread] Current Thread [Next in Thread>