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>
values[xidx] = val;
if (xs->reset_allowed && reset)
- xs->reset_value = val;
+ xs->reset_value += val;
xidx++;
}
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;
}
}