net/iavf: fix Rx bytes stats
PATCH 1/1 net/iavf: fix Rx bytes stats
Exclude 4 bytes CRC for rx bytes stats.
This also aligned Rx stats calculation with PF.
--- drivers/net/iavf/iavf_ethdev.c | 1 + 1 file changed, 1 insertion(+)
drivers/net/iavf/iavf_ethdev.c +1 -0
@@ -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" );
Signature · 1 line
2.13.6
Quoted 16 lines · On Wed, 17 Jul 2019 12:31:00 +0800 Qi Zhang <[email protected]> wrote:
Exclude 4 bytes CRC for rx bytes stats.
This also aligned Rx stats calculation with PF.Fixes f4a41a6953af ("net/avf: support stats")Signed-off-by Qi Zhang <[email protected]>--- drivers/net/iavf/iavf_ethdev.c | 1 + 1 file changed, 1 insertion(+)drivers/net/iavf/iavf_ethdev.c +0
-0
drivers/net/iavf/iavf_ethdev.c iavf_dev_stats_get(struct rte_eth_dev *dev, struct rte_eth_stats *stats) · line 1053
Quoted 7 lines
drivers/net/iavf/iavf_ethdev.c +1
-0@@ -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" );
Correct, DPDK statistics should not include CRC.
Zhang, Qi Z
AppliedQuoted 40 lines
-----Original Message-----
From: Stephen Hemminger [mailto:[email protected]]
Sent: Wednesday, July 17, 2019 12:56 PM
To: Zhang, Qi Z <[email protected]>
Cc: Wu, Jingjing <[email protected]>; Lu, Wenzhuo <[email protected]>; [email protected]; [email protected]
Subject: Re: [dpdk-dev] [PATCH] net/iavf: fix Rx bytes statsdrivers/net/iavf/iavf_ethdev.c iavf_dev_stats_get(struct rte_eth_dev *dev,
Quoted 16 lines · On Wed, 17 Jul 2019 12:31:00 +0800 Qi Zhang <[email protected]> wrote:
Exclude 4 bytes CRC for rx bytes stats.
This also aligned Rx stats calculation with PF.Fixes f4a41a6953af ("net/avf: support stats")Signed-off-by Qi Zhang <[email protected]>--- drivers/net/iavf/iavf_ethdev.c | 1 + 1 file changed, 1 insertion(+)(quoted diff) +0
-0
b/drivers/net/iavf/iavf_ethdev.cindex53dc05c78..fe75e86ab100644drivers/net/iavf/iavf_ethdev.c +0
-0@@ -1047,6 +1047,7 @@ iavf_dev_stats_get(struct rte_eth_dev *dev,struct
rte_eth_stats*stats)drivers/net/iavf/iavf_ethdev.c iavf_dev_stats_get(struct rte_eth_dev *dev, struct rte_eth_stats *stats) · line 1053
Quoted 7 lines
drivers/net/iavf/iavf_ethdev.c +1
-0stats->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" );Correct, DPDK statistics should not include CRC.
Quoted 1 line
Applied to dpdk-next-net-intel.
Thanks
Qi
Quoted 14 lines · Stephen Hemminger
Quoted 11 lines · On Wed, 17 Jul 2019 12:31:00 +0800 Qi Zhang <[email protected]> wrote:
Exclude 4 bytes CRC for rx bytes stats.
This also aligned Rx stats calculation with PF.Fixes f4a41a6953af ("net/avf: support stats")Signed-off-by Qi Zhang <[email protected]>--- drivers/net/iavf/iavf_ethdev.c | 1 + 1 file changed, 1 insertion(+)
Quoted 13 lines
drivers/net/iavf/iavf_ethdev.c iavf_dev_stats_get(struct rte_eth_dev *dev, struct rte_eth_stats *stats) · line 1053
Quoted 12 lines
drivers/net/iavf/iavf_ethdev.c +1
-0@@ -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" );Correct, DPDK statistics should not include CRC.
Stephen, Thomas, Ferruh,
is it documented somewhere? May be we should update fields description and rte_eth_stats_get() which mentions these fields as well to highlight it?
Thanks,
Andrew.