aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMonendra Singh Kushwaha <kmonendra@marvell.com>2024-05-16 12:24:37 +0530
committerMonendra Singh Kushwaha <kmonendra@marvell.com>2024-06-10 18:49:48 +0000
commit2f93a43118a368d1e6f9d83237f94a5c3c639448 (patch)
treedc14d9540d1a6de7404b69867589fc6751f503df
parent29ad53b9328a904ba98cf23b305149e89d54b916 (diff)
dev: fix counter_start in counter clear routine
This patch fixes counter_start value, as it should hold the cumulative counter value whenever counter clear routine is called. Type: fix Fixes: 38c619115b Change-Id: I50bf8ddcde419caf1170dfacdea03ff3d93a3327 Signed-off-by: Monendra Singh Kushwaha <kmonendra@marvell.com> (cherry picked from commit afd03ffff561b05ab5e9f4be8bfe5630283028ad)
-rw-r--r--src/vnet/dev/counters.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/vnet/dev/counters.c b/src/vnet/dev/counters.c
index 0a1e0a7419d..d02839d664f 100644
--- a/src/vnet/dev/counters.c
+++ b/src/vnet/dev/counters.c
@@ -54,7 +54,7 @@ vnet_dev_counters_clear (vlib_main_t *vm, vnet_dev_counter_main_t *cm)
{
for (int i = 0; i < cm->n_counters; i++)
{
- cm->counter_start[i] = cm->counter_data[i];
+ cm->counter_start[i] += cm->counter_data[i];
cm->counter_data[i] = 0;
}
}