From 15edfab79e48de2dd8be3d8793126a7692a34d61 Mon Sep 17 00:00:00 2001 From: Qi Zhang Date: Wed, 17 Jul 2019 12:31:00 +0800 Subject: [PATCH] net/iavf: fix Rx bytes stats Exclude 4 bytes CRC for rx bytes stats. This also aligned Rx stats calculation with PF. Fixes: f4a41a6953af ("net/avf: support stats") Cc: stable@dpdk.org Signed-off-by: Qi Zhang Acked-by: Stephen Hemminger --- drivers/net/iavf/iavf_ethdev.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/net/iavf/iavf_ethdev.c b/drivers/net/iavf/iavf_ethdev.c index 48363333a4..8f3907378c 100644 --- a/drivers/net/iavf/iavf_ethdev.c +++ b/drivers/net/iavf/iavf_ethdev.c @@ -1047,6 +1047,7 @@ iavf_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