net/iavf: fix Rx bytes stats
authorQi Zhang <qi.z.zhang@intel.com>
Wed, 17 Jul 2019 04:31:00 +0000 (12:31 +0800)
committerFerruh Yigit <ferruh.yigit@intel.com>
Tue, 23 Jul 2019 12:31:35 +0000 (14:31 +0200)
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 <qi.z.zhang@intel.com>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
drivers/net/iavf/iavf_ethdev.c

index 4836333..8f39073 100644 (file)
@@ -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");