Subject: Re: [PATCH] net: reset network device counters on the fly

From: Rick Jones <[email-masked]>
Date: Tue, 06 Jan 2009 18:29:45 -0800

Huascar Tejeda wrote:
> Hello everyone,
> 
> This is my first post to the mailing list and also my first kernel patch.
> 
> There was an scenario where I needed to clear network device counters
> without shutting down the interface.
> With this patch I add this functionality to /proc/net/dev.
> 
> Usage example:
> echo clear eth0 > /proc/net/dev
> echo clear all > /proc/net/dev
> 
> Thanks for your comments and please feel free to reply with any
> suggestions you may have.

Having been at least once bitten as a patch submittor, I'll point-out 
that patches are generally requested to be inline, not attachments. 
Also, in any kernel tree there should be a file describing how a patch 
should be put together and what addtional bits of information need to be 
included.  That file is ./Documentation/SubmittingPatches.

Finally, my recollection is this same sort of thing (zeroing counters) 
has been proposed before, and shot-down.  Doesn't a priori mean it will 
be shot-down this time, but it suggests the chances are slim.  You can 
probably find the discussion in one or more of the various archives for 
the netdev list.  For those situations where you want to know the 
statistics for a given interval, you can snap the stats to files at 
either end of the interval and run them through "beforeafter" or 
something similar:

http://ftp.cup.hp.com/dist/networking/tools/

rick jones
wondering what has become of his ethtool patch to recognize speeds other 
than 10/100/1000/10000... perhaps it too tripped over some of the above :(