From: Andrew Lunn <andrew@lunn.ch>
To: Florian Fainelli <f.fainelli@gmail.com>
Cc: David Miller <davem@davemloft.net>,
netdev <netdev@vger.kernel.org>,
hayeswang <hayeswang@realtek.com>,
Mario Limonciello <mario_limonciello@dell.com>
Subject: Re: [Patch RFC net-next] net: usb: r8152: Fix rx_bytes/tx_bytes to include FCS
Date: Thu, 18 May 2017 17:09:25 +0200 [thread overview]
Message-ID: <20170518150925.GB707@lunn.ch> (raw)
In-Reply-To: <286d107e-2380-f8e9-3edf-c949707ea235@gmail.com>
> I am afraid that we won't be able to enforce a consistent behavior,
> because the HW itself is not consistent, both on the NIC and on the
> switch side.
Hi Florian
I agree with that, for MIB counters. They tend to come direct from the
hardware.
However, rx_bytes and tx_bytes are not from the hardware. They are
software stats, kept by the drivers. Just grep in driver/net/ethernet
and you see:
broadcom/bcmsysport.c: ndev->stats.rx_bytes += len;
broadcom/sb1250-mac.c: dev->stats.rx_bytes += len;
mellanox/mlx5/core/en_main.c: s->rx_bytes += rq_stats->bytes;
microchip/encx24j600.c: dev->stats.rx_bytes += rsv->len;
neterion/vxge/vxge-main.c: net_stats->rx_bytes += bytes;
nuvoton/w90p910_ether.c: dev->stats.rx_bytes += length;
etc.
Since these are software counters, they can be consistent. From a
practical point of view, i doubt they ever will all be consistent,
there are simply too many drivers to test and change if
needed. However, for the ones somebody cares about, they can be made
consistent.
I care about r8152, and would like to make it consistent with asix,
dsa, e1000e.
Andrew
next prev parent reply other threads:[~2017-05-18 15:09 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-05-17 20:23 [Patch RFC net-next] net: usb: r8152: Fix rx_bytes/tx_bytes to include FCS Andrew Lunn
2017-05-17 22:28 ` Florian Fainelli
2017-05-18 15:09 ` Andrew Lunn [this message]
2017-05-18 15:22 ` David Miller
2017-05-18 17:00 ` Florian Fainelli
2017-05-18 17:33 ` Andrew Lunn
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170518150925.GB707@lunn.ch \
--to=andrew@lunn.ch \
--cc=davem@davemloft.net \
--cc=f.fainelli@gmail.com \
--cc=hayeswang@realtek.com \
--cc=mario_limonciello@dell.com \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).