Skip to contentSkip to conversation

net/mana: fix incorrectly reported counters in stats

PATCH Applied [email protected] 2 participants 2 messages Feb 22, 2023 – Mar 1, 2023 Network drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net/mana: fix incorrectly reported counters in stats

From: Long Li <[email protected]>

For per port counters and we should report summed values from all queues.

---
 drivers/net/mana/mana.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)
drivers/net/mana/mana.c +6 -6
index 43221e743e..8a782c0d63 100644
@@ -616,9 +616,9 @@ mana_dev_stats_get(struct rte_eth_dev *dev, struct rte_eth_stats *stats)
 		if (!txq)
 			continue;
 
-		stats->opackets = txq->stats.packets;
-		stats->obytes = txq->stats.bytes;
-		stats->oerrors = txq->stats.errors;
+		stats->opackets += txq->stats.packets;
+		stats->obytes += txq->stats.bytes;
+		stats->oerrors += txq->stats.errors;
 
 		if (i < RTE_ETHDEV_QUEUE_STAT_CNTRS) {
 			stats->q_opackets[i] = txq->stats.packets;
@@ -633,9 +633,9 @@ mana_dev_stats_get(struct rte_eth_dev *dev, struct rte_eth_stats *stats)
 		if (!rxq)
 			continue;
 
-		stats->ipackets = rxq->stats.packets;
-		stats->ibytes = rxq->stats.bytes;
-		stats->ierrors = rxq->stats.errors;
+		stats->ipackets += rxq->stats.packets;
+		stats->ibytes += rxq->stats.bytes;
+		stats->ierrors += rxq->stats.errors;
 
 		/* There is no good way to get stats->imissed, not setting it */
 
Signature · 1 line
2.32.0
Acked-by on v1 1/1 Applied
#1 lore raw
Quoted 5 lines · On 2/22/2023 11:27 PM, [email protected] wrote:

From: Long Li <[email protected]>

For per port counters and we should report summed values from all queues.

    Fixes: e350b56889bb ("net/mana: report queue statistics")
    Cc: [email protected]
Quoted 1 line

Applied to dpdk-next-net/main, thanks.

It seems this issue commented on v4 [1], fixed in v5 [1], but issue crept in back in next versions resulting it to be merged.

[1]
https://inbox.dpdk.org/dev/[email protected]/

[2]
https://inbox.dpdk.org/dev/[email protected]/