[Top] [All Lists]

Re: Zeroing interface stats?

To: Jeff Garzik <jgarzik@xxxxxxxxxxxxxxxx>
Subject: Re: Zeroing interface stats?
From: Ben Greear <greearb@xxxxxxxxxxxxxxx>
Date: Mon, 05 Mar 2001 19:43:14 -0700
Cc: netdev@xxxxxxxxxxx, linux-net@xxxxxxxxxxxxxxxx
Organization: Candela Technologies
References: <>
Sender: owner-netdev@xxxxxxxxxxx
Jeff Garzik wrote:
> Just spotted this code in acenic.c.  Should it be carried over to other
> net drivers?
> static int ace_open(struct net_device *dev)
> {
> [...]
>         /*
>          * Zero the stats when restarting the interface...
>          */
>         memset(&ap->stats, 0, sizeof(ap->stats));
> --
> Jeff Garzik       | "You see, in this world there's two kinds of
> Building 1024     |  people, my friend: Those with loaded guns
> MandrakeSoft      |  and those who dig. You dig."  --Blondie

Well, sounds like a pretty good idea, but I know it will break
at least one piece of code I've written because I assume the
(measly) 32-bit counters have wrapped if the current value is less
than the last value read...)

Now, if someone wanted to go make sure all counters were 64-bit, then
that would be cool :)

Of course, I can probably figure a way to re-write my code...but
I can't think of a concise way offhand...


Ben Greear (greearb@xxxxxxxxxxxxxxx)
Author of ScryMUD: 4444        (Released under GPL)     

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