summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorGage Eads <gage.eads@intel.com>2019-08-27 16:34:59 -0500
committerJerin Jacob <jerinj@marvell.com>2019-10-05 15:39:31 +0200
commitd02c470c87976def34bae0307736ecb9c8cac9d8 (patch)
tree0eb96683c9128ad0b391ff572c504b97a3012eec /drivers
parentaa026482baf9ce6642c6bcaa1d6d8bd702ca707e (diff)
downloaddpdk-d02c470c87976def34bae0307736ecb9c8cac9d8.zip
dpdk-d02c470c87976def34bae0307736ecb9c8cac9d8.tar.gz
dpdk-d02c470c87976def34bae0307736ecb9c8cac9d8.tar.xz
event/sw: fix xstats reset value
The sw PMD implements xstats reset by having the xstat get operations return a value to the statistic's value at the last reset. The value at the last reset is maintained in the per-xstat reset_value field, but the PMD was setting reset_value = current - reset_value instead of reset_value = current. Fixes: c1ad03df7ad5 ("event/sw: support xstats") Cc: stable@dpdk.org Signed-off-by: Gage Eads <gage.eads@intel.com> Acked-by: Harry van Haaren <harry.van.haaren@intel.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/event/sw/sw_evdev_xstats.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/event/sw/sw_evdev_xstats.c b/drivers/event/sw/sw_evdev_xstats.c
index 7a6caa6..9066490 100644
--- a/drivers/event/sw/sw_evdev_xstats.c
+++ b/drivers/event/sw/sw_evdev_xstats.c
@@ -491,7 +491,7 @@ sw_xstats_update(struct sw_evdev *sw, enum rte_event_dev_xstats_mode mode,
values[xidx] = val;
if (xs->reset_allowed && reset)
- xs->reset_value = val;
+ xs->reset_value += val;
xidx++;
}
@@ -544,8 +544,7 @@ sw_xstats_reset_range(struct sw_evdev *sw, uint32_t start, uint32_t num)
if (!xs->reset_allowed)
continue;
- uint64_t val = xs->fn(sw, xs->obj_idx, xs->stat, xs->extra_arg)
- - xs->reset_value;
+ uint64_t val = xs->fn(sw, xs->obj_idx, xs->stat, xs->extra_arg);
xs->reset_value = val;
}
}