From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by dpdk.space (Postfix) with ESMTP id D031BA05D3 for ; Wed, 22 May 2019 19:17:28 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 7D5554C88; Wed, 22 May 2019 19:17:28 +0200 (CEST) Received: from mail-ua1-f67.google.com (mail-ua1-f67.google.com [209.85.222.67]) by dpdk.org (Postfix) with ESMTP id 6F0EB4C93 for ; Wed, 22 May 2019 19:17:27 +0200 (CEST) Received: by mail-ua1-f67.google.com with SMTP id r7so1153926ual.2 for ; Wed, 22 May 2019 10:17:27 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=tn+EatVbXeHgwSw9nXSywcG6+MwAkpksHpaD3Qeyk1k=; b=Tn161wNczrklrXH8895btADNhW+JRN1yIYlsdZ5OwX/ef2hRWd01cjvzmBpMfJW5lC lSp6oarAOydCw+dbfrhXLC1SELY75LM+AvNyyf6Ndbuzr79EEUO2RfWGy6xEH8pueSgR 252Uw2eSNGF9Eqcw0F5OY33NCzm9Kh2j6LGnbMQpw+P67LtZ5rKrs4xqeQyS9vte0OyX 8+mJJjKje1PwfqaYBVoohPfwrU6Q572AqlA36oyHu8taom+re9Di3dl3O/4hBB0TpGJL 5hQcCtSP62MMr+33Y//H3xy2NTodeOfYu8pb+XxE2Ldi+dlIXGicmh1apZyaAfPc0Zav uiUQ== X-Gm-Message-State: APjAAAVdQjBA3TYnecrKZT33qgwcx7KMZ9sBW++1QvC6iNWZNKB0o/Aa Ay2hOuMMGiv89xlLE0mY3Aoe1XOaypIDIrtoKR5Omw== X-Google-Smtp-Source: APXvYqyb7yqgLXeNR3g/KVNWONUUVPBGKucBjdJ4wbmAVVXYPNop3By0YNFfv+49MqMjZdFcYwjAYOJX/M4iiOUB0S0= X-Received: by 2002:ab0:1051:: with SMTP id g17mr10513276uab.41.1558545446667; Wed, 22 May 2019 10:17:26 -0700 (PDT) MIME-Version: 1.0 References: <1557907020-1548-1-git-send-email-david.marchand@redhat.com> <1558537617-27813-1-git-send-email-david.marchand@redhat.com> <9B028D36-C801-49AC-B529-C8721F0B7D8C@arm.com> In-Reply-To: <9B028D36-C801-49AC-B529-C8721F0B7D8C@arm.com> From: David Marchand Date: Wed, 22 May 2019 19:17:15 +0200 Message-ID: To: Dharmik Thakkar Cc: "dev@dpdk.org" , "thomas@monjalon.net" , Stephen Hemminger , "maxime.coquelin@redhat.com" , "stable@dpdk.org" , Yipeng Wang , Sameh Gobriel , Bruce Richardson , Pablo de Lara , nd Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.15 Subject: Re: [dpdk-stable] [PATCH v2 1/2] test/hash: use existing lcore API X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Sender: "stable" Hello Dharmik, On Wed, May 22, 2019 at 6:27 PM Dharmik Thakkar wrote: > > On May 22, 2019, at 10:06 AM, David Marchand > wrote: > > > > Prefer the existing apis rather than direct access the configuration > > structure. > > > > test_hash_multi_add_lookup() currently starts n readers and N writers > > using rte_eal_remote_launch(). > > It then waits for the N writers to complete with a custom > > multi_writer_done[] array to synchronise over. > > Jump on the occasion to use rte_eal_wait_lcore() so that the code is > > more straightforward: > > - we start n readers with rte_eal_remote_launch(), > > - we start N writers with rte_eal_remote_launch(), > > - we wait for N writers to join with rte_eal_wait_lcore(), > > - we wait for n readers to join with rte_eal_wait_lcore(), > > > > Fixes: c7eb0972e74b ("test/hash: add lock-free r/w concurrency") > > Fixes: 3f9aab961ed3 ("test/hash: check lock-free extendable bucket") > > Cc: stable@dpdk.org > > > > Signed-off-by: David Marchand > > --- > > app/test/test_hash_readwrite_lf.c | 41 > ++++++++++++++++++--------------------- > > 1 file changed, 19 insertions(+), 22 deletions(-) > > > > --- > > Changelog since v1: > > - fixed test hang in test_hash_multi_add_lookup() reported by Wang, > Yipeng > > > > diff --git a/app/test/test_hash_readwrite_lf.c > b/app/test/test_hash_readwrite_lf.c > > index 4ab4c8e..343a338 100644 > > --- a/app/test/test_hash_readwrite_lf.c > > +++ b/app/test/test_hash_readwrite_lf.c > > @@ -86,7 +86,6 @@ struct { > > static rte_atomic64_t greads; > > > > static volatile uint8_t writer_done; > > -static volatile uint8_t multi_writer_done[4]; > > > > uint16_t enabled_core_ids[RTE_MAX_LCORE]; > > > > @@ -690,7 +689,6 @@ struct { > > for (i = offset; i < offset + tbl_rwc_test_param.single_insert; > i++) > > rte_hash_add_key(tbl_rwc_test_param.h, > > tbl_rwc_test_param.keys_ks + i); > > - multi_writer_done[pos_core] = 1; > > return 0; > > } > > > > @@ -738,10 +736,9 @@ struct { > > rte_eal_remote_launch(test_rwc_reader, > > (void > *)(uintptr_t)read_type, > > > enabled_core_ids[i]); > > - rte_eal_mp_wait_lcore(); > > > > for (i = 1; i <= rwc_core_cnt[n]; i++) > > - if (lcore_config[i].ret < 0) > > + if (rte_eal_wait_lcore(i) < 0) > if (rte_eal_wait_lcore(enabled_core_ids[i]) < 0) > > (There are similar changes in other functions too. > I realize that this is a separate issue than what the patch is aimed for. > If you see fit, please integrate it, else I will put out a patch once your > patch has been merged.) > Indeed, reproduced. # echo hash_readwrite_lf_autotest |./master/app/test -c 0x2e EAL: Detected 8 lcore(s) EAL: Detected 1 NUMA nodes EAL: Multi-process socket /var/run/dpdk/rte/mp_socket EAL: No available hugepages reported in hugepages-1048576kB EAL: Probing VFIO support... EAL: PCI device 0000:00:1f.6 on NUMA socket -1 EAL: Invalid NUMA socket, default to 0 EAL: probe driver: 8086:15d7 net_e1000_em APP: HPET is not enabled, using TSC as default timer RTE>>hash_readwrite_lf_autotest ... Number of readers: 1 Floating point exception (core dumped) I'd prefer a separate patch, please. -- David Marchand