net/ice/base: support reading REPC statistics
authorQi Zhang <qi.z.zhang@intel.com>
Thu, 29 Aug 2019 02:36:06 +0000 (10:36 +0800)
committerFerruh Yigit <ferruh.yigit@intel.com>
Mon, 7 Oct 2019 13:00:53 +0000 (15:00 +0200)
commit0f11bdc08f103b6f4843051418e2ee02251451c4
tree40f0845e145e0b4e3611e7f9706b011216c8e706
parentd13ad9cf1721cc84b4507c5e4ce96001155b9f4a
net/ice/base: support reading REPC statistics

The GLV_REPC register contains statistics for tracking received packets
that are discarded due to certain errors.

This register behaves differently from some of the other related
statistics registers in two ways. First, it contains two 16bit
statistics, and thus cannot be read as a 32bit or 40bit statistic.

Second, the two stats do not roll over, but instead cap at 0xFFFF.

Add a new ice_stat_update_repc function which will read the register and
increment the appropriate statistics in the ice_eth_stats structure.

Since the register does not roll over, make use of the "Write Clear"
behavior, and write to the register to reset it every time we read it.

Add extra space for the two statistics that are counted by this
register, rx_errors, and rx_no_desc.

For now, wrap the new function and stats counters in !LINUX_SUPPORT.
This can later be removed if and when the Linux driver implements
support for reading the statistics.

Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
Signed-off-by: Paul M Stillwell Jr <paul.m.stillwell.jr@intel.com>
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Xiaolong Ye <xiaolong.ye@intel.com>
drivers/net/ice/base/ice_common.c
drivers/net/ice/base/ice_common.h
drivers/net/ice/base/ice_type.h