From: Radoslaw Tyl <radoslawx....@intel.com>

The global rx error does not take into account all the error counters
that are counted by device.

Extend rx error with the following counters:
- illegal byte error
- number of receive fragment errors
- receive jabber
- receive oversize error
- receive undersize error
- frames marked as checksum invalid by hardware

The above were added in order to align statistics with other products.

Signed-off-by: Radoslaw Tyl <radoslawx....@intel.com>
Tested-by: Tony Brelinski <tonyx.brelin...@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.ngu...@intel.com>
---
 drivers/net/ethernet/intel/ixgbe/ixgbe_main.c | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c 
b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
index 7ba1c2985ef7..7711828401d9 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
@@ -7240,12 +7240,21 @@ void ixgbe_update_stats(struct ixgbe_adapter *adapter)
        hwstats->ptc1023 += IXGBE_READ_REG(hw, IXGBE_PTC1023);
        hwstats->ptc1522 += IXGBE_READ_REG(hw, IXGBE_PTC1522);
        hwstats->bptc += IXGBE_READ_REG(hw, IXGBE_BPTC);
+       hwstats->illerrc += IXGBE_READ_REG(hw, IXGBE_ILLERRC);
 
        /* Fill out the OS statistics structure */
        netdev->stats.multicast = hwstats->mprc;
 
        /* Rx Errors */
-       netdev->stats.rx_errors = hwstats->crcerrs + hwstats->rlec;
+       netdev->stats.rx_errors = hwstats->crcerrs +
+                                   hwstats->illerrc +
+                                   hwstats->rlec +
+                                   hwstats->rfc +
+                                   hwstats->rjc +
+                                   hwstats->roc +
+                                   hwstats->ruc +
+                                   hw_csum_rx_error;
+
        netdev->stats.rx_dropped = 0;
        netdev->stats.rx_length_errors = hwstats->rlec;
        netdev->stats.rx_crc_errors = hwstats->crcerrs;
-- 
2.26.2

Reply via email to