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

Wang, Zhihong zhihong.wang at intel.com
Tue Jun 7 13:09:12 CEST 2016



> -----Original Message-----
> From: Ravi Kerur [mailto:rkerur at gmail.com]
> Sent: Tuesday, June 7, 2016 2:32 AM
> To: Wang, Zhihong <zhihong.wang at intel.com>; Thomas Monjalon
> <thomas.monjalon at 6wind.com>
> Cc: dev at dpdk.org
> Subject: Re: [dpdk-dev] [PATCH v1 2/2] Test cases for rte_memcmp functions
> 
> Zhilong, Thomas,
> 
> If there is enough interest within DPDK community I can work on adding support
> for 'unaligned access' and 'test cases' for it. Please let me know either way.
> 


Hi Ravi,

This rte_memcmp is proved with better performance than glibc's in aligned
cases, I think it has good value to DPDK lib.

Though we don't have memcmp in critical pmd data path, it offers a better
choice for applications who do.


Thanks
Zhihong


> Thanks,
> Ravi
> 
> 
> On Thu, May 26, 2016 at 2:05 AM, Wang, Zhihong <zhihong.wang at intel.com>
> wrote:
> 
> 
> > -----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