DPDK patches and discussions
 help / color / mirror / Atom feed
From: Harry van Haaren <harry.van.haaren@intel.com>
To: dev@dpdk.org
Cc: jerinj@marvell.com, weiyuanx.li@intel.com, thomas@monjalon.net,
	ferruh.yigit@amd.com, andrew.rybchenko@oktetlabs.ru,
	"Harry van Haaren" <harry.van.haaren@intel.com>,
	"Morten Brørup" <mb@smartsharesystems.com>
Subject: [PATCH] event/sw: fix selftest xstats reset API usage
Date: Wed, 12 Oct 2022 12:34:19 +0000	[thread overview]
Message-ID: <20221012123419.182631-1-harry.van.haaren@intel.com> (raw)

The eventdev xstats reset API takes an ID of "uint32_t", while
the rest of the xstats APIs require an "unsigned int". On some
platforms these might not be the same bitwidth, however this was
assumed in the code.

Fix by providing a uint32_t to the xstats_reset() function.
Fixes: e21df4b062b5 ("test/eventdev: add SW xstats tests")

Reported-by: Morten Brørup <mb@smartsharesystems.com>
Signed-off-by: Harry van Haaren <harry.van.haaren@intel.com>

---

Note this is a fix for a potential build issue in 64-bit BE systems.

---
 drivers/event/sw/sw_evdev_selftest.c | 15 +++++++++------
 1 file changed, 9 insertions(+), 6 deletions(-)

diff --git a/drivers/event/sw/sw_evdev_selftest.c b/drivers/event/sw/sw_evdev_selftest.c
index ed7ae6a685..f8496bc44e 100644
--- a/drivers/event/sw/sw_evdev_selftest.c
+++ b/drivers/event/sw/sw_evdev_selftest.c
@@ -1525,10 +1525,11 @@ xstats_id_reset_tests(struct test *t)
 				dev_names[i], dev_expected[i], val);
 			goto fail;
 		}
-		/* reset to zero */
+		/* reset to zero: note API requires uint32_t not unsigned int */
+		uint32_t reset_id = id;
 		int reset_ret = rte_event_dev_xstats_reset(evdev,
 						RTE_EVENT_DEV_XSTATS_DEVICE, 0,
-						&id,
+						&reset_id,
 						1);
 		if (reset_ret) {
 			printf("%d: failed to reset successfully\n", __LINE__);
@@ -1647,10 +1648,11 @@ xstats_id_reset_tests(struct test *t)
 				port_expected[i], id);
 			failed = 1;
 		}
-		/* reset to zero */
+		/* reset to zero: note API requires uint32_t not unsigned int */
+		uint32_t reset_id = id;
 		int reset_ret = rte_event_dev_xstats_reset(evdev,
 						RTE_EVENT_DEV_XSTATS_PORT, PORT,
-						&id,
+						&reset_id,
 						1);
 		if (reset_ret) {
 			printf("%d: failed to reset successfully\n", __LINE__);
@@ -1762,10 +1764,11 @@ xstats_id_reset_tests(struct test *t)
 				queue_names[i], queue_expected[i], val);
 			failed = 1;
 		}
-		/* reset to zero */
+		/* reset to zero: note API requires uint32_t not unsigned int */
+		uint32_t reset_id = id;
 		int reset_ret = rte_event_dev_xstats_reset(evdev,
 						RTE_EVENT_DEV_XSTATS_QUEUE,
-						queue, &id, 1);
+						queue, &reset_id, 1);
 		if (reset_ret) {
 			printf("%d: failed to reset successfully\n", __LINE__);
 			failed = 1;
-- 
2.34.1


             reply	other threads:[~2022-10-12 12:34 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-12 12:34 Harry van Haaren [this message]
2022-10-12 13:05 ` Thomas Monjalon
2022-10-12 13:08   ` Van Haaren, Harry
2022-10-12 15:09     ` Thomas Monjalon

Reply instructions:

You may reply publicly 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=20221012123419.182631-1-harry.van.haaren@intel.com \
    --to=harry.van.haaren@intel.com \
    --cc=andrew.rybchenko@oktetlabs.ru \
    --cc=dev@dpdk.org \
    --cc=ferruh.yigit@amd.com \
    --cc=jerinj@marvell.com \
    --cc=mb@smartsharesystems.com \
    --cc=thomas@monjalon.net \
    --cc=weiyuanx.li@intel.com \
    /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
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).