From e8326d35d14406df936164bbac171563555a888b Mon Sep 17 00:00:00 2001 From: Alvin Zhang Date: Tue, 15 Dec 2020 17:50:59 +0800 Subject: [PATCH] net/i40e: fix Rx bytes statistics 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 Tested-by: Jun W Zhou Acked-by: Qi Zhang --- drivers/net/i40e/i40e_ethdev_vf.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/net/i40e/i40e_ethdev_vf.c b/drivers/net/i40e/i40e_ethdev_vf.c index 2faee1d7e1..dc076ae552 100644 --- a/drivers/net/i40e/i40e_ethdev_vf.c +++ b/drivers/net/i40e/i40e_ethdev_vf.c @@ -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"); -- 2.20.1