[dpdk-dev] [PATCH v1 2/2] Test cases for rte_memcmp functions

Wang, Zhihong zhihong.wang at intel.com
Thu May 26 11:05:08 CEST 2016



> -----Original Message-----
> From: dev [mailto:dev-bounces at dpdk.org] On Behalf Of Ravi Kerur
> Sent: Tuesday, March 8, 2016 7:01 AM
> To: dev at dpdk.org
> Subject: [dpdk-dev] [PATCH v1 2/2] Test cases for rte_memcmp functions
> 
> v1:
>         This patch adds test cases for rte_memcmp functions.
>         New rte_memcmp functions can be tested via 'make test'
>         and 'testpmd' utility.
> 
>         Compiled and tested on Ubuntu 14.04(non-NUMA) and
>         15.10(NUMA) systems.
[...]

> +/************************************************************
> *******************
> + * Memcmp function performance test configuration section. Each performance
> test
> + * will be performed MEMCMP_ITERATIONS times.
> + *
> + * The five arrays below control what tests are performed. Every combination
> + * from the array entries is tested.
> + */
> +#define MEMCMP_ITERATIONS (500 * 500 * 500)


Maybe less iteration will make the test faster without compromise precison?


> +
> +static size_t memcmp_sizes[] = {
> +	2, 5, 8, 9, 15, 16, 17, 31, 32, 33, 63, 64, 65, 127, 128,
> +	129, 191, 192, 193, 255, 256, 257, 319, 320, 321, 383, 384,
> +	385, 447, 448, 449, 511, 512, 513, 767, 768, 769, 1023, 1024,
> +	1025, 1522, 1536, 1600, 2048, 2560, 3072, 3584, 4096, 4608,
> +	5632, 6144, 6656, 7168, 7680, 8192, 16834
> +};
> +
[...]
> +/*
> + * Do all performance tests.
> + */
> +static int
> +test_memcmp_perf(void)
> +{
> +	if (run_all_memcmp_eq_perf_tests() != 0)
> +		return -1;
> +
> +	if (run_all_memcmp_gt_perf_tests() != 0)
> +		return -1;
> +
> +	if (run_all_memcmp_lt_perf_tests() != 0)
> +		return -1;
> +


Perhaps unaligned test cases are needed here.
How do you think?


> +
> +	return 0;
> +}
> +
> +static struct test_command memcmp_perf_cmd = {
> +	.command = "memcmp_perf_autotest",
> +	.callback = test_memcmp_perf,
> +};
> +REGISTER_TEST_COMMAND(memcmp_perf_cmd);
> --
> 1.9.1



More information about the dev mailing list