Subject: Re: [PATCH net-next v2] net: mvpp2: add ethtool GOP statistics

From: Miquel RAYNAL <[email-masked]>
Date: Fri, 3 Nov 2017 12:26:22 +0100

On Fri,  3 Nov 2017 12:04:25 +0100
Miquel Raynal <[email-masked]> 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 <[email-masked]>
> Signed-off-by: Miquel Raynal <[email-masked]>
> ---

Changes since v1:
- Constified the ethtool array (with strings and offset) and added a
  third parameter to the repeated structure: if the register is 64-bit
  wide.
- Added locking inside the mvpp2_gather_stats() to avoid starting
  reading the registers while a read is already pending.
- Used devm_* allocators.
- Switched to cancel_delayed_work_sync().
- Fixed the size allocated to the statistics array.
- Added an index to the workqueue name, derived with IDA because the
  name shown in 'ps' is only 15 chars wide (so must be short) and there
  was no existing way to retrieve a unique number per engine instance.
- Start gathering the statistics only in ndo_start(), stop in
  ndo_stop().

Best regards,
Miquèl