On Fri, 11 Aug 2017 19:47:57 +0000
<bryan.whiteh...@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.

Reply via email to