Re: [PATCH] net: mvpp2: add ethtool GOP statistics

2017-11-03 Thread Miquel RAYNAL
Hi Florian, > > +static u64 mvpp2_read_count(struct mvpp2_port *port, unsigned int > > offset) +{ > > + bool reg_is_64b = > > + (offset == MVPP2_MIB_GOOD_OCTETS_RCVD_LOW) || > > + (offset == MVPP2_MIB_GOOD_OCTETS_SENT_LOW); > > This does not scale very well, put that in yo

Re: [PATCH] net: mvpp2: add ethtool GOP statistics

2017-11-03 Thread Miquel RAYNAL
Hi Andrew, Thanks for the review, I forgot to mention this is for net-next, I'll fix the subject line when sending the v2. > > +static struct mvpp2_ethtool_statistics mvpp2_ethtool_stats[] = { > > This can probably be const, and save a few bytes of RAM. Absolutely. > > > + { MVPP2_MIB_GOO

Re: [PATCH] net: mvpp2: add ethtool GOP statistics

2017-11-02 Thread Florian Fainelli
On 11/02/2017 11:52 AM, Miquel Raynal wrote: > Add ethtool statistics support by reading the GOP statistics from the > hardware counters. Also implement a workqueue to gather the statistics > every second or some 32-bit counters could overflow. > > Suggested-by: Stefan Chulski > Signed-off-by: Mi

Re: [PATCH] net: mvpp2: add ethtool GOP statistics

2017-11-02 Thread Andrew Lunn
Hi Miquel > +static struct mvpp2_ethtool_statistics mvpp2_ethtool_stats[] = { This can probably be const, and save a few bytes of RAM. > + { MVPP2_MIB_GOOD_OCTETS_RCVD_LOW, "good_octets_received" }, > + { MVPP2_MIB_BAD_OCTETS_RCVD, "bad_octets_received" }, > + { MVPP2_MIB_CRC_ERRORS_

[PATCH] net: mvpp2: add ethtool GOP statistics

2017-11-02 Thread Miquel Raynal
Add ethtool statistics support by reading the GOP statistics from the hardware counters. Also implement a workqueue to gather the statistics every second or some 32-bit counters could overflow. Suggested-by: Stefan Chulski Signed-off-by: Miquel Raynal --- drivers/net/ethernet/marvell/mvpp2.c |