patches for DPDK stable branches
 help / color / Atom feed
From: Gage Eads <gage.eads@intel.com>
To: dev@dpdk.org
Cc: bruce.richardson@intel.com, harry.van.haaren@intel.com, stable@dpdk.org
Subject: [dpdk-stable] [PATCH] event/sw: fix xstats reset value assignment bug
Date: Tue, 27 Aug 2019 16:34:59 -0500
Message-ID: <20190827213459.23441-1-gage.eads@intel.com> (raw)

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


             reply index

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-27 21:34 Gage Eads [this message]
2019-09-13 10:30 ` [dpdk-stable] [dpdk-dev] " 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

Reply instructions:

You may reply publically to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190827213459.23441-1-gage.eads@intel.com \
    --to=gage.eads@intel.com \
    --cc=bruce.richardson@intel.com \
    --cc=dev@dpdk.org \
    --cc=harry.van.haaren@intel.com \
    --cc=stable@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

patches for DPDK stable branches

Archives are clonable:
	git clone --mirror http://inbox.dpdk.org/stable/0 stable/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 stable stable/ http://inbox.dpdk.org/stable \
		stable@dpdk.org
	public-inbox-index stable


Newsgroup available over NNTP:
	nntp://inbox.dpdk.org/inbox.dpdk.stable


AGPL code for this site: git clone https://public-inbox.org/ public-inbox