From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR02-AM5-obe.outbound.protection.outlook.com (mail-eopbgr00071.outbound.protection.outlook.com [40.107.0.71]) by dpdk.org (Postfix) with ESMTP id E29FD2BD5 for ; Thu, 9 May 2019 00:54:48 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector1-arm-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=MRoIM0ollYHTGCiJl7jU3Z3qYxROac/D1f4s8O2aDg0=; b=awlCOV3ZfGBu2/hXsbU5VnY5gm7+fwCScHjX6UjVRuBureT4icFeoje3pmuR1y/5XEDu1U7ckOHfXsJ5afdTaAXHmQf45fbOB94WxRR2oQvf1Y7CiwM1tOU0ySzkO1wSrHKvjFh4G1+Z6RgUDXpB1kxtybzuGZKyI7tLJv4gVcY= Received: from AM0PR08MB3379.eurprd08.prod.outlook.com (20.177.109.142) by AM0PR08MB3059.eurprd08.prod.outlook.com (52.134.93.20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1856.12; Wed, 8 May 2019 22:54:47 +0000 Received: from AM0PR08MB3379.eurprd08.prod.outlook.com ([fe80::b5af:c4b5:376e:ab19]) by AM0PR08MB3379.eurprd08.prod.outlook.com ([fe80::b5af:c4b5:376e:ab19%7]) with mapi id 15.20.1856.012; Wed, 8 May 2019 22:54:47 +0000 From: Dharmik Thakkar To: "Wang, Yipeng1" CC: "Gobriel, Sameh" , "Richardson, Bruce" , "De Lara Guarch, Pablo" , "dev@dpdk.org" , Honnappa Nagarahalli , "zhongdahulinfan@163.com" , nd Thread-Topic: [PATCH 2/2] test/hash: add test for 'free key with position' Thread-Index: AQHVBb5RTx1GO9AFoEWNPAYcqZhXxqZhqRaAgAAtfQA= Date: Wed, 8 May 2019 22:54:47 +0000 Message-ID: <95CC305F-7D4B-4C18-BCB6-64AA816AA4E4@arm.com> References: <20190508165121.20471-1-dharmik.thakkar@arm.com> <20190508165121.20471-3-dharmik.thakkar@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: a653eb07-bf23-456f-c120-08d6d4082b74 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:AM0PR08MB3059; x-ms-traffictypediagnostic: AM0PR08MB3059: nodisclaimer: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:8882; x-forefront-prvs: 0031A0FFAF x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(39860400002)(396003)(376002)(136003)(346002)(366004)(13464003)(51914003)(199004)(189003)(26005)(316002)(486006)(476003)(8936002)(102836004)(446003)(82746002)(2616005)(53936002)(2906002)(3846002)(6116002)(36756003)(99286004)(76176011)(81156014)(4326008)(81166006)(6486002)(229853002)(8676002)(76116006)(66476007)(91956017)(53546011)(66946007)(305945005)(71190400001)(71200400001)(66556008)(83716004)(73956011)(6506007)(6512007)(7736002)(6916009)(66066001)(66446008)(72206003)(64756008)(6246003)(86362001)(33656002)(256004)(186003)(25786009)(6436002)(68736007)(11346002)(478600001)(14444005)(14454004)(54906003)(5660300002); DIR:OUT; SFP:1101; SCL:1; SRVR:AM0PR08MB3059; 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: xGaVaZHe7gMl+bbDh2m88XbhKphE9t8jrfiP+IHGq2PhXGFMNc8b2E9lmkLAmJjhJ99SjXLZ9xSe3+UPvj6+kEoStZ5VFH0PKfCfoXPBIe67n4HtgSGZ4LqCpf7qSobVgG0vG+vFVVVrsXZPv/M9vpy+1I3O+7LAktVMtTcqhVOwibpZjUo0+58yGhvYQIramAxtTD+GMRj3eb0TbABpx5VXhZl2Ba84y8brCKeXCYOKZt2vjcV830qQEffw2+nNlARRX3RxS6+OadwoM3rlPs8KUJ7hNKqH6mRMYhu5//MkV3JeM3xzFKSGdnJta56uShiyrKDks6Qn4nItqOO5v+gLkQho0ke2W4F5XGolQ1R7l7G4LKhxiGj2GBIY6gg3ochR081IxvhPG/mKoRsrC8t4yfJp04pLQfwL2QfUodk= 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: a653eb07-bf23-456f-c120-08d6d4082b74 X-MS-Exchange-CrossTenant-originalarrivaltime: 08 May 2019 22:54:47.2053 (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: AM0PR08MB3059 Subject: Re: [dpdk-dev] [PATCH 2/2] test/hash: add test for 'free key with position' 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: , X-List-Received-Date: Wed, 08 May 2019 22:54:49 -0000 > On May 8, 2019, at 3:11 PM, Wang, Yipeng1 wrote: >=20 > Hi, thanks for the patch! > Reply inlined: Hi Yipeng, Thank you for the review! >=20 >> -----Original Message----- >> From: Dharmik Thakkar [mailto:dharmik.thakkar@arm.com] >> Sent: Wednesday, May 8, 2019 9:51 AM >> To: Wang, Yipeng1 ; Gobriel, Sameh ; Richardson, Bruce >> ; De Lara Guarch, Pablo >> Cc: dev@dpdk.org; honnappa.nagarahalli@arm.com; zhongdahulinfan@163.com;= Dharmik Thakkar >> Subject: [PATCH 2/2] test/hash: add test for 'free key with position' >>=20 >> This patch adds a unit test for rte_hash_free_key_with_position(). >>=20 >> Suggested-by: Linfan >> Signed-off-by: Dharmik Thakkar >> --- >> app/test/test_hash.c | 83 ++++++++++++++++++++++++++++++++++++++++++++ >> 1 file changed, 83 insertions(+) >>=20 >> diff --git a/app/test/test_hash.c b/app/test/test_hash.c >> index 390fbef87f42..a6949f2579a2 100644 >> --- a/app/test/test_hash.c >> +++ b/app/test/test_hash.c >> @@ -481,6 +481,87 @@ static int test_add_update_delete_free(void) >> return 0; >> } >>=20 >> +/* >> + * Sequence of operations for a single key with 'rw concurrency lock fr= ee' set: >> + * - add >> + * - delete: hit >> + * - free: hit >> + * Repeat the test case when 'multi writer add' is enabled. >> + * - add >> + * - delete: hit >> + * - free: hit >> + */ >> +static int test_add_delete_free_lf(void) >> +{ >> +#define LCORE_CACHE_SIZE 64 > [Wang, Yipeng] We could say this should match the #define LCORE_CACHE_SI= ZE value in rte_cuckoo_hash.h Sure, will add in the next version. > I also found the #define BUCKET_ENTRIES 4 in this file without comment. I= think it should match #define RTE_HASH_BUCKET_ENTRIES > Which is supposed to be 8? If so please add a commit for bug fix. I think this is done to test with bad parameters. >=20 >> + struct rte_hash *handle; >> + hash_sig_t hash_value; >> + int pos, expectedPos, delPos; >> + uint8_t extra_flag; >> + uint32_t i, ip_src; >> + >> + extra_flag =3D ut_params.extra_flag; >> + ut_params.extra_flag =3D RTE_HASH_EXTRA_FLAGS_RW_CONCURRENCY_LF; >> + handle =3D rte_hash_create(&ut_params); >> + RETURN_IF_ERROR(handle =3D=3D NULL, "hash creation failed"); >> + ut_params.extra_flag =3D extra_flag; >> + > [Wang, Yipeng] Here we could say:" The number of iterations is at least = the same as the number of slots rte_hash allocates internally. This is to > Reveal potential issues of not freeing keys successfully." > Same for the other loop. Will add in the next version. >=20 >> + for (i =3D 0; i < ut_params.entries + 1; i++) { >> + hash_value =3D rte_hash_hash(handle, &keys[0]); >> + pos =3D rte_hash_add_key_with_hash(handle, &keys[0], hash_value); >> + print_key_info("Add", &keys[0], pos); >> + RETURN_IF_ERROR(pos < 0, "failed to add key (pos=3D%d)", pos); > .. >=20 > Thanks > Yipeng 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 F364AA0096 for ; Thu, 9 May 2019 00:54:50 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id E63A234F0; Thu, 9 May 2019 00:54:49 +0200 (CEST) Received: from EUR02-AM5-obe.outbound.protection.outlook.com (mail-eopbgr00071.outbound.protection.outlook.com [40.107.0.71]) by dpdk.org (Postfix) with ESMTP id E29FD2BD5 for ; Thu, 9 May 2019 00:54:48 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector1-arm-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=MRoIM0ollYHTGCiJl7jU3Z3qYxROac/D1f4s8O2aDg0=; b=awlCOV3ZfGBu2/hXsbU5VnY5gm7+fwCScHjX6UjVRuBureT4icFeoje3pmuR1y/5XEDu1U7ckOHfXsJ5afdTaAXHmQf45fbOB94WxRR2oQvf1Y7CiwM1tOU0ySzkO1wSrHKvjFh4G1+Z6RgUDXpB1kxtybzuGZKyI7tLJv4gVcY= Received: from AM0PR08MB3379.eurprd08.prod.outlook.com (20.177.109.142) by AM0PR08MB3059.eurprd08.prod.outlook.com (52.134.93.20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1856.12; Wed, 8 May 2019 22:54:47 +0000 Received: from AM0PR08MB3379.eurprd08.prod.outlook.com ([fe80::b5af:c4b5:376e:ab19]) by AM0PR08MB3379.eurprd08.prod.outlook.com ([fe80::b5af:c4b5:376e:ab19%7]) with mapi id 15.20.1856.012; Wed, 8 May 2019 22:54:47 +0000 From: Dharmik Thakkar To: "Wang, Yipeng1" CC: "Gobriel, Sameh" , "Richardson, Bruce" , "De Lara Guarch, Pablo" , "dev@dpdk.org" , Honnappa Nagarahalli , "zhongdahulinfan@163.com" , nd Thread-Topic: [PATCH 2/2] test/hash: add test for 'free key with position' Thread-Index: AQHVBb5RTx1GO9AFoEWNPAYcqZhXxqZhqRaAgAAtfQA= Date: Wed, 8 May 2019 22:54:47 +0000 Message-ID: <95CC305F-7D4B-4C18-BCB6-64AA816AA4E4@arm.com> References: <20190508165121.20471-1-dharmik.thakkar@arm.com> <20190508165121.20471-3-dharmik.thakkar@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: a653eb07-bf23-456f-c120-08d6d4082b74 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:AM0PR08MB3059; x-ms-traffictypediagnostic: AM0PR08MB3059: nodisclaimer: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:8882; x-forefront-prvs: 0031A0FFAF x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(39860400002)(396003)(376002)(136003)(346002)(366004)(13464003)(51914003)(199004)(189003)(26005)(316002)(486006)(476003)(8936002)(102836004)(446003)(82746002)(2616005)(53936002)(2906002)(3846002)(6116002)(36756003)(99286004)(76176011)(81156014)(4326008)(81166006)(6486002)(229853002)(8676002)(76116006)(66476007)(91956017)(53546011)(66946007)(305945005)(71190400001)(71200400001)(66556008)(83716004)(73956011)(6506007)(6512007)(7736002)(6916009)(66066001)(66446008)(72206003)(64756008)(6246003)(86362001)(33656002)(256004)(186003)(25786009)(6436002)(68736007)(11346002)(478600001)(14444005)(14454004)(54906003)(5660300002); DIR:OUT; SFP:1101; SCL:1; SRVR:AM0PR08MB3059; 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: xGaVaZHe7gMl+bbDh2m88XbhKphE9t8jrfiP+IHGq2PhXGFMNc8b2E9lmkLAmJjhJ99SjXLZ9xSe3+UPvj6+kEoStZ5VFH0PKfCfoXPBIe67n4HtgSGZ4LqCpf7qSobVgG0vG+vFVVVrsXZPv/M9vpy+1I3O+7LAktVMtTcqhVOwibpZjUo0+58yGhvYQIramAxtTD+GMRj3eb0TbABpx5VXhZl2Ba84y8brCKeXCYOKZt2vjcV830qQEffw2+nNlARRX3RxS6+OadwoM3rlPs8KUJ7hNKqH6mRMYhu5//MkV3JeM3xzFKSGdnJta56uShiyrKDks6Qn4nItqOO5v+gLkQho0ke2W4F5XGolQ1R7l7G4LKhxiGj2GBIY6gg3ochR081IxvhPG/mKoRsrC8t4yfJp04pLQfwL2QfUodk= Content-Type: text/plain; charset="UTF-8" Content-ID: Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-Network-Message-Id: a653eb07-bf23-456f-c120-08d6d4082b74 X-MS-Exchange-CrossTenant-originalarrivaltime: 08 May 2019 22:54:47.2053 (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: AM0PR08MB3059 Subject: Re: [dpdk-dev] [PATCH 2/2] test/hash: add test for 'free key with position' 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" Message-ID: <20190508225447.xp1t9XklLxmdPFcd3oQo2-KX8Jl4XSuMHv6IVL0XfhA@z> > On May 8, 2019, at 3:11 PM, Wang, Yipeng1 wrote: >=20 > Hi, thanks for the patch! > Reply inlined: Hi Yipeng, Thank you for the review! >=20 >> -----Original Message----- >> From: Dharmik Thakkar [mailto:dharmik.thakkar@arm.com] >> Sent: Wednesday, May 8, 2019 9:51 AM >> To: Wang, Yipeng1 ; Gobriel, Sameh ; Richardson, Bruce >> ; De Lara Guarch, Pablo >> Cc: dev@dpdk.org; honnappa.nagarahalli@arm.com; zhongdahulinfan@163.com;= Dharmik Thakkar >> Subject: [PATCH 2/2] test/hash: add test for 'free key with position' >>=20 >> This patch adds a unit test for rte_hash_free_key_with_position(). >>=20 >> Suggested-by: Linfan >> Signed-off-by: Dharmik Thakkar >> --- >> app/test/test_hash.c | 83 ++++++++++++++++++++++++++++++++++++++++++++ >> 1 file changed, 83 insertions(+) >>=20 >> diff --git a/app/test/test_hash.c b/app/test/test_hash.c >> index 390fbef87f42..a6949f2579a2 100644 >> --- a/app/test/test_hash.c >> +++ b/app/test/test_hash.c >> @@ -481,6 +481,87 @@ static int test_add_update_delete_free(void) >> return 0; >> } >>=20 >> +/* >> + * Sequence of operations for a single key with 'rw concurrency lock fr= ee' set: >> + * - add >> + * - delete: hit >> + * - free: hit >> + * Repeat the test case when 'multi writer add' is enabled. >> + * - add >> + * - delete: hit >> + * - free: hit >> + */ >> +static int test_add_delete_free_lf(void) >> +{ >> +#define LCORE_CACHE_SIZE 64 > [Wang, Yipeng] We could say this should match the #define LCORE_CACHE_SI= ZE value in rte_cuckoo_hash.h Sure, will add in the next version. > I also found the #define BUCKET_ENTRIES 4 in this file without comment. I= think it should match #define RTE_HASH_BUCKET_ENTRIES > Which is supposed to be 8? If so please add a commit for bug fix. I think this is done to test with bad parameters. >=20 >> + struct rte_hash *handle; >> + hash_sig_t hash_value; >> + int pos, expectedPos, delPos; >> + uint8_t extra_flag; >> + uint32_t i, ip_src; >> + >> + extra_flag =3D ut_params.extra_flag; >> + ut_params.extra_flag =3D RTE_HASH_EXTRA_FLAGS_RW_CONCURRENCY_LF; >> + handle =3D rte_hash_create(&ut_params); >> + RETURN_IF_ERROR(handle =3D=3D NULL, "hash creation failed"); >> + ut_params.extra_flag =3D extra_flag; >> + > [Wang, Yipeng] Here we could say:" The number of iterations is at least = the same as the number of slots rte_hash allocates internally. This is to > Reveal potential issues of not freeing keys successfully." > Same for the other loop. Will add in the next version. >=20 >> + for (i =3D 0; i < ut_params.entries + 1; i++) { >> + hash_value =3D rte_hash_hash(handle, &keys[0]); >> + pos =3D rte_hash_add_key_with_hash(handle, &keys[0], hash_value); >> + print_key_info("Add", &keys[0], pos); >> + RETURN_IF_ERROR(pos < 0, "failed to add key (pos=3D%d)", pos); > .. >=20 > Thanks > Yipeng