From: Alvin Zhang Date: Tue, 15 Dec 2020 09:50:59 +0000 (+0800) Subject: net/i40e: fix Rx bytes statistics X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=e8326d35d14406df936164bbac171563555a888b;p=dpdk.git 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 --- 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");