DPDK patches and discussions
 help / color / mirror / Atom feed
From: David Marchand <david.marchand@redhat.com>
To: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
Cc: dev <dev@dpdk.org>, Thomas Monjalon <thomas@monjalon.net>,
	 "Yigit, Ferruh" <ferruh.yigit@intel.com>,
	 "Ruifeng Wang (Arm Technology China)" <ruifeng.wang@arm.com>,
	nd <nd@arm.com>, dpdk stable <stable@dpdk.org>
Subject: Re: [dpdk-dev] [PATCH v3 1/2] test/rcu: increase the size of num cores variable
Date: Fri, 28 Jun 2019 20:54:51 +0200	[thread overview]
Message-ID: <CAJFAV8wqWDp=8wfb7j0NHg2PffJxskzQbO=2ABZoQpE2LL8Y6g@mail.gmail.com> (raw)
In-Reply-To: <20190628184342.12260-1-honnappa.nagarahalli@arm.com>

On Fri, Jun 28, 2019 at 8:44 PM Honnappa Nagarahalli <
honnappa.nagarahalli@arm.com> wrote:

> 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 <honnappa.nagarahalli@arm.com>
> Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>
> ---
> 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(-)
>
> 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;
> --
> 2.17.1
>
>

Thanks.
Reviewed-by: David Marchand <david.marchand@redhat.com>


Bon week-end !

-- 
David Marchand

  parent reply	other threads:[~2019-06-28 18:55 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-28  3:44 [dpdk-dev] [PATCH " Honnappa Nagarahalli
2019-06-28  3:44 ` [dpdk-dev] [PATCH 2/2] test/rcu: address test case failure Honnappa Nagarahalli
2019-06-28  9:16   ` [dpdk-dev] [dpdk-stable] " David Marchand
2019-06-28 13:53     ` Honnappa Nagarahalli
2019-06-28 14:09       ` David Marchand
2019-06-28 16:36         ` Honnappa Nagarahalli
2019-06-28 16:54           ` David Marchand
2019-06-28  9:09 ` [dpdk-dev] [PATCH 1/2] test/rcu: increase the size of num cores variable David Marchand
2019-06-28 13:34   ` [dpdk-dev] [dpdk-stable] " Thomas Monjalon
2019-06-28 16:38     ` Honnappa Nagarahalli
2019-06-28 16:35 ` [dpdk-dev] [PATCH v2 " Honnappa Nagarahalli
2019-06-28 16:35   ` [dpdk-dev] [PATCH v2 2/2] test/rcu: address test case failure Honnappa Nagarahalli
2019-06-28 17:11   ` [dpdk-dev] [PATCH v2 1/2] test/rcu: increase the size of num cores variable David Marchand
2019-06-28 18:43 ` [dpdk-dev] [PATCH v3 " Honnappa Nagarahalli
2019-06-28 18:43   ` [dpdk-dev] [PATCH v3 2/2] test/rcu: address test case failure Honnappa Nagarahalli
2019-06-28 18:54   ` David Marchand [this message]
2019-06-29 12:25     ` [dpdk-dev] [dpdk-stable] [PATCH v3 1/2] test/rcu: increase the size of num cores variable 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='CAJFAV8wqWDp=8wfb7j0NHg2PffJxskzQbO=2ABZoQpE2LL8Y6g@mail.gmail.com' \
    --to=david.marchand@redhat.com \
    --cc=dev@dpdk.org \
    --cc=ferruh.yigit@intel.com \
    --cc=honnappa.nagarahalli@arm.com \
    --cc=nd@arm.com \
    --cc=ruifeng.wang@arm.com \
    --cc=stable@dpdk.org \
    --cc=thomas@monjalon.net \
    /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).