From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Wiles, Keith" Subject: Re: [PATCH v2 1/2] test/test: introduce new test-case for rte_smp_mb() Date: Sat, 13 Jan 2018 13:54:16 +0000 Message-ID: <26167454-CC6E-44DF-9469-B7C24389BA65@intel.com> References: <1512126771-27503-2-git-send-email-konstantin.ananyev@intel.com> <1513611253-8785-2-git-send-email-konstantin.ananyev@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Cc: "dev@dpdk.org" To: "Ananyev, Konstantin" Return-path: Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by dpdk.org (Postfix) with ESMTP id 5F879A48F for ; Sat, 13 Jan 2018 14:54:17 +0100 (CET) In-Reply-To: <1513611253-8785-2-git-send-email-konstantin.ananyev@intel.com> Content-Language: en-US Content-ID: <40B7B0D7A640B94CA87D585BF2651C73@intel.com> List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" > On Dec 18, 2017, at 9:34 AM, Konstantin Ananyev wrote: >=20 > Simple functional test for rte_smp_mb() implementations. > Also when executed on a single lcore could be used as rough > estimation how many cycles particular implementation of rte_smp_mb() > might take. >=20 > Signed-off-by: Konstantin Ananyev > --- > test/test/Makefile | 1 + > test/test/test_mb.c | 315 +++++++++++++++++++++++++++++++++++++++++++++++= +++++ > 2 files changed, 316 insertions(+) > create mode 100644 test/test/test_mb.c >=20 > diff --git a/test/test/Makefile b/test/test/Makefile > index bb54c9808..3134283a8 100644 > --- a/test/test/Makefile > +++ b/test/test/Makefile > @@ -95,6 +95,7 @@ SRCS-y +=3D test_spinlock.c > SRCS-y +=3D test_memory.c > SRCS-y +=3D test_memzone.c > SRCS-y +=3D test_bitmap.c > +SRCS-y +=3D test_mb.c >=20 > SRCS-y +=3D test_ring.c > SRCS-y +=3D test_ring_perf.c > diff --git a/test/test/test_mb.c b/test/test/test_mb.c > new file mode 100644 > index 000000000..52c73fb6b > --- /dev/null > +++ b/test/test/test_mb.c > @@ -0,0 +1,315 @@ > +/*- > + * BSD LICENSE > + * > + * Copyright(c) 2010-2017 Intel Corporation. All rights reserved. > + * All rights reserved. > + * > + * Redistribution and use in source and binary forms, with or without > + * modification, are permitted provided that the following conditions > + * are met: > + * > + * * Redistributions of source code must retain the above copyright > + * notice, this list of conditions and the following disclaimer. > + * * Redistributions in binary form must reproduce the above copyrig= ht > + * notice, this list of conditions and the following disclaimer in > + * the documentation and/or other materials provided with the > + * distribution. > + * * Neither the name of Intel Corporation nor the names of its > + * contributors may be used to endorse or promote products derived > + * from this software without specific prior written permission. > + * > + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS > + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT > + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS F= OR > + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGH= T > + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTA= L, > + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT > + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF US= E, > + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON A= NY > + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT > + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE U= SE > + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE= . > + */ SPDX header should be used, correct? > + > + /* > + * This is a simple functional test for rte_smp_mb() implementation. > + * I.E. make sure that LOAD and STORE operations that precede the > + * rte_smp_mb() call are globally visible across the lcores > + * before the the LOAD and STORE operations that follows it. > + * The test uses simple implementation of Peterson's lock algorithm > + * (https://en.wikipedia.org/wiki/Peterson%27s_algorithm) > + * for two execution units to make sure that rte_smp_mb() prevents > + * store-load reordering to happen. > + * Also when executed on a single lcore could be used as a approxiamate > + * estimation of number of cycles particular implementation of rte_smp_= mb() > + * will take. > + */ > + >=20 Regards, Keith