From patchwork Wed Oct 12 12:34:19 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: "Van Haaren, Harry" X-Patchwork-Id: 118068 X-Patchwork-Delegate: jerinj@marvell.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id BC184A00C4; Wed, 12 Oct 2022 14:34:26 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id ABDCE4305F; Wed, 12 Oct 2022 14:34:26 +0200 (CEST) Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by mails.dpdk.org (Postfix) with ESMTP id 09F4543054 for ; Wed, 12 Oct 2022 14:34:23 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1665578064; x=1697114064; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=NlWKr+j+YDkgEHiVeFCfOn0UlT7FpzOUVnrRXzRd0fQ=; b=S05MN9CTVfzzdoyBqjJPYb/2foY9/DTkaJNr13ur0Qyry90LhyR6SYdC /3bMumQJhDuXpdy+R7vHwH20+i7SwQIixADMi6M6iqZepgbo2bYha6kEn sJe9kAcSufNgW9B8DyNxXGpweT/spcaGO+bLUwB6hfK/KfR3m0RLPjRDf dhI/GOlT1Bqr7kxddDIv4MvpbbGdEPthCfW16jSOwdNGa2rDTKC27I8Xx b+/OMVtyoKBJ/O5tJSM383rASZoHjeMB/Q7iFU2/Qgi8UaITryx9bC7aU qSg94YyvOsGLaVMw73y56c2R+KjRK2zOg58yyMPwMJun8Y2ygT/GmcIJk g==; X-IronPort-AV: E=McAfee;i="6500,9779,10497"; a="292105373" X-IronPort-AV: E=Sophos;i="5.95,179,1661842800"; d="scan'208";a="292105373" Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Oct 2022 05:34:23 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10497"; a="955738874" X-IronPort-AV: E=Sophos;i="5.95,179,1661842800"; d="scan'208";a="955738874" Received: from silpixa00401454.ir.intel.com ([10.55.129.60]) by fmsmga005.fm.intel.com with ESMTP; 12 Oct 2022 05:34:20 -0700 From: Harry van Haaren 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 , =?utf-8?q?Morten_Br=C3=B8rup?= Subject: [PATCH] event/sw: fix selftest xstats reset API usage Date: Wed, 12 Oct 2022 12:34:19 +0000 Message-Id: <20221012123419.182631-1-harry.van.haaren@intel.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org 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 Signed-off-by: Harry van Haaren --- 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;