net/i40e: fix Rx bytes statistics
authorAlvin Zhang <alvinx.zhang@intel.com>
Tue, 15 Dec 2020 09:50:59 +0000 (17:50 +0800)
committerFerruh Yigit <ferruh.yigit@intel.com>
Fri, 8 Jan 2021 15:03:06 +0000 (16:03 +0100)
Update the Rx-bytes statistics by subtract CRC bytes count from original
bytes count.

Fixes: bd7883c07d4a ("net/i40e: refactor some stats related functions")
Cc: stable@dpdk.org
Signed-off-by: Alvin Zhang <alvinx.zhang@intel.com>
Tested-by: Jun W Zhou <junx.w.zhou@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
drivers/net/i40e/i40e_ethdev_vf.c

index 2faee1d..dc076ae 100644 (file)
@@ -2416,6 +2416,7 @@ i40evf_dev_stats_get(struct rte_eth_dev *dev, struct rte_eth_stats *stats)
                stats->imissed = pstats->rx_discards;
                stats->oerrors = pstats->tx_errors + pstats->tx_discards;
                stats->ibytes = pstats->rx_bytes;
+               stats->ibytes -= stats->ipackets * RTE_ETHER_CRC_LEN;
                stats->obytes = pstats->tx_bytes;
        } else {
                PMD_DRV_LOG(ERR, "Get statistics failed");