From: Stephen Hemminger <stephen@networkplumber.org>
To: <Bryan.Whitehead@microchip.com>
Cc: <netdev@vger.kernel.org>, <davem@davemloft.net>,
<UNGLinuxDriver@microchip.com>
Subject: Re: [PATCH net-next 1/3] Add LAN743X driver
Date: Fri, 11 Aug 2017 16:05:32 -0700 [thread overview]
Message-ID: <20170811160532.6a35b3b2@xeon-e3> (raw)
In-Reply-To: <90A7E81AE28BAE4CBDDB3B35F187D264406F603F@CHN-SV-EXMX02.mchp-main.com>
On Fri, 11 Aug 2017 19:47:57 +0000
<Bryan.Whitehead@microchip.com> wrote:
> +
> +static struct net_device_stats *mac_get_stats(struct lan743x_adapter *adapter)
> +{
> + struct lan743x_mac *mac = &adapter->mac;
> +
> + memset(&mac->statistics, 0, sizeof(mac->statistics));
> + mac->statistics.rx_packets = lan743x_csr_read(adapter,
> + STAT_RX_TOTAL_FRAMES);
> + mac->statistics.tx_packets = lan743x_csr_read(adapter,
> + STAT_TX_TOTAL_FRAMES);
> + return &mac->statistics;
> +}
The statistics code here is confused.
You are already counting rx_packets in software in napi_poll
Then you get values from MAC. One or the other?
There are two copies of stats, one in netdev and other in your mac structure.
Also what about byte and error counts?
If possible implement 64 bit get_stats64 instead.
next prev parent reply other threads:[~2017-08-11 23:05 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-08-11 19:47 [PATCH net-next 1/3] Add LAN743X driver Bryan.Whitehead
2017-08-11 22:12 ` David Miller
2017-08-11 22:34 ` Andrew Lunn
2017-08-14 16:13 ` Bryan.Whitehead
2017-08-14 16:12 ` Bryan.Whitehead
2017-08-11 22:31 ` Andrew Lunn
2017-08-11 22:49 ` Stephen Hemminger
2017-08-11 22:50 ` Stephen Hemminger
2017-08-11 22:52 ` Stephen Hemminger
2017-08-11 22:57 ` Stephen Hemminger
2017-08-11 22:59 ` Stephen Hemminger
2017-08-11 23:05 ` Stephen Hemminger [this message]
2017-08-14 16:15 ` Bryan.Whitehead
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=20170811160532.6a35b3b2@xeon-e3 \
--to=stephen@networkplumber.org \
--cc=Bryan.Whitehead@microchip.com \
--cc=UNGLinuxDriver@microchip.com \
--cc=davem@davemloft.net \
--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