net/mana: fix incorrectly reported counters in stats

Message ID 1677108444-17072-1-git-send-email-longli@linuxonhyperv.com (mailing list archive)
State Accepted, archived
Delegated to: Ferruh Yigit
Headers
Series net/mana: fix incorrectly reported counters in stats |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/loongarch-compilation success Compilation OK
ci/loongarch-unit-testing success Unit Testing PASS
ci/iol-broadcom-Functional success Functional Testing PASS
ci/iol-mellanox-Performance success Performance Testing PASS
ci/Intel-compilation success Compilation OK
ci/iol-broadcom-Performance success Performance Testing PASS
ci/iol-intel-Functional success Functional Testing PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/github-robot: build success github build: passed
ci/intel-Testing success Testing PASS
ci/iol-testing success Testing PASS
ci/iol-x86_64-unit-testing success Testing PASS
ci/iol-x86_64-compile-testing success Testing PASS
ci/iol-abi-testing success Testing PASS

Commit Message

Long Li Feb. 22, 2023, 11:27 p.m. UTC
  From: Long Li <longli@microsoft.com>

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

Cc: stable@dpdk.org
Signed-off-by: Long Li <longli@microsoft.com>
---
 drivers/net/mana/mana.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)
  

Comments

Ferruh Yigit March 1, 2023, 12:15 a.m. UTC | #1
On 2/22/2023 11:27 PM, longli@linuxonhyperv.com wrote:
> From: Long Li <longli@microsoft.com>
> 
> For per port counters and we should report summed values from all queues.
> 
> Cc: stable@dpdk.org

    Fixes: e350b56889bb ("net/mana: report queue statistics")
    Cc: stable@dpdk.org

> Signed-off-by: Long Li <longli@microsoft.com>

Acked-by: Ferruh Yigit <ferruh.yigit@amd.com>


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/9fc85998-0802-f1f4-fa97-86114a511e76@xilinx.com/

[2]
https://inbox.dpdk.org/dev/1661560509-11009-18-git-send-email-longli@linuxonhyperv.com/
  

Patch

diff --git a/drivers/net/mana/mana.c b/drivers/net/mana/mana.c
index 43221e743e..8a782c0d63 100644
--- a/drivers/net/mana/mana.c
+++ b/drivers/net/mana/mana.c
@@ -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 */