From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <pablo.de.lara.guarch@intel.com>
Received: from mga01.intel.com (mga01.intel.com [192.55.52.88])
 by dpdk.org (Postfix) with ESMTP id 997621B904
 for <dev@dpdk.org>; Fri,  6 Jul 2018 19:31:28 +0200 (CEST)
X-Amp-Result: SKIPPED(no attachment in message)
X-Amp-File-Uploaded: False
Received: from fmsmga001.fm.intel.com ([10.253.24.23])
 by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;
 06 Jul 2018 10:31:27 -0700
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="5.51,317,1526367600"; d="scan'208";a="70210671"
Received: from irsmsx101.ger.corp.intel.com ([163.33.3.153])
 by fmsmga001.fm.intel.com with ESMTP; 06 Jul 2018 10:31:26 -0700
Received: from irsmsx108.ger.corp.intel.com ([169.254.11.139]) by
 IRSMSX101.ger.corp.intel.com ([169.254.1.185]) with mapi id 14.03.0319.002;
 Fri, 6 Jul 2018 18:31:26 +0100
From: "De Lara Guarch, Pablo" <pablo.de.lara.guarch@intel.com>
To: "Wang, Yipeng1" <yipeng1.wang@intel.com>
CC: "dev@dpdk.org" <dev@dpdk.org>, "Richardson, Bruce"
 <bruce.richardson@intel.com>, "honnappa.nagarahalli@arm.com"
 <honnappa.nagarahalli@arm.com>, "vguvva@caviumnetworks.com"
 <vguvva@caviumnetworks.com>, "brijesh.s.singh@gmail.com"
 <brijesh.s.singh@gmail.com>
Thread-Topic: [PATCH v2 4/6] test: add test case for read write concurrency
Thread-Index: AQHUD9/PsYjmlBKoxEOojcyRDczxYaSCe7fA
Date: Fri, 6 Jul 2018 17:31:25 +0000
Message-ID: <E115CCD9D858EF4F90C690B0DCB4D8977F8E6C0B@IRSMSX108.ger.corp.intel.com>
References: <1528455078-328182-1-git-send-email-yipeng1.wang@intel.com>
 <1530275097-123488-1-git-send-email-yipeng1.wang@intel.com>
 <1530275097-123488-5-git-send-email-yipeng1.wang@intel.com>
In-Reply-To: <1530275097-123488-5-git-send-email-yipeng1.wang@intel.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiYzhlNDYwNzEtZTE0NS00OGE2LTllZDQtMTY1NWZiYzEyNDMyIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoidk1IZ1VVbDl6aXVLSExHcEdmQ0s1ZWxncTBaenYyamFiVm5qY1phdW51dkY4XC9QT1dJRFlvYm1FVlEyUnVDRlEifQ==
x-ctpclassification: CTP_NT
dlp-product: dlpe-windows
dlp-version: 11.0.200.100
dlp-reaction: no-action
x-originating-ip: [163.33.239.180]
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0
Subject: Re: [dpdk-dev] [PATCH v2 4/6] test: add test case for read write
	concurrency
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: Fri, 06 Jul 2018 17:31:29 -0000



> -----Original Message-----
> From: Wang, Yipeng1
> Sent: Friday, June 29, 2018 1:25 PM
> To: De Lara Guarch, Pablo <pablo.de.lara.guarch@intel.com>
> Cc: dev@dpdk.org; Wang, Yipeng1 <yipeng1.wang@intel.com>; Richardson,
> Bruce <bruce.richardson@intel.com>; honnappa.nagarahalli@arm.com;
> vguvva@caviumnetworks.com; brijesh.s.singh@gmail.com
> Subject: [PATCH v2 4/6] test: add test case for read write concurrency
>=20
> This commits add a new test case for testing read/write concurrency.
>=20
> Signed-off-by: Yipeng Wang <yipeng1.wang@intel.com>
> ---
>  test/test/Makefile              |   1 +
>  test/test/test_hash_readwrite.c | 645
> ++++++++++++++++++++++++++++++++++++++++
>  2 files changed, 646 insertions(+)
>  create mode 100644 test/test/test_hash_readwrite.c
>=20
> diff --git a/test/test/Makefile b/test/test/Makefile index eccc8ef..6ce66=
c9
> 100644
> --- a/test/test/Makefile
> +++ b/test/test/Makefile
> @@ -113,6 +113,7 @@ SRCS-$(CONFIG_RTE_LIBRTE_HASH) +=3D
> test_hash_perf.c
>  SRCS-$(CONFIG_RTE_LIBRTE_HASH) +=3D test_hash_functions.c
>  SRCS-$(CONFIG_RTE_LIBRTE_HASH) +=3D test_hash_scaling.c
>  SRCS-$(CONFIG_RTE_LIBRTE_HASH) +=3D test_hash_multiwriter.c
> +SRCS-$(CONFIG_RTE_LIBRTE_HASH) +=3D test_hash_readwrite.c
>=20
>  SRCS-$(CONFIG_RTE_LIBRTE_LPM) +=3D test_lpm.c
>  SRCS-$(CONFIG_RTE_LIBRTE_LPM) +=3D test_lpm_perf.c diff --git
> a/test/test/test_hash_readwrite.c b/test/test/test_hash_readwrite.c new f=
ile
> mode 100644 index 0000000..db2ded5
> --- /dev/null
> +++ b/test/test/test_hash_readwrite.c
> @@ -0,0 +1,645 @@
> +/* SPDX-License-Identifier: BSD-3-Clause
> + * Copyright(c) 2018 Intel Corporation
> + */
> +
> +#include <inttypes.h>
> +#include <locale.h>
> +
> +#include <rte_cycles.h>
> +#include <rte_hash.h>
> +#include <rte_hash_crc.h>
> +#include <rte_launch.h>
> +#include <rte_malloc.h>
> +#include <rte_random.h>
> +#include <rte_spinlock.h>
> +
> +#include "test.h"
> +
> +
> +#define RTE_RWTEST_FAIL 0
> +
> +#define TOTAL_ENTRY (16*1024*1024)
> +#define TOTAL_INSERT (15*1024*1024)
> +
> +#define NUM_TEST 3
> +unsigned int core_cnt[NUM_TEST] =3D {2, 4, 8};
> +
> +

General comment. Remove extra blank lines (one is enough).

...

> +	while (rte_hash_iterate(tbl_rw_test_param.h, &next_key,
> +			&next_data, &iter) >=3D 0) {
> +		/* Search for the key in the list of keys added .*/
> +		i =3D *(const uint32_t *)next_key;
> +		tbl_rw_test_param.found[i]++;
> +	}
> +
> +	for (i =3D 0;
> +		i < tbl_rw_test_param.rounded_tot_insert; i++) {

This can go in a single line.

> +		if (tbl_rw_test_param.keys[i] !=3D RTE_RWTEST_FAIL) {
> +			if (tbl_rw_test_param.found[i] > 1) {
> +				duplicated_keys++;
> +				break;

...

> +
> +		for (i =3D 0; i <
> +			tbl_rw_test_param.rounded_tot_insert; i++) {

This can go in a single line.