Brent Cook wrote:
Note that this is just clearing the hardware statistics on the interface, and
would not require any kind of atomic_increment addition for interfaces that
support that. It would be kind-of awkward to implement this on drivers that
increment stats in hardware though (lo, vlan, br, etc.) This also brings up
the question of resetting the stats for 'netstat -s'
If you don't atomically clear the statistics, then you are leaving open
a window where the stats could easily be corrupted, if the network
interface is under load.
This 'clearing' operation has implications on the rest of the statistics
usage.
More complexity, and breaking of apps, when we could just use the
existing, working system? I'll take the "do nothing, break nothing,
everything still works" route any day.
What would be great is if ifconfig, netstat and their ilk just had a -z flag
instead. This would write a file to the local user's home directory with a
stats snapshot, and then every subsequent run would auto-calculate against
the snapshot. You'd also need some way of resetting this when the stats
actually _do_ reset (driver reload, reboot.) to avoid negative numbers.
That way, you can get what you want without having to write a bunch of
fragile, awkward scripts, and the kernel isn't throwing away information
either.
See... this opens doors to tons of complexity.
Jeff
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at http://vger.kernel.org/majordomo-info.html