netdev
[Top] [All Lists]

Re: netdev.stats change suggestion

To: kuznet@xxxxxxxxxxxxx
Subject: Re: netdev.stats change suggestion
From: Donald Becker <becker@xxxxxxxxx>
Date: Fri, 25 Jan 2002 17:01:02 -0500 (EST)
Cc: Martin Devera <devik@xxxxxx>, davem@xxxxxxxxxx, netdev@xxxxxxxxxxx
In-reply-to: <200201251819.VAA27489@ms2.inr.ac.ru>
Sender: owner-netdev@xxxxxxxxxxx
On Fri, 25 Jan 2002 kuznet@xxxxxxxxxxxxx wrote:

> > By the way I don't see how you get over wraparound problem.
> 
> It needs sampling each sevral seconds to calculate rates,
> so that the problem just does not exist. 

This bears repeating: normal-path network
statistics should be used to calculate rates, not absolute values.
Think 'jiffies'.  As a human you might interpret a value as "time since
boot" or "number of packets since boot" because you have extra
knowledge, but a program shouldn't make this assumption.

Error counts are a different beast: there you might want to know the
absolute count.  But no one expects these to approach 32 bit overflow.

> Well, this attitude has grown as a kind of physiological reaction to
> proposals sort of adding to struct net_device a Cisco-like
> "interface desription" string.

Oooohhh, lets have a /proc/* file that describes the system in text.  An
entire book, with only occasional dynamic values.

I do agree with the proposal to add to /proc/net/*
    New per-interface statistics files that have only decimal numbers
       A program that is only interested in one interface won't trigger
       re-reads of all interfaces.
    A new (static, read-once) file that describes contains text field labels 

The idea to mmap() that statistics file has issues:
   We need a timestamp for the reader
   We need a way for the reader to trigger a hardware update
     (Currently reading /proc/net/dev does this.)
   We might need a mechanism so that multiple readers can read
     stable/synchronized values.

> Counter wrapping is pseudoproblem of the same nature.
> What will change if netstat will show numbers sort of 761586014605217?
> 
> The next step is: "Oh, well, I want to clear them!"
>
> And this will not pass. Clearing kernel counters is hard bug,
> which makes impossible interaction to multiple information consumers.

I used to get a zillion requests (and patches) to clear the counters.
The "multiple readers" answer is the most easily understood response to
this FRF (Frequently Requested mis-Feature).

Donald Becker                           becker@xxxxxxxxx
Scyld Computing Corporation             http://www.scyld.com
410 Severn Ave. Suite 210               Second Generation Beowulf Clusters
Annapolis MD 21403                      410-990-9993




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