DPDK patches and discussions
 help / color / mirror / Atom feed
From: David Marchand <david.marchand@redhat.com>
To: Dharmik Thakkar <dharmik.thakkar@arm.com>
Cc: Yipeng Wang <yipeng1.wang@intel.com>,
	Sameh Gobriel <sameh.gobriel@intel.com>,
	 Bruce Richardson <bruce.richardson@intel.com>,
	Pablo de Lara <pablo.de.lara.guarch@intel.com>,
	 dev <dev@dpdk.org>, dpdk stable <stable@dpdk.org>,
	Michael Santana <msantana@redhat.com>
Subject: Re: [dpdk-dev] [dpdk-stable] [PATCH] test/hash: rectify slaveid to point to valid cores
Date: Sat, 1 Jun 2019 17:59:51 +0200	[thread overview]
Message-ID: <CAJFAV8x+zkU=L=uoz2rNyVhdQSg0AUMXU6r2M970N6LMBrE3xw@mail.gmail.com> (raw)
In-Reply-To: <20190531232723.2030-1-dharmik.thakkar@arm.com>

On Sat, Jun 1, 2019 at 1:28 AM Dharmik Thakkar <dharmik.thakkar@arm.com>
wrote:

> This patch rectifies slave_id passed to rte_eal_wait_lcore()
> to point to valid cores in read-write lock-free concurrency test.
>
> It also replaces a 'for' loop with RTE_LCORE_FOREACH API.
>
> Fixes: dfd9d5537e876 ("test/hash: use existing lcore API")
>

This incriminated commit only converts direct access to lcore_config into
call to rte_eal_wait_lcore.
So it did not introduce the issue you want to fix.

The Fixes: tag should probably be:
Fixes: c7eb0972e74b ("test/hash: add lock-free r/w concurrency")


Cc: stable@dpdk.org
>
> Signed-off-by: Dharmik Thakkar <dharmik.thakkar@arm.com>
> Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>
> ---
>  app/test/test_hash_readwrite_lf.c | 24 +++++++++++-------------
>  1 file changed, 11 insertions(+), 13 deletions(-)
>
> diff --git a/app/test/test_hash_readwrite_lf.c
> b/app/test/test_hash_readwrite_lf.c
> index 343a338b4ea8..af1ee9c34394 100644
> --- a/app/test/test_hash_readwrite_lf.c
> +++ b/app/test/test_hash_readwrite_lf.c
> @@ -126,11 +126,9 @@ get_enabled_cores_list(void)
>         uint32_t i = 0;
>         uint16_t core_id;
>         uint32_t max_cores = rte_lcore_count();
> -       for (core_id = 0; core_id < RTE_MAX_LCORE && i < max_cores;
> core_id++) {
> -               if (rte_lcore_is_enabled(core_id)) {
> -                       enabled_core_ids[i] = core_id;
> -                       i++;
> -               }
> +       RTE_LCORE_FOREACH(core_id) {
> +               enabled_core_ids[i] = core_id;
> +               i++;
>         }
>
>         if (i != max_cores) {
> @@ -738,7 +736,7 @@ test_hash_add_no_ks_lookup_hit(struct rwc_perf
> *rwc_perf_results, int rwc_lf,
>
> enabled_core_ids[i]);
>
>                         for (i = 1; i <= rwc_core_cnt[n]; i++)
> -                               if (rte_eal_wait_lcore(i) < 0)
> +                               if
> (rte_eal_wait_lcore(enabled_core_ids[i]) < 0)
>                                         goto err;
>
>                         unsigned long long cycles_per_lookup =
> @@ -810,7 +808,7 @@ test_hash_add_no_ks_lookup_miss(struct rwc_perf
> *rwc_perf_results, int rwc_lf,
>                         if (ret < 0)
>                                 goto err;
>                         for (i = 1; i <= rwc_core_cnt[n]; i++)
> -                               if (rte_eal_wait_lcore(i) < 0)
> +                               if
> (rte_eal_wait_lcore(enabled_core_ids[i]) < 0)
>                                         goto err;
>
>                         unsigned long long cycles_per_lookup =
> @@ -886,7 +884,7 @@ test_hash_add_ks_lookup_hit_non_sp(struct rwc_perf
> *rwc_perf_results,
>                         if (ret < 0)
>                                 goto err;
>                         for (i = 1; i <= rwc_core_cnt[n]; i++)
> -                               if (rte_eal_wait_lcore(i) < 0)
> +                               if
> (rte_eal_wait_lcore(enabled_core_ids[i]) < 0)
>                                         goto err;
>
>                         unsigned long long cycles_per_lookup =
> @@ -962,7 +960,7 @@ test_hash_add_ks_lookup_hit_sp(struct rwc_perf
> *rwc_perf_results, int rwc_lf,
>                         if (ret < 0)
>                                 goto err;
>                         for (i = 1; i <= rwc_core_cnt[n]; i++)
> -                               if (rte_eal_wait_lcore(i) < 0)
> +                               if
> (rte_eal_wait_lcore(enabled_core_ids[i]) < 0)
>                                         goto err;
>
>                         unsigned long long cycles_per_lookup =
> @@ -1037,7 +1035,7 @@ test_hash_add_ks_lookup_miss(struct rwc_perf
> *rwc_perf_results, int rwc_lf, int
>                         if (ret < 0)
>                                 goto err;
>                         for (i = 1; i <= rwc_core_cnt[n]; i++)
> -                               if (rte_eal_wait_lcore(i) < 0)
> +                               if
> (rte_eal_wait_lcore(enabled_core_ids[i]) < 0)
>                                         goto err;
>
>                         unsigned long long cycles_per_lookup =
> @@ -1132,12 +1130,12 @@ test_hash_multi_add_lookup(struct rwc_perf
> *rwc_perf_results, int rwc_lf,
>                                 for (i = rwc_core_cnt[n] + 1;
>                                      i <= rwc_core_cnt[m] +
> rwc_core_cnt[n];
>                                      i++)
> -                                       rte_eal_wait_lcore(i);
> +
>  rte_eal_wait_lcore(enabled_core_ids[i]);
>
>                                 writer_done = 1;
>
>                                 for (i = 1; i <= rwc_core_cnt[n]; i++)
> -                                       if (rte_eal_wait_lcore(i) < 0)
> +                                       if
> (rte_eal_wait_lcore(enabled_core_ids[i]) < 0)
>                                                 goto err;
>
>                                 unsigned long long cycles_per_lookup =
>

Checkpatch complains here.


@@ -1221,7 +1219,7 @@ test_hash_add_ks_lookup_hit_extbkt(struct rwc_perf
> *rwc_perf_results,
>                         writer_done = 1;
>
>                         for (i = 1; i <= rwc_core_cnt[n]; i++)
> -                               if (rte_eal_wait_lcore(i) < 0)
> +                               if
> (rte_eal_wait_lcore(enabled_core_ids[i]) < 0)
>                                         goto err;
>
>                         unsigned long long cycles_per_lookup =
> --
> 2.17.1
>
>
The rest looks good to me.

We have accumulated quite some fixes with Michael on app/test.
Do you mind if I take your patch as part of our series?
I would change the Fixes: tag, fix the checkpatch warning, and send it next
week.

Bon week-end.


-- 
David Marchand

  reply	other threads:[~2019-06-01 16:00 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-31 23:27 [dpdk-dev] " Dharmik Thakkar
2019-06-01 15:59 ` David Marchand [this message]
2019-06-03 16:56   ` [dpdk-dev] [dpdk-stable] " Dharmik Thakkar
2019-06-03 19:31     ` David Marchand
2019-06-03 20:43       ` Dharmik Thakkar
2019-06-05 17:30     ` 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='CAJFAV8x+zkU=L=uoz2rNyVhdQSg0AUMXU6r2M970N6LMBrE3xw@mail.gmail.com' \
    --to=david.marchand@redhat.com \
    --cc=bruce.richardson@intel.com \
    --cc=dev@dpdk.org \
    --cc=dharmik.thakkar@arm.com \
    --cc=msantana@redhat.com \
    --cc=pablo.de.lara.guarch@intel.com \
    --cc=sameh.gobriel@intel.com \
    --cc=stable@dpdk.org \
    --cc=yipeng1.wang@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).