net/sfc: fix getting accumulative SW xstat

Message ID 20210915104017.3755446-1-andrew.rybchenko@oktetlabs.ru (mailing list archive)
State Accepted, archived
Delegated to: Ferruh Yigit
Headers
Series net/sfc: fix getting accumulative SW xstat |

Checks

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

Commit Message

Andrew Rybchenko Sept. 15, 2021, 10:40 a.m. UTC
  From: Ivan Ilchenko <ivan.ilchenko@oktetlabs.ru>

Add missing initialisation of the accumulative SW xstat to
zero since it is sum of per-queue xstats.

Fixes: fdd7719eb3c ("net/sfc: add xstats for Rx/Tx doorbells")
Cc: stable@dpdk.org

Signed-off-by: Ivan Ilchenko <ivan.ilchenko@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
---
 drivers/net/sfc/sfc_sw_stats.c | 1 +
 1 file changed, 1 insertion(+)
  

Comments

Ferruh Yigit Sept. 21, 2021, 3:22 p.m. UTC | #1
On 9/15/2021 11:40 AM, Andrew Rybchenko wrote:
> From: Ivan Ilchenko <ivan.ilchenko@oktetlabs.ru>
> 
> Add missing initialisation of the accumulative SW xstat to
> zero since it is sum of per-queue xstats.
> 
> Fixes: fdd7719eb3c ("net/sfc: add xstats for Rx/Tx doorbells")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Ivan Ilchenko <ivan.ilchenko@oktetlabs.ru>
> Signed-off-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>

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

Patch

diff --git a/drivers/net/sfc/sfc_sw_stats.c b/drivers/net/sfc/sfc_sw_stats.c
index 8489b603f5..2b28ba29e6 100644
--- a/drivers/net/sfc/sfc_sw_stats.c
+++ b/drivers/net/sfc/sfc_sw_stats.c
@@ -313,6 +313,7 @@  sfc_sw_xstat_get_values_by_id(struct sfc_adapter *sa,
 	}
 
 	if (count_accum_value) {
+		values[accum_value_idx] = 0;
 		for (qid = 0; qid < nb_queues; ++qid) {
 			if (rte_bitmap_get(bmp, qid) != 0)
 				continue;