From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <yipeng1.wang@intel.com>
Received: from mga18.intel.com (mga18.intel.com [134.134.136.126])
 by dpdk.org (Postfix) with ESMTP id 633EE5A
 for <dev@dpdk.org>; Mon,  1 Apr 2019 20:55:59 +0200 (CEST)
X-Amp-Result: SKIPPED(no attachment in message)
X-Amp-File-Uploaded: False
Received: from orsmga003.jf.intel.com ([10.7.209.27])
 by orsmga106.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;
 01 Apr 2019 11:55:48 -0700
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="5.60,297,1549958400"; d="scan'208";a="139098302"
Received: from orsmsx105.amr.corp.intel.com ([10.22.225.132])
 by orsmga003.jf.intel.com with ESMTP; 01 Apr 2019 11:55:47 -0700
Received: from orsmsx115.amr.corp.intel.com (10.22.240.11) by
 ORSMSX105.amr.corp.intel.com (10.22.225.132) with Microsoft SMTP Server (TLS)
 id 14.3.408.0; Mon, 1 Apr 2019 11:55:47 -0700
Received: from orsmsx104.amr.corp.intel.com ([169.254.4.204]) by
 ORSMSX115.amr.corp.intel.com ([169.254.4.66]) with mapi id 14.03.0415.000;
 Mon, 1 Apr 2019 11:55:47 -0700
From: "Wang, Yipeng1" <yipeng1.wang@intel.com>
To: Dharmik Thakkar <dharmik.thakkar@arm.com>, "Gobriel, Sameh"
 <sameh.gobriel@intel.com>, "Richardson, Bruce" <bruce.richardson@intel.com>,
 "De Lara Guarch, Pablo" <pablo.de.lara.guarch@intel.com>
CC: "dev@dpdk.org" <dev@dpdk.org>
Thread-Topic: [PATCH v2 2/2] test/hash: lock-free rw concurrency test ext bkt
Thread-Index: AQHU40777i2KcbL6WEGdHQKYydDx5KYnr2BQ
Date: Mon, 1 Apr 2019 18:55:47 +0000
Message-ID: <D2C4A16CA39F7F4E8E384D204491D7A673E48A51@ORSMSX104.amr.corp.intel.com>
References: <20190320223513.31249-1-dharmik.thakkar@arm.com>
 <20190325210838.2853-1-dharmik.thakkar@arm.com>
 <20190325210838.2853-3-dharmik.thakkar@arm.com>
In-Reply-To: <20190325210838.2853-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.400.15
dlp-reaction: no-action
x-ctpclassification: CTP_NT
x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiNWZlYjc4NDQtZmU0My00Mjc3LTgwMjMtNmZhZWIyZGI4ZWE5IiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoidEhLeVIwSmE0VGJhV1NXTmNqM1hcL2l3cmpXUkVlUURGaWRSKzlvcGZiaDBkaW01MkIwd0l1NEFPeFFTblZ5alIifQ==
x-originating-ip: [10.22.254.139]
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0
Subject: Re: [dpdk-dev] [PATCH v2 2/2] test/hash: lock-free rw concurrency
	test ext bkt
X-BeenThere: dev@dpdk.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: DPDK patches and discussions <dev.dpdk.org>
List-Unsubscribe: <https://mails.dpdk.org/options/dev>,
 <mailto:dev-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://mails.dpdk.org/archives/dev/>
List-Post: <mailto:dev@dpdk.org>
List-Help: <mailto:dev-request@dpdk.org?subject=help>
List-Subscribe: <https://mails.dpdk.org/listinfo/dev>,
 <mailto:dev-request@dpdk.org?subject=subscribe>
X-List-Received-Date: Mon, 01 Apr 2019 18:55:59 -0000

A little bit improvement on commit-message maybe needed.

>-----Original Message-----
>From: Dharmik Thakkar [mailto:dharmik.thakkar@arm.com]
>Sent: Monday, March 25, 2019 2:09 PM
>To: Wang, Yipeng1 <yipeng1.wang@intel.com>; Gobriel, Sameh <sameh.gobriel@=
intel.com>; Richardson, Bruce
><bruce.richardson@intel.com>; De Lara Guarch, Pablo <pablo.de.lara.guarch@=
intel.com>
>Cc: dev@dpdk.org; Dharmik Thakkar <dharmik.thakkar@arm.com>
>Subject: [PATCH v2 2/2] test/hash: lock-free rw concurrency test ext bkt
[Wang, Yipeng] *for* ext bucket
>
>Add unit test to check for hash lookup and bulk-lookup perf.
[Wang, Yipeng] for extendable bucket feature.
>Test with lock-free enabled and with lock-free disabled.
[Wang, Yipeng] It is tested with both lock-free enabled and disabled case.
>
>Test include:
>
>- hash lookup on keys in ext bkt,
>hash delete causing key-shifts of keys from ext bkt to secondary bkt
[Wang, Yipeng]=20
Two test scenarios right? A bit of formatting..
Tests include:
- hash lookup on keys in ext bucket.
- hash delete causing key-shifts of keys from ext bucket to secondary bucke=
t.

>
>Suggested-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
>Signed-off-by: Dharmik Thakkar <dharmik.thakkar@arm.com>
>---
>+/*
>+ * Test lookup perf:
>+ * Reader(s) lookup keys present in the extendable bkt.
>+ */
>+static int
>+test_hash_add_ks_lookup_hit_extbkt(struct rwc_perf *rwc_perf_results,
>+				int rwc_lf, int htm, int ext_bkt)
>+{
>+	unsigned int n, m;
>+	uint64_t i;
>+	int use_jhash =3D 0;
>+	uint8_t write_type;
>+	uint8_t read_type =3D READ_PASS_KEY_SHIFTS_EXTBKT;
>+
>+	rte_atomic64_init(&greads);
>+	rte_atomic64_init(&gread_cycles);
>+
>+	if (init_params(rwc_lf, use_jhash, htm, ext_bkt) !=3D 0)
>+		goto err;
>+	printf("\nTest: Hash add - key-shifts, read - hit (ext_bkt)\n");
>+	for (m =3D 0; m < 2; m++) {
>+		if (m =3D=3D 1) {
>+			printf("\n** With bulk-lookup **\n");
>+			read_type |=3D BULK_LOOKUP;
>+		}
>+		for (n =3D 0; n < NUM_TEST; n++) {
>+			unsigned int tot_lcore =3D rte_lcore_count();
>+			if (tot_lcore < rwc_core_cnt[n] + 1)
>+				goto finish;
>+
>+			printf("\nNumber of readers: %u\n", rwc_core_cnt[n]);
>+
>+			rte_atomic64_clear(&greads);
>+			rte_atomic64_clear(&gread_cycles);
>+
>+			rte_hash_reset(tbl_rwc_test_param.h);
>+			write_type =3D WRITE_NO_KEY_SHIFT;
>+			if (write_keys(write_type) < 0)
>+				goto err;
>+			write_type =3D WRITE_KEY_SHIFT;
>+			if (write_keys(write_type) < 0)
>+				goto err;
>+			writer_done =3D 0;
>+			for (i =3D 1; i <=3D rwc_core_cnt[n]; i++)
>+				rte_eal_remote_launch(test_rwc_reader,
>+						(void *)(uintptr_t)read_type,
>+							enabled_core_ids[i]);
>+			for (i =3D 0; i < tbl_rwc_test_param.count_keys_ks_extbkt;
>+			     i++) {
>+				if (rte_hash_del_key(tbl_rwc_test_param.h,
>+					tbl_rwc_test_param.keys_ks_extbkt + i)
>+							< 0) {
>+					printf("Delete Failed: %u\n",
>+					tbl_rwc_test_param.keys_ks_extbkt[i]);
>+					goto err;
>+				}
>+			}
>+			writer_done =3D 1;
>+			rte_eal_mp_wait_lcore();
[Wang, Yipeng] Not requirement for this perf patch, but is it better to rea=
d the shifted key again
Just to verify the logic? If not difficult please add.

From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <dev-bounces@dpdk.org>
Received: from dpdk.org (dpdk.org [92.243.14.124])
	by dpdk.space (Postfix) with ESMTP id 39352A0679
	for <public@inbox.dpdk.org>; Mon,  1 Apr 2019 20:56:03 +0200 (CEST)
Received: from [92.243.14.124] (localhost [127.0.0.1])
	by dpdk.org (Postfix) with ESMTP id 9AE782B99;
	Mon,  1 Apr 2019 20:56:01 +0200 (CEST)
Received: from mga18.intel.com (mga18.intel.com [134.134.136.126])
 by dpdk.org (Postfix) with ESMTP id 633EE5A
 for <dev@dpdk.org>; Mon,  1 Apr 2019 20:55:59 +0200 (CEST)
X-Amp-Result: SKIPPED(no attachment in message)
X-Amp-File-Uploaded: False
Received: from orsmga003.jf.intel.com ([10.7.209.27])
 by orsmga106.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;
 01 Apr 2019 11:55:48 -0700
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="5.60,297,1549958400"; d="scan'208";a="139098302"
Received: from orsmsx105.amr.corp.intel.com ([10.22.225.132])
 by orsmga003.jf.intel.com with ESMTP; 01 Apr 2019 11:55:47 -0700
Received: from orsmsx115.amr.corp.intel.com (10.22.240.11) by
 ORSMSX105.amr.corp.intel.com (10.22.225.132) with Microsoft SMTP Server (TLS)
 id 14.3.408.0; Mon, 1 Apr 2019 11:55:47 -0700
Received: from orsmsx104.amr.corp.intel.com ([169.254.4.204]) by
 ORSMSX115.amr.corp.intel.com ([169.254.4.66]) with mapi id 14.03.0415.000;
 Mon, 1 Apr 2019 11:55:47 -0700
From: "Wang, Yipeng1" <yipeng1.wang@intel.com>
To: Dharmik Thakkar <dharmik.thakkar@arm.com>, "Gobriel, Sameh"
 <sameh.gobriel@intel.com>, "Richardson, Bruce" <bruce.richardson@intel.com>,
 "De Lara Guarch, Pablo" <pablo.de.lara.guarch@intel.com>
CC: "dev@dpdk.org" <dev@dpdk.org>
Thread-Topic: [PATCH v2 2/2] test/hash: lock-free rw concurrency test ext bkt
Thread-Index: AQHU40777i2KcbL6WEGdHQKYydDx5KYnr2BQ
Date: Mon, 1 Apr 2019 18:55:47 +0000
Message-ID:
 <D2C4A16CA39F7F4E8E384D204491D7A673E48A51@ORSMSX104.amr.corp.intel.com>
References: <20190320223513.31249-1-dharmik.thakkar@arm.com>
 <20190325210838.2853-1-dharmik.thakkar@arm.com>
 <20190325210838.2853-3-dharmik.thakkar@arm.com>
In-Reply-To: <20190325210838.2853-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.400.15
dlp-reaction: no-action
x-ctpclassification: CTP_NT
x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiNWZlYjc4NDQtZmU0My00Mjc3LTgwMjMtNmZhZWIyZGI4ZWE5IiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoidEhLeVIwSmE0VGJhV1NXTmNqM1hcL2l3cmpXUkVlUURGaWRSKzlvcGZiaDBkaW01MkIwd0l1NEFPeFFTblZ5alIifQ==
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 v2 2/2] test/hash: lock-free rw concurrency
	test ext bkt
X-BeenThere: dev@dpdk.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: DPDK patches and discussions <dev.dpdk.org>
List-Unsubscribe: <https://mails.dpdk.org/options/dev>,
 <mailto:dev-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://mails.dpdk.org/archives/dev/>
List-Post: <mailto:dev@dpdk.org>
List-Help: <mailto:dev-request@dpdk.org?subject=help>
List-Subscribe: <https://mails.dpdk.org/listinfo/dev>,
 <mailto:dev-request@dpdk.org?subject=subscribe>
Errors-To: dev-bounces@dpdk.org
Sender: "dev" <dev-bounces@dpdk.org>
Message-ID: <20190401185547.NOBJV9aG-AzvIWbgs2AE6E-uk1UsLNKI3Tt9uyWHHUY@z>

A little bit improvement on commit-message maybe needed.

>-----Original Message-----
>From: Dharmik Thakkar [mailto:dharmik.thakkar@arm.com]
>Sent: Monday, March 25, 2019 2:09 PM
>To: Wang, Yipeng1 <yipeng1.wang@intel.com>; Gobriel, Sameh <sameh.gobriel@=
intel.com>; Richardson, Bruce
><bruce.richardson@intel.com>; De Lara Guarch, Pablo <pablo.de.lara.guarch@=
intel.com>
>Cc: dev@dpdk.org; Dharmik Thakkar <dharmik.thakkar@arm.com>
>Subject: [PATCH v2 2/2] test/hash: lock-free rw concurrency test ext bkt
[Wang, Yipeng] *for* ext bucket
>
>Add unit test to check for hash lookup and bulk-lookup perf.
[Wang, Yipeng] for extendable bucket feature.
>Test with lock-free enabled and with lock-free disabled.
[Wang, Yipeng] It is tested with both lock-free enabled and disabled case.
>
>Test include:
>
>- hash lookup on keys in ext bkt,
>hash delete causing key-shifts of keys from ext bkt to secondary bkt
[Wang, Yipeng]=20
Two test scenarios right? A bit of formatting..
Tests include:
- hash lookup on keys in ext bucket.
- hash delete causing key-shifts of keys from ext bucket to secondary bucke=
t.

>
>Suggested-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
>Signed-off-by: Dharmik Thakkar <dharmik.thakkar@arm.com>
>---
>+/*
>+ * Test lookup perf:
>+ * Reader(s) lookup keys present in the extendable bkt.
>+ */
>+static int
>+test_hash_add_ks_lookup_hit_extbkt(struct rwc_perf *rwc_perf_results,
>+				int rwc_lf, int htm, int ext_bkt)
>+{
>+	unsigned int n, m;
>+	uint64_t i;
>+	int use_jhash =3D 0;
>+	uint8_t write_type;
>+	uint8_t read_type =3D READ_PASS_KEY_SHIFTS_EXTBKT;
>+
>+	rte_atomic64_init(&greads);
>+	rte_atomic64_init(&gread_cycles);
>+
>+	if (init_params(rwc_lf, use_jhash, htm, ext_bkt) !=3D 0)
>+		goto err;
>+	printf("\nTest: Hash add - key-shifts, read - hit (ext_bkt)\n");
>+	for (m =3D 0; m < 2; m++) {
>+		if (m =3D=3D 1) {
>+			printf("\n** With bulk-lookup **\n");
>+			read_type |=3D BULK_LOOKUP;
>+		}
>+		for (n =3D 0; n < NUM_TEST; n++) {
>+			unsigned int tot_lcore =3D rte_lcore_count();
>+			if (tot_lcore < rwc_core_cnt[n] + 1)
>+				goto finish;
>+
>+			printf("\nNumber of readers: %u\n", rwc_core_cnt[n]);
>+
>+			rte_atomic64_clear(&greads);
>+			rte_atomic64_clear(&gread_cycles);
>+
>+			rte_hash_reset(tbl_rwc_test_param.h);
>+			write_type =3D WRITE_NO_KEY_SHIFT;
>+			if (write_keys(write_type) < 0)
>+				goto err;
>+			write_type =3D WRITE_KEY_SHIFT;
>+			if (write_keys(write_type) < 0)
>+				goto err;
>+			writer_done =3D 0;
>+			for (i =3D 1; i <=3D rwc_core_cnt[n]; i++)
>+				rte_eal_remote_launch(test_rwc_reader,
>+						(void *)(uintptr_t)read_type,
>+							enabled_core_ids[i]);
>+			for (i =3D 0; i < tbl_rwc_test_param.count_keys_ks_extbkt;
>+			     i++) {
>+				if (rte_hash_del_key(tbl_rwc_test_param.h,
>+					tbl_rwc_test_param.keys_ks_extbkt + i)
>+							< 0) {
>+					printf("Delete Failed: %u\n",
>+					tbl_rwc_test_param.keys_ks_extbkt[i]);
>+					goto err;
>+				}
>+			}
>+			writer_done =3D 1;
>+			rte_eal_mp_wait_lcore();
[Wang, Yipeng] Not requirement for this perf patch, but is it better to rea=
d the shifted key again
Just to verify the logic? If not difficult please add.