[v1,03/38] net/mvpp2: fix rx/tx bytes statistics

Message ID 20201202101212.4717-4-lironh@marvell.com (mailing list archive)
State Superseded, archived
Delegated to: Jerin Jacob
Headers
Series net/mvpp2: misc updates |

Checks

Context Check Description
ci/checkpatch success coding style OK

Commit Message

Liron Himi Dec. 2, 2020, 10:11 a.m. UTC
  From: Yuri Chipchev <yuric@marvell.com>

4B of CRC was not included in the bytes statistics

Fixes: bdffe0c70 ("net/mrvl: support basic stats")
Cc: stable@dpdk.org

Signed-off-by: Yuri Chipchev <yuric@marvell.com>
Reviewed-by: Liron Himi <lironh@marvell.com>
---
 drivers/net/mvpp2/mrvl_ethdev.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
  

Comments

Michael Shamis Dec. 23, 2020, 9:43 a.m. UTC | #1
Reviewed-by: Michael Shamis <michaelsh@marvell.com>

-----Original Message-----
From: dev <dev-bounces@dpdk.org> On Behalf Of lironh@marvell.com
Sent: Wednesday, December 2, 2020 12:12 PM
To: Jerin Jacob Kollanukkaran <jerinj@marvell.com>
Cc: dev@dpdk.org; Yuri Chipchev <yuric@marvell.com>; stable@dpdk.org; Liron Himi <lironh@marvell.com>
Subject: [dpdk-dev] [PATCH v1 03/38] net/mvpp2: fix rx/tx bytes statistics

From: Yuri Chipchev <yuric@marvell.com>

4B of CRC was not included in the bytes statistics

Fixes: bdffe0c70 ("net/mrvl: support basic stats")
Cc: stable@dpdk.org

Signed-off-by: Yuri Chipchev <yuric@marvell.com>
Reviewed-by: Liron Himi <lironh@marvell.com>
---
 drivers/net/mvpp2/mrvl_ethdev.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/mvpp2/mrvl_ethdev.c b/drivers/net/mvpp2/mrvl_ethdev.c index 8c3278ec4..ebd2bb1c8 100644
--- a/drivers/net/mvpp2/mrvl_ethdev.c
+++ b/drivers/net/mvpp2/mrvl_ethdev.c
@@ -1278,7 +1278,6 @@ mrvl_stats_get(struct rte_eth_dev *dev, struct rte_eth_stats *stats)
 				       rx_stats.drop_fullq +
 				       rx_stats.drop_bm +
 				       rxq->drop_mac;
-		stats->ibytes += rxq->bytes_recv;
 		drop_mac += rxq->drop_mac;
 	}
 
@@ -1306,7 +1305,6 @@ mrvl_stats_get(struct rte_eth_dev *dev, struct rte_eth_stats *stats)
 
 		stats->q_opackets[idx] = tx_stats.deq_desc;
 		stats->q_obytes[idx] = txq->bytes_sent;
-		stats->obytes += txq->bytes_sent;
 	}
 
 	ret = pp2_ppio_get_statistics(priv->ppio, &ppio_stats, 0); @@ -1315,6 +1313,8 @@ mrvl_stats_get(struct rte_eth_dev *dev, struct rte_eth_stats *stats)
 		return ret;
 	}
 
+	stats->ibytes += ppio_stats.rx_bytes;
+	stats->obytes += ppio_stats.tx_bytes;
 	stats->ipackets += ppio_stats.rx_packets - drop_mac;
 	stats->opackets += ppio_stats.tx_packets;
 	stats->imissed += ppio_stats.rx_fullq_dropped +
--
2.28.0
  

Patch

diff --git a/drivers/net/mvpp2/mrvl_ethdev.c b/drivers/net/mvpp2/mrvl_ethdev.c
index 8c3278ec4..ebd2bb1c8 100644
--- a/drivers/net/mvpp2/mrvl_ethdev.c
+++ b/drivers/net/mvpp2/mrvl_ethdev.c
@@ -1278,7 +1278,6 @@  mrvl_stats_get(struct rte_eth_dev *dev, struct rte_eth_stats *stats)
 				       rx_stats.drop_fullq +
 				       rx_stats.drop_bm +
 				       rxq->drop_mac;
-		stats->ibytes += rxq->bytes_recv;
 		drop_mac += rxq->drop_mac;
 	}
 
@@ -1306,7 +1305,6 @@  mrvl_stats_get(struct rte_eth_dev *dev, struct rte_eth_stats *stats)
 
 		stats->q_opackets[idx] = tx_stats.deq_desc;
 		stats->q_obytes[idx] = txq->bytes_sent;
-		stats->obytes += txq->bytes_sent;
 	}
 
 	ret = pp2_ppio_get_statistics(priv->ppio, &ppio_stats, 0);
@@ -1315,6 +1313,8 @@  mrvl_stats_get(struct rte_eth_dev *dev, struct rte_eth_stats *stats)
 		return ret;
 	}
 
+	stats->ibytes += ppio_stats.rx_bytes;
+	stats->obytes += ppio_stats.tx_bytes;
 	stats->ipackets += ppio_stats.rx_packets - drop_mac;
 	stats->opackets += ppio_stats.tx_packets;
 	stats->imissed += ppio_stats.rx_fullq_dropped +