net/igc: fix Rx error counter for bad length
authorAlvin Zhang <alvinx.zhang@intel.com>
Thu, 1 Apr 2021 05:20:43 +0000 (13:20 +0800)
committerQi Zhang <qi.z.zhang@intel.com>
Thu, 1 Apr 2021 07:47:35 +0000 (09:47 +0200)
When the size of a packet in Rx channel is less than the minimum
or greater than the maximum, the packet will be simultaneously
counted by RLEC(Receive Length Error Count) and
RUC(Receive Under Size Count)/ROC(Receive Oversize Count) registers.

This patch fixes the issue of counting a length error packet twice
when counting the total number of received error packets.

Fixes: e6defdfddc3b ("net/igc: enable statistics")
Cc: stable@dpdk.org
Signed-off-by: Alvin Zhang <alvinx.zhang@intel.com>
Acked-by: Haiyue Wang <haiyue.wang@intel.com>
drivers/net/igc/igc_ethdev.c

index 17dd8bf..31c99dc 100644 (file)
@@ -1904,8 +1904,7 @@ eth_igc_stats_get(struct rte_eth_dev *dev, struct rte_eth_stats *rte_stats)
 
        /* Rx Errors */
        rte_stats->imissed = stats->mpc;
-       rte_stats->ierrors = stats->crcerrs +
-                       stats->rlec + stats->ruc + stats->roc +
+       rte_stats->ierrors = stats->crcerrs + stats->rlec +
                        stats->rxerrc + stats->algnerrc;
 
        /* Tx Errors */