[dpdk-dev] [PATCH v2 4/6] test: add test case for read write concurrency

De Lara Guarch, Pablo pablo.de.lara.guarch at intel.com
Fri Jul 6 19:31:25 CEST 2018



> -----Original Message-----
> From: Wang, Yipeng1
> Sent: Friday, June 29, 2018 1:25 PM
> To: De Lara Guarch, Pablo <pablo.de.lara.guarch at intel.com>
> Cc: dev at dpdk.org; Wang, Yipeng1 <yipeng1.wang at intel.com>; Richardson,
> Bruce <bruce.richardson at intel.com>; honnappa.nagarahalli at arm.com;
> vguvva at caviumnetworks.com; brijesh.s.singh at gmail.com
> Subject: [PATCH v2 4/6] test: add test case for read write concurrency
> 
> This commits add a new test case for testing read/write concurrency.
> 
> Signed-off-by: Yipeng Wang <yipeng1.wang at 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
> 
> diff --git a/test/test/Makefile b/test/test/Makefile index eccc8ef..6ce66c9
> 100644
> --- a/test/test/Makefile
> +++ b/test/test/Makefile
> @@ -113,6 +113,7 @@ SRCS-$(CONFIG_RTE_LIBRTE_HASH) +=
> test_hash_perf.c
>  SRCS-$(CONFIG_RTE_LIBRTE_HASH) += test_hash_functions.c
>  SRCS-$(CONFIG_RTE_LIBRTE_HASH) += test_hash_scaling.c
>  SRCS-$(CONFIG_RTE_LIBRTE_HASH) += test_hash_multiwriter.c
> +SRCS-$(CONFIG_RTE_LIBRTE_HASH) += test_hash_readwrite.c
> 
>  SRCS-$(CONFIG_RTE_LIBRTE_LPM) += test_lpm.c
>  SRCS-$(CONFIG_RTE_LIBRTE_LPM) += test_lpm_perf.c diff --git
> a/test/test/test_hash_readwrite.c b/test/test/test_hash_readwrite.c new file
> 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] = {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) >= 0) {
> +		/* Search for the key in the list of keys added .*/
> +		i = *(const uint32_t *)next_key;
> +		tbl_rw_test_param.found[i]++;
> +	}
> +
> +	for (i = 0;
> +		i < tbl_rw_test_param.rounded_tot_insert; i++) {

This can go in a single line.

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

...

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

This can go in a single line.



More information about the dev mailing list