[dpdk-dev] [PATCH] net/i40e: fix Rx-bytes statistics
Zhou, JunX W
junx.w.zhou at intel.com
Fri Dec 18 08:17:59 CET 2020
Tested-by: Zhou, Jun <junx.w.zhou at intel.com>
-----Original Message-----
From: dev [mailto:dev-bounces at dpdk.org] On Behalf Of Zhang,Alvin
Sent: Tuesday, December 15, 2020 5:51 PM
To: Guo, Jia <jia.guo at intel.com>; Xing, Beilei <beilei.xing at intel.com>
Cc: dev at dpdk.org; Zhang, AlvinX <alvinx.zhang at intel.com>; stable at dpdk.org
Subject: [dpdk-dev] [PATCH] net/i40e: fix Rx-bytes statistics
From: Alvin Zhang <alvinx.zhang at intel.com>
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 at dpdk.org
Signed-off-by: Alvin Zhang <alvinx.zhang at intel.com>
---
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 c26b036..b82e782 100644
--- a/drivers/net/i40e/i40e_ethdev_vf.c
+++ b/drivers/net/i40e/i40e_ethdev_vf.c
@@ -2406,6 +2406,7 @@ static int eth_i40evf_pci_remove(struct rte_pci_device *pci_dev)
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");
--
1.8.3.1
More information about the dev
mailing list