* [PATCH] net/mana: fix incorrectly reported counters in stats
@ 2023-02-22 23:27 longli
2023-03-01 0:15 ` Ferruh Yigit
0 siblings, 1 reply; 2+ messages in thread
From: longli @ 2023-02-22 23:27 UTC (permalink / raw)
To: Ferruh Yigit; +Cc: dev, Ajay Sharma, Long Li, stable
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(-)
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 */
--
2.32.0
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2023-03-01 0:15 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-02-22 23:27 [PATCH] net/mana: fix incorrectly reported counters in stats longli
2023-03-01 0:15 ` Ferruh Yigit
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).