event/sw: fix xstats reset value assignment bug
PATCH 1/1 event/sw: fix xstats reset value assignment bug
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.
--- drivers/event/sw/sw_evdev_xstats.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)
drivers/event/sw/sw_evdev_xstats.c +2 -3
@@ -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; } }
Signature · 1 line
2.13.6
Quoted 11 lines · Gage Eads
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_valuefield, but the PMD was settingreset_value= current -reset_valueinstead ofreset_value= current.Fixes c1ad03df7ad5 ("event/sw: support xstats")Signed-off-by Gage Eads <[email protected]>
Harry,
Could you review this patch?
Quoted 30 lines
--- drivers/event/sw/sw_evdev_xstats.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)drivers/event/sw/sw_evdev_xstats.c +2
-4@@ -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; } } --2.13.6
Quoted 17 lines
-----Original Message-----
From: Jerin Jacob [mailto:[email protected]]
Sent: Friday, September 13, 2019 11:30 AM
To: Eads, Gage <[email protected]>
Cc: [email protected]; Richardson, Bruce <[email protected]>; Van Haaren, Harry <[email protected]>; [email protected]
Subject: Re: [dpdk-dev] [PATCH] event/sw: fix xstats reset value assignment bugQuoted 7 lines · Gage Eads
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_valuefield, but the PMD was settingreset_value= current -reset_valueinstead ofreset_value= current.
Quoted 8 lines
Quoted 4 lines
Fixes c1ad03df7ad5 ("event/sw: support xstats")Signed-off-by Gage Eads <[email protected]>Harry,
Could you review this patch?
Yes - thanks for the ping. It's on my TODO, will prioritize.
Van Haaren, Harry
Acked-byQuoted 9 lines
-----Original Message-----
From: Jerin Jacob [mailto:[email protected]]
Sent: Friday, September 13, 2019 11:30 AM
To: Eads, Gage <[email protected]>
Cc: [email protected]; Richardson, Bruce <[email protected]>; Van Haaren, Harry <[email protected]>; [email protected]
Subject: Re: [dpdk-dev] [PATCH] event/sw: fix xstats reset value assignment bug
Quoted 12 lines
Quoted 11 lines · Gage Eads
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_valuefield, but the PMD was settingreset_value= current -reset_valueinstead ofreset_value= current.Fixes c1ad03df7ad5 ("event/sw: support xstats")Signed-off-by Gage Eads <[email protected]>
Jerin Jacob
AppliedQuoted 18 lines · Harry
Quoted 18 lines
-----Original Message-----
From: Jerin Jacob [mailto:[email protected]]
Sent: Friday, September 13, 2019 11:30 AM
To: Eads, Gage <[email protected]>
Cc: [email protected]; Richardson, Bruce <[email protected]>; Van Haaren, Harry <[email protected]>; [email protected]
Subject: Re: [dpdk-dev] [PATCH] event/sw: fix xstats reset value assignment bugQuoted 7 lines · Gage Eads
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_valuefield, but the PMD was settingreset_value= current -reset_valueinstead ofreset_value= current.
Quoted 6 lines
Quoted 4 lines
Quoted 4 lines
Fixes c1ad03df7ad5 ("event/sw: support xstats")Signed-off-by Gage Eads <[email protected]>Acked-by Harry van Haaren <[email protected]>
Applied to dpdk-next-eventdev/master. Thanks.