From patchwork Fri Jun 28 18:43:41 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Honnappa Nagarahalli X-Patchwork-Id: 168130 Delivered-To: patch@linaro.org Received: by 2002:ac9:6410:0:0:0:0:0 with SMTP id r16csp3597973ock; Fri, 28 Jun 2019 11:44:25 -0700 (PDT) X-Google-Smtp-Source: APXvYqzAgR5e7OZikfjT/DhSxTSSTWmne5Rah5vVa2Z+6LwkoXwLx0i+N7I/iDaZMRPFCWl0s7xT X-Received: by 2002:a17:906:ece7:: with SMTP id qt7mr10202261ejb.155.1561747465668; Fri, 28 Jun 2019 11:44:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561747465; cv=none; d=google.com; s=arc-20160816; b=oTUyCGcyniaTDHiqadBFkRa8c6jz0aWzJ1DrjcFmgdYofDr0YhM1ECEa/XJP2g2Nvi 2JaEw8pcH9zcX3W5KH7G4Dh3tN9vDoyE2XA2NrxzGO8xd5aJoe8iRaqUrQ8Bm+QZxpgz cJrjaba+Flu9mGuCL1jPslWTbL6B6iAYLZDxROAS6lilsYNXZVEd0uywu88PIZp8E79a 9uv/LCyzzA8GnShF21686wLefL3YWuiCF8EFVzWlx4BTKwaBZdOBwvXTNXMx9MWX+dBN 0Ab7WqP0YAr6j23Cijib2QJqHjpAkEX/FSnXc3g+z3WOuDlfSTgTcMFTNoUJHKcBc0k2 rF7A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:references:in-reply-to :message-id:date:cc:to:from; bh=f9wCGiAbgs1lE8nWpVH4yZssTCPkzbTrssTwLfZR5HU=; b=rNbcjyjdXGp8iWkjexMfzEqUTPk8bSVm6TYWkrq/LQfP3eWF1fUV2HFDH7N3LMYPSe CKWHhIjg0WNNYfQJOU+7jeJrmliarQHAXK/mVhhkNDDFRRgpGYZQd4jd2Ov+byPMuysK mRQDxg3JhVjtQ9qGNgeTKp47luUirxwaTrgTf0t2QdRF12ozS2vZE+iC4kQ1qSlisner G7oFdNm3OE8IRk/wtjSY39cIVk84NMaWYR4w5y7etf2pSD0v/wHK0bl6JMXHDgSVMwzC snABEcvR8zDRuqUyLyLs7NQQE44YxYP5t0QvmtMXzsL2Jk1gXb5MPRP5V1huBvEOzWgF J/4A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) smtp.mailfrom=dev-bounces@dpdk.org Return-Path: Received: from dpdk.org (dpdk.org. [92.243.14.124]) by mx.google.com with ESMTP id q19si1972172ejt.48.2019.06.28.11.44.25; Fri, 28 Jun 2019 11:44:25 -0700 (PDT) Received-SPF: pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) client-ip=92.243.14.124; Authentication-Results: mx.google.com; spf=pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) smtp.mailfrom=dev-bounces@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 536861B9BB; Fri, 28 Jun 2019 20:44:24 +0200 (CEST) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by dpdk.org (Postfix) with ESMTP id BE0471B9B9; Fri, 28 Jun 2019 20:44:22 +0200 (CEST) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 137322B; Fri, 28 Jun 2019 11:44:22 -0700 (PDT) Received: from qc2400f-1.austin.arm.com (qc2400f-1.austin.arm.com [10.118.12.65]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id F2B143F718; Fri, 28 Jun 2019 11:44:21 -0700 (PDT) From: Honnappa Nagarahalli To: honnappa.nagarahalli@arm.com Cc: dev@dpdk.org, david.marchand@redhat.com, thomas@monjalon.net, ferruh.yigit@intel.com, ruifeng.wang@arm.com, nd@arm.com, stable@dpdk.org Date: Fri, 28 Jun 2019 13:43:41 -0500 Message-Id: <20190628184342.12260-1-honnappa.nagarahalli@arm.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190628034406.5399-1-honnappa.nagarahalli@arm.com> References: <20190628034406.5399-1-honnappa.nagarahalli@arm.com> Subject: [dpdk-dev] [PATCH v3 1/2] test/rcu: increase the size of num cores variable X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" num_cores is of type uint8_t. This results in the following compilation error. test_rcu_qsbr_perf.c:649:16: error: comparison is always false due to limited range of data type [-Werror=type-limits] if (num_cores >= RTE_MAX_LCORE) { ^~ RTE_MAX_LCORE is set to 256 for armv8 config. Fixes: e6a14121f4ae ("test/rcu: remove arbitrary limit on max core count") Cc: stable@dpdk.org Signed-off-by: Honnappa Nagarahalli Reviewed-by: Ruifeng Wang --- v3 - Dropped accidental/incorrect type changes to 'ret' and 'sz' variables (David) v2 - Changed type of num_cores to 'unsigned int' and related changes (David/Thomas) app/test/test_rcu_qsbr.c | 8 ++++---- app/test/test_rcu_qsbr_perf.c | 19 +++++++++++-------- 2 files changed, 15 insertions(+), 12 deletions(-) -- 2.17.1 Reviewed-by: David Marchand diff --git a/app/test/test_rcu_qsbr.c b/app/test/test_rcu_qsbr.c index 943a1e370..ae359a987 100644 --- a/app/test/test_rcu_qsbr.c +++ b/app/test/test_rcu_qsbr.c @@ -27,7 +27,7 @@ #define TEST_RCU_QSBR_CNT_INIT 1 uint16_t enabled_core_ids[RTE_MAX_LCORE]; -uint8_t num_cores; +unsigned int num_cores; static uint32_t *keys; #define TOTAL_ENTRY (1024 * 8) @@ -389,7 +389,7 @@ test_rcu_qsbr_synchronize_reader(void *arg) static int test_rcu_qsbr_synchronize(void) { - int i; + unsigned int i; printf("\nTest rte_rcu_qsbr_synchronize()\n"); @@ -890,8 +890,8 @@ test_rcu_qsbr_sw_sv_3qs(void) static int test_rcu_qsbr_mw_mv_mqs(void) { - int i, j; - uint8_t test_cores; + unsigned int i, j; + unsigned int test_cores; writer_done = 0; test_cores = num_cores / 4; diff --git a/app/test/test_rcu_qsbr_perf.c b/app/test/test_rcu_qsbr_perf.c index 363365f46..cb2d177b7 100644 --- a/app/test/test_rcu_qsbr_perf.c +++ b/app/test/test_rcu_qsbr_perf.c @@ -17,7 +17,7 @@ /* Check condition and return an error if true. */ static uint16_t enabled_core_ids[RTE_MAX_LCORE]; -static uint8_t num_cores; +static unsigned int num_cores; static uint32_t *keys; #define TOTAL_ENTRY (1024 * 8) @@ -125,8 +125,8 @@ test_rcu_qsbr_writer_perf(void *arg) static int test_rcu_qsbr_perf(void) { - int i, sz; - int tmp_num_cores; + int sz; + unsigned int i, tmp_num_cores; writer_done = 0; @@ -188,8 +188,8 @@ test_rcu_qsbr_perf(void) static int test_rcu_qsbr_rperf(void) { - int i, sz; - int tmp_num_cores; + int sz; + unsigned int i, tmp_num_cores; rte_atomic64_clear(&updates); rte_atomic64_clear(&update_cycles); @@ -234,7 +234,8 @@ test_rcu_qsbr_rperf(void) static int test_rcu_qsbr_wperf(void) { - int i, sz; + int sz; + unsigned int i; rte_atomic64_clear(&checks); rte_atomic64_clear(&check_cycles); @@ -378,7 +379,8 @@ static int test_rcu_qsbr_sw_sv_1qs(void) { uint64_t token, begin, cycles; - int i, j, tmp_num_cores, sz; + int sz; + unsigned int i, j, tmp_num_cores; int32_t pos; writer_done = 0; @@ -496,7 +498,8 @@ static int test_rcu_qsbr_sw_sv_1qs_non_blocking(void) { uint64_t token, begin, cycles; - int i, j, ret, tmp_num_cores, sz; + int ret, sz; + unsigned int i, j, tmp_num_cores; int32_t pos; writer_done = 0; From patchwork Fri Jun 28 18:43:42 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Honnappa Nagarahalli X-Patchwork-Id: 168131 Delivered-To: patch@linaro.org Received: by 2002:ac9:6410:0:0:0:0:0 with SMTP id r16csp3598076ock; Fri, 28 Jun 2019 11:44:34 -0700 (PDT) X-Google-Smtp-Source: APXvYqwfy5pIKCv8SxvelN7DCHbVqBQtWcsbTxYAPnHEDF+obEd7TosdWfDkfTgG1CdVzp8Xn0zM X-Received: by 2002:a17:906:45ce:: with SMTP id z14mr10231164ejq.144.1561747474337; Fri, 28 Jun 2019 11:44:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561747474; cv=none; d=google.com; s=arc-20160816; b=TjZn8SYgaXVwHMfJidKj/7xlSXGSvHzyUyCV951ZzlZ+qVjPaE76y9j8JmLNYT1OY8 C7T2tiUORuaxNIZIgLaz2jDjxQlHSlYgTEPIUjFwcRFh1KutQtlPug2WH+8zwX/HMPNc O7+EyAIp1144xbnupHL1wFOJ18qrGqR+UOXMp0HJLQQa0Gk7KfxzGDjsKSI6+9Lg55vc JDGWDUc+3pmOKRIxaAWmwiM4ltpSdG9p9Xn0GK2UyF1JD02D0MKHkFshns2CwydoY23x sPfiyNRn+A9fy2C91JPdO/kyVMMVWJGH2Ms3Eq9NZHzimBgHaSits1YyoBokp+3S7DcV B2EQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:references:in-reply-to :message-id:date:cc:to:from; bh=+PNE2sR1fcAQis8qHlkoYeT1sxyWiEKzSzxr8VES8i4=; b=H+v8HQudAeGGuurzwXXCc3pCo/fTkhwCGRHrV5T9Loknou1dxS5bTxNJSVVwREt1sF 88pWGAkNDavMOZjmx5bjorj/7bYATKoy7IyGgeDs10/iY7A3SIIb9dtpgHdKWs3Z7ZNg aWmPDl/BWQHGYul3nQRRSaPHIKaLoeL4birx4AOQMSfuBITIGC060P2ilKj+Fo9+yd0y 1XgAj5mJ3WwcgZpmm/y+93HK5JWYAotsqdIdIVI4sAukecQKsXMZXGsYpflsHEwYitkX sWaLlcR29Tdmk+Clrj0K3MQgM74LI7ZZeUyi1R5R8FwuiHf4orzNPa703dDrWiVYM4Wn cCwQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) smtp.mailfrom=dev-bounces@dpdk.org Return-Path: Received: from dpdk.org (dpdk.org. [92.243.14.124]) by mx.google.com with ESMTP id o55si3146230edc.137.2019.06.28.11.44.34; Fri, 28 Jun 2019 11:44:34 -0700 (PDT) Received-SPF: pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) client-ip=92.243.14.124; Authentication-Results: mx.google.com; spf=pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) smtp.mailfrom=dev-bounces@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 43A071B9D7; Fri, 28 Jun 2019 20:44:27 +0200 (CEST) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by dpdk.org (Postfix) with ESMTP id F1F131B9B9; Fri, 28 Jun 2019 20:44:23 +0200 (CEST) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 7CE2AEBD; Fri, 28 Jun 2019 11:44:23 -0700 (PDT) Received: from qc2400f-1.austin.arm.com (qc2400f-1.austin.arm.com [10.118.12.65]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 6B2FF3F718; Fri, 28 Jun 2019 11:44:23 -0700 (PDT) From: Honnappa Nagarahalli To: honnappa.nagarahalli@arm.com Cc: dev@dpdk.org, david.marchand@redhat.com, thomas@monjalon.net, ferruh.yigit@intel.com, ruifeng.wang@arm.com, nd@arm.com, stable@dpdk.org Date: Fri, 28 Jun 2019 13:43:42 -0500 Message-Id: <20190628184342.12260-2-honnappa.nagarahalli@arm.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190628184342.12260-1-honnappa.nagarahalli@arm.com> References: <20190628034406.5399-1-honnappa.nagarahalli@arm.com> <20190628184342.12260-1-honnappa.nagarahalli@arm.com> Subject: [dpdk-dev] [PATCH v3 2/2] test/rcu: address test case failure X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Test case for rte_rcu_qsbr_get_memsize is written specifically for 128 threads. Do not use RTE_MAX_LCORE as it changes for different configurations. Fixes: e6a14121f4ae ("test/rcu: remove arbitrary limit on max core count") Cc: stable@dpdk.org Signed-off-by: Honnappa Nagarahalli Reviewed-by: Ruifeng Wang Reviewed-by: David Marchand --- v3 - None v2 - Changed the test case result validation (David) app/test/test_rcu_qsbr.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) -- 2.17.1 diff --git a/app/test/test_rcu_qsbr.c b/app/test/test_rcu_qsbr.c index ae359a987..1d273e39d 100644 --- a/app/test/test_rcu_qsbr.c +++ b/app/test/test_rcu_qsbr.c @@ -89,13 +89,17 @@ test_rcu_qsbr_get_memsize(void) sz = rte_rcu_qsbr_get_memsize(0); TEST_RCU_QSBR_RETURN_IF_ERROR((sz != 1), "Get Memsize for 0 threads"); - sz = rte_rcu_qsbr_get_memsize(RTE_MAX_LCORE); + sz = rte_rcu_qsbr_get_memsize(128); /* For 128 threads, * for machines with cache line size of 64B - 8384 * for machines with cache line size of 128 - 16768 */ - TEST_RCU_QSBR_RETURN_IF_ERROR((sz != 8384 && sz != 16768), - "Get Memsize"); + if (RTE_CACHE_LINE_SIZE == 64) + TEST_RCU_QSBR_RETURN_IF_ERROR((sz != 8384), + "Get Memsize for 128 threads"); + else if (RTE_CACHE_LINE_SIZE == 128) + TEST_RCU_QSBR_RETURN_IF_ERROR((sz != 16768), + "Get Memsize for 128 threads"); return 0; }