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 29EE7A0096 for ; Wed, 8 May 2019 22:12:02 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 3E3FA374C; Wed, 8 May 2019 22:12:01 +0200 (CEST) Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by dpdk.org (Postfix) with ESMTP id BED372B87 for ; Wed, 8 May 2019 22:11:59 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 08 May 2019 13:11:58 -0700 X-ExtLoop1: 1 Received: from orsmsx106.amr.corp.intel.com ([10.22.225.133]) by fmsmga005.fm.intel.com with ESMTP; 08 May 2019 13:11:58 -0700 Received: from orsmsx123.amr.corp.intel.com (10.22.240.116) by ORSMSX106.amr.corp.intel.com (10.22.225.133) with Microsoft SMTP Server (TLS) id 14.3.408.0; Wed, 8 May 2019 13:11:58 -0700 Received: from orsmsx104.amr.corp.intel.com ([169.254.4.183]) by ORSMSX123.amr.corp.intel.com ([169.254.1.141]) with mapi id 14.03.0415.000; Wed, 8 May 2019 13:11:57 -0700 From: "Wang, Yipeng1" To: Dharmik Thakkar , "Gobriel, Sameh" , "Richardson, Bruce" , "De Lara Guarch, Pablo" CC: "dev@dpdk.org" , "honnappa.nagarahalli@arm.com" , "zhongdahulinfan@163.com" Thread-Topic: [PATCH 2/2] test/hash: add test for 'free key with position' Thread-Index: AQHVBb5TzH540UT79kGygTPratXzr6Zhpoxg Date: Wed, 8 May 2019 20:11:57 +0000 Message-ID: References: <20190508165121.20471-1-dharmik.thakkar@arm.com> <20190508165121.20471-3-dharmik.thakkar@arm.com> In-Reply-To: <20190508165121.20471-3-dharmik.thakkar@arm.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-version: 11.0.600.7 dlp-reaction: no-action x-ctpclassification: CTP_NT x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiMzU4ZGQwOTQtYjlmYS00NTljLWI4ODQtMmQ0ZDQ5MjQ1NjUwIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiUWpKTUZVa2UyWEVQa1F0OTBNQUxiclFyVVlycGJrUnZ2RGZwMUxsaHFBQ1ZSdDRqTXdqWVdqTlRpb3MrSmVObCJ9 x-originating-ip: [10.22.254.139] Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 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: <20190508201157.yiW5WNOURLWKIlwiuoIG9KAPXGv7ZLnytY-GNxXmj48@z> Hi, thanks for the patch! Reply inlined: >-----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; D= harmik Thakkar >Subject: [PATCH 2/2] test/hash: add test for 'free key with position' > >This patch adds a unit test for rte_hash_free_key_with_position(). > >Suggested-by: Linfan >Signed-off-by: Dharmik Thakkar >--- > app/test/test_hash.c | 83 ++++++++++++++++++++++++++++++++++++++++++++ > 1 file changed, 83 insertions(+) > >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; > } > >+/* >+ * Sequence of operations for a single key with 'rw concurrency lock free= ' 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_SIZE= value in rte_cuckoo_hash.h I also found the #define BUCKET_ENTRIES 4 in this file without comment. I t= hink it should match #define RTE_HASH_BUCKET_ENTRIES Which is supposed to be 8? If so please add a commit for bug fix. >+ 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 t= he 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. >+ 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); .. Thanks Yipeng