netdev
[Top] [All Lists]

Re: How to count tx and rx bytes?

To: "David S. Miller" <davem@xxxxxxxxxx>
Subject: Re: How to count tx and rx bytes?
From: Ben Greear <greearb@xxxxxxxxxxxxxxx>
Date: Mon, 15 Dec 2003 15:17:29 -0800
Cc: netdev@xxxxxxxxxxx
In-reply-to: <20031215145422.58a78551.davem@xxxxxxxxxx>
Organization: Candela Technologies
References: <3FDE13AE.3050402@xxxxxxxxxxxxxxx> <20031215141729.15387fc1.davem@xxxxxxxxxx> <3FDE39E3.4000408@xxxxxxxxxxxxxxx> <20031215145422.58a78551.davem@xxxxxxxxxx>
Sender: netdev-bounce@xxxxxxxxxxx
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.5) Gecko/20031007
David S. Miller wrote:
On Mon, 15 Dec 2003 14:46:59 -0800
Ben Greear <greearb@xxxxxxxxxxxxxxx> wrote:


Maybe the stats-polling code in the driver could do the necessary subtraction
to remove the FCS from the results (ie, subtract (packets-since-last-sample * 
4) bytes.


The whole reason to use the chip internally computed stats is to avoid
having to do "stats->foo++" at all, your suggestion basically eliminates
this purpose.

Well, I was assuming that the stats polling is a fixed cost O(1), where-as the 
per-packet
calculation is O(n).  I am quite sure this assumption is true for e1000,
but I have not looked at tg3.  So, for e1000, the cost of subtracting out the 
FCS
would be basically free.

All that said, from Randy's email, it appears we should be including the FCS
anyway...

Ben

--
Ben Greear <greearb@xxxxxxxxxxxxxxx>
Candela Technologies Inc  http://www.candelatech.com



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