DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] event/sw: fix xstats reset value assignment bug
@ 2019-08-27 21:34 Gage Eads
  2019-09-13 10:30 ` Jerin Jacob
  0 siblings, 1 reply; 5+ messages in thread
From: Gage Eads @ 2019-08-27 21:34 UTC (permalink / raw)
  To: dev; +Cc: bruce.richardson, harry.van.haaren, stable

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>
---
 drivers/event/sw/sw_evdev_xstats.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/event/sw/sw_evdev_xstats.c b/drivers/event/sw/sw_evdev_xstats.c
index 7a6caa64d..90664903b 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;
 	}
 }
-- 
2.13.6


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [dpdk-dev] [PATCH] event/sw: fix xstats reset value assignment bug
  2019-08-27 21:34 [dpdk-dev] [PATCH] event/sw: fix xstats reset value assignment bug Gage Eads
@ 2019-09-13 10:30 ` Jerin Jacob
  2019-09-13 10:31   ` Van Haaren, Harry
  2019-09-23 14:17   ` Van Haaren, Harry
  0 siblings, 2 replies; 5+ messages in thread
From: Jerin Jacob @ 2019-09-13 10:30 UTC (permalink / raw)
  To: Gage Eads; +Cc: dev, bruce.richardson, harry.van.haaren, stable

On Wed, Aug 28, 2019 at 3:06 AM Gage Eads <gage.eads@intel.com> wrote:
>
> 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>

Harry,

Could you review this patch?



> ---
>  drivers/event/sw/sw_evdev_xstats.c | 5 ++---
>  1 file changed, 2 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/event/sw/sw_evdev_xstats.c b/drivers/event/sw/sw_evdev_xstats.c
> index 7a6caa64d..90664903b 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;
>         }
>  }
> --
> 2.13.6
>

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [dpdk-dev] [PATCH] event/sw: fix xstats reset value assignment bug
  2019-09-13 10:30 ` Jerin Jacob
@ 2019-09-13 10:31   ` Van Haaren, Harry
  2019-09-23 14:17   ` Van Haaren, Harry
  1 sibling, 0 replies; 5+ messages in thread
From: Van Haaren, Harry @ 2019-09-13 10:31 UTC (permalink / raw)
  To: Jerin Jacob; +Cc: dev, Richardson, Bruce, stable, Eads, Gage

> -----Original Message-----
> From: Jerin Jacob [mailto:jerinjacobk@gmail.com]
> Sent: Friday, September 13, 2019 11:30 AM
> To: Eads, Gage <gage.eads@intel.com>
> Cc: dev@dpdk.org; Richardson, Bruce <bruce.richardson@intel.com>; Van Haaren,
> Harry <harry.van.haaren@intel.com>; stable@dpdk.org
> Subject: Re: [dpdk-dev] [PATCH] event/sw: fix xstats reset value assignment
> bug
> 
> On Wed, Aug 28, 2019 at 3:06 AM Gage Eads <gage.eads@intel.com> wrote:
> >
> > 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>
> 
> Harry,
> 
> Could you review this patch?

Yes - thanks for the ping. It's on my TODO, will prioritize.


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [dpdk-dev] [PATCH] event/sw: fix xstats reset value assignment bug
  2019-09-13 10:30 ` Jerin Jacob
  2019-09-13 10:31   ` Van Haaren, Harry
@ 2019-09-23 14:17   ` Van Haaren, Harry
  2019-09-23 15:51     ` Jerin Jacob
  1 sibling, 1 reply; 5+ messages in thread
From: Van Haaren, Harry @ 2019-09-23 14:17 UTC (permalink / raw)
  To: Jerin Jacob, Eads, Gage; +Cc: dev, Richardson, Bruce, stable

> -----Original Message-----
> From: Jerin Jacob [mailto:jerinjacobk@gmail.com]
> Sent: Friday, September 13, 2019 11:30 AM
> To: Eads, Gage <gage.eads@intel.com>
> Cc: dev@dpdk.org; Richardson, Bruce <bruce.richardson@intel.com>; Van Haaren,
> Harry <harry.van.haaren@intel.com>; stable@dpdk.org
> Subject: Re: [dpdk-dev] [PATCH] event/sw: fix xstats reset value assignment
> bug
> 
> On Wed, Aug 28, 2019 at 3:06 AM Gage Eads <gage.eads@intel.com> wrote:
> >
> > 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>



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [dpdk-dev] [PATCH] event/sw: fix xstats reset value assignment bug
  2019-09-23 14:17   ` Van Haaren, Harry
@ 2019-09-23 15:51     ` Jerin Jacob
  0 siblings, 0 replies; 5+ messages in thread
From: Jerin Jacob @ 2019-09-23 15:51 UTC (permalink / raw)
  To: Van Haaren, Harry; +Cc: Eads, Gage, dev, Richardson, Bruce, stable

On Mon, Sep 23, 2019 at 7:47 PM Van Haaren, Harry
<harry.van.haaren@intel.com> wrote:
>
> > -----Original Message-----
> > From: Jerin Jacob [mailto:jerinjacobk@gmail.com]
> > Sent: Friday, September 13, 2019 11:30 AM
> > To: Eads, Gage <gage.eads@intel.com>
> > Cc: dev@dpdk.org; Richardson, Bruce <bruce.richardson@intel.com>; Van Haaren,
> > Harry <harry.van.haaren@intel.com>; stable@dpdk.org
> > Subject: Re: [dpdk-dev] [PATCH] event/sw: fix xstats reset value assignment
> > bug
> >
> > On Wed, Aug 28, 2019 at 3:06 AM Gage Eads <gage.eads@intel.com> wrote:
> > >
> > > 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>

Applied to dpdk-next-eventdev/master. Thanks.



>
>

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2019-09-23 15:52 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-08-27 21:34 [dpdk-dev] [PATCH] event/sw: fix xstats reset value assignment bug Gage Eads
2019-09-13 10:30 ` Jerin Jacob
2019-09-13 10:31   ` Van Haaren, Harry
2019-09-23 14:17   ` Van Haaren, Harry
2019-09-23 15:51     ` Jerin Jacob

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).