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 8F8E2A05D3 for ; Wed, 22 May 2019 21:37:41 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 65C7D569B; Wed, 22 May 2019 21:37:41 +0200 (CEST) Received: from EUR04-VI1-obe.outbound.protection.outlook.com (mail-eopbgr80053.outbound.protection.outlook.com [40.107.8.53]) by dpdk.org (Postfix) with ESMTP id E0B5AA69; Wed, 22 May 2019 21:37:36 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=k2HDEbouevGv10tG4jceBh35LUJ2hph7WfOVr379TT8=; b=nwM+IlTHvG1BW17v9lRonAwdvo4mgwVTUYct+at3uAM97lhUKdsh20emnTT23AF19sLMgCrwANLcD7mc/kqmyhcO5gT+AUfkNLPXq9ajnrtm3TOqwha6NYVb645sTC6z8guKkwJm2C+GyqLr1QFXQ9gRmFhXnhQwLxqITA1DsK8= Received: from AM0PR08MB3379.eurprd08.prod.outlook.com (20.177.109.142) by AM0PR08MB3090.eurprd08.prod.outlook.com (52.134.90.23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1922.15; Wed, 22 May 2019 19:37:35 +0000 Received: from AM0PR08MB3379.eurprd08.prod.outlook.com ([fe80::1163:3f6:3219:55ed]) by AM0PR08MB3379.eurprd08.prod.outlook.com ([fe80::1163:3f6:3219:55ed%3]) with mapi id 15.20.1900.020; Wed, 22 May 2019 19:37:35 +0000 From: Dharmik Thakkar To: David Marchand 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 Thread-Topic: [PATCH v2 1/2] test/hash: use existing lcore API Thread-Index: AQHVELBHveV4sz8jtkC3zeQ0ToSAAKZ3VLWAgAAOUYCAACc0AA== Date: Wed, 22 May 2019 19:37:35 +0000 Message-ID: <86110770-2603-480C-9D25-371773EC1916@arm.com> 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: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=Dharmik.Thakkar@arm.com; x-originating-ip: [217.140.111.135] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: e8a26054-dcf7-410d-5eaa-08d6deecf0e8 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600141)(711020)(4605104)(4618075)(2017052603328)(7193020); SRVR:AM0PR08MB3090; x-ms-traffictypediagnostic: AM0PR08MB3090: x-ld-processed: f34e5979-57d9-4aaa-ad4d-b122a662184d,ExtAddr nodisclaimer: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:6790; x-forefront-prvs: 0045236D47 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(376002)(39860400002)(136003)(346002)(366004)(396003)(54534003)(199004)(189003)(54906003)(66066001)(76116006)(91956017)(36756003)(476003)(83716004)(5660300002)(73956011)(86362001)(8936002)(53936002)(81166006)(81156014)(6246003)(8676002)(64756008)(66556008)(66476007)(66446008)(2906002)(66946007)(7736002)(305945005)(486006)(26005)(6436002)(446003)(186003)(14444005)(6512007)(256004)(11346002)(71200400001)(71190400001)(2616005)(68736007)(6486002)(6116002)(3846002)(229853002)(7416002)(478600001)(25786009)(4326008)(72206003)(14454004)(6916009)(82746002)(76176011)(6506007)(102836004)(53546011)(99286004)(316002)(33656002); DIR:OUT; SFP:1101; SCL:1; SRVR:AM0PR08MB3090; H:AM0PR08MB3379.eurprd08.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; received-spf: None (protection.outlook.com: arm.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: 99zFiHennnNKFYO5KoqjjP7xM57lQlBRpYzgACY68w8ZYuT3nK6a5I5myYAbMhdHvDjK4/6gywgOgkDOdAIjhx1AHslxiKaK+uBN620m0zHMGiTbb4/p13DhJxUG4eFRzyQ/g7KZ8VGJx7XIT4Xm3AfIXep87exSsJR1xwYkwGbrqOcb1eZvVEfGpplqRxZXHSeFdASCLIn6fXsjrbuAv4vS+82yqKyiZ4m4PWPgjTG3d5l7o63TNZvAjVxjuxUgPP1SEd8nYctFhNyk0K9A4DXHf5xL+i1BRsyaU8Ynq7FbG+qkvRx4sffHliVokZaO/Bj8AfgP90U3sytgZZiH6vKOW3M8ZEGfhALzjGBeG8Z5A8QWj9JVNJ/FQwiMOemX2VQmR1nUw3Ity8OmKE2Q5A1Vgx6B45eXKe2tZytMUS4= Content-Type: text/plain; charset="us-ascii" Content-ID: Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-Network-Message-Id: e8a26054-dcf7-410d-5eaa-08d6deecf0e8 X-MS-Exchange-CrossTenant-originalarrivaltime: 22 May 2019 19:37:35.4072 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR08MB3090 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" > On May 22, 2019, at 12:17 PM, David Marchand = wrote: >=20 > Hello Dharmik, >=20 > On Wed, May 22, 2019 at 6:27 PM Dharmik Thakkar = wrote: > > On May 22, 2019, at 10:06 AM, David Marchand wrote: > >=20 > > Prefer the existing apis rather than direct access the configuration > > structure. > >=20 > > 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(), > >=20 > > Fixes: c7eb0972e74b ("test/hash: add lock-free r/w concurrency") > > Fixes: 3f9aab961ed3 ("test/hash: check lock-free extendable bucket") > > Cc: stable@dpdk.org > >=20 > > Signed-off-by: David Marchand > > --- > > app/test/test_hash_readwrite_lf.c | 41 ++++++++++++++++++--------------= ------- > > 1 file changed, 19 insertions(+), 22 deletions(-) > >=20 > > --- > > Changelog since v1: > > - fixed test hang in test_hash_multi_add_lookup() reported by Wang, Yip= eng > >=20 > > diff --git a/app/test/test_hash_readwrite_lf.c b/app/test/test_hash_rea= dwrite_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; > >=20 > > static volatile uint8_t writer_done; > > -static volatile uint8_t multi_writer_done[4]; > >=20 > > uint16_t enabled_core_ids[RTE_MAX_LCORE]; > >=20 > > @@ -690,7 +689,6 @@ struct { > > for (i =3D 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] =3D 1; > > return 0; > > } > >=20 > > @@ -738,10 +736,9 @@ struct { > > rte_eal_remote_launch(test_rwc_reader, > > (void *)(uintptr_t)read_t= ype, > > enabled_core_ids[= i]); > > - rte_eal_mp_wait_lcore(); > >=20 > > for (i =3D 1; i <=3D 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) >=20 > (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 you= r patch has been merged.) >=20 > Indeed, reproduced. >=20 > # 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 > ... >=20 > Number of readers: 1 > Floating point exception (core dumped) >=20 >=20 > I'd prefer a separate patch, please. Sounds good. >=20 > --=20 > David Marchand Acked-by: Dharmik Thakkar