From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 0158FA0350; Wed, 1 Jul 2020 01:01:28 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 42F3D1BF7B; Wed, 1 Jul 2020 01:01:28 +0200 (CEST) Received: from EUR05-VI1-obe.outbound.protection.outlook.com (mail-vi1eur05on2069.outbound.protection.outlook.com [40.107.21.69]) by dpdk.org (Postfix) with ESMTP id A7A091BF76 for ; Wed, 1 Jul 2020 01:01:26 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=oaTQzEuQ/VG6uRqNdzAyriYFIwCcBpwY+GrrmY/iH7k=; b=6cL+ZvElNuGOwV+JP99HBKFynp5p2IgPYW7tNM5ojc9P6oSD8E1PaCw412vQhk8Ju0CD6XvUK87pRiiD7i7St9mBhJvAxZFt7g0ikgaoGRFSW7/GQ0KLYP9Uy5IT8cf15dmdMflq4GGlSQUryzDKfzwtwf2H2BPze5DfQm/BaOQ= Received: from AM5PR0101CA0036.eurprd01.prod.exchangelabs.com (2603:10a6:206:16::49) by VI1PR08MB3309.eurprd08.prod.outlook.com (2603:10a6:803:41::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3131.24; Tue, 30 Jun 2020 23:01:25 +0000 Received: from VE1EUR03FT027.eop-EUR03.prod.protection.outlook.com (2603:10a6:206:16:cafe::8f) by AM5PR0101CA0036.outlook.office365.com (2603:10a6:206:16::49) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3131.21 via Frontend Transport; Tue, 30 Jun 2020 23:01:25 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; dpdk.org; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;dpdk.org; dmarc=bestguesspass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 63.35.35.123 as permitted sender) receiver=protection.outlook.com; client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com; Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by VE1EUR03FT027.mail.protection.outlook.com (10.152.18.154) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3131.20 via Frontend Transport; Tue, 30 Jun 2020 23:01:24 +0000 Received: ("Tessian outbound 7fd8d0809508:v61"); Tue, 30 Jun 2020 23:01:24 +0000 X-CR-MTA-TID: 64aa7808 Received: from 3f68783788d1.3 by 64aa7808-outbound-1.mta.getcheckrecipient.com id B96159FF-B6E8-4DBD-8C38-AEA5E2C62F7E.1; Tue, 30 Jun 2020 23:01:19 +0000 Received: from EUR03-AM5-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 3f68783788d1.3 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Tue, 30 Jun 2020 23:01:19 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=eoOkLFeZeMZz06YJPDq/gC3AUxWsVY9yJM7x4RYbXE9XExP2JLLXsLC05cfMv91CwB71DiGB4yTx56z4JP9FhgaBGuiIn/WiCxu8sutoMFQAz9AhAo7zIK3/LEkTkpGz6aa9uFNiGwkKzLv5bXXoQ1Q8ZGyA8Sx9BtNkHA0kOXtA2FsFdQUL3rzzwQtz23/eCFH2cXmgmQXM3OepccBbb7JoAiLSsROfCBpWkLpr/3pvRN7taSDvAjEi6rqpQw5DoTXE8SXpJ5wzFbMrwF3LyVGqK1Wg7y+iSnlwWElAz8J7z5r5+yxDIuoheRxJdlAvlT7hH2yTvHG7xd5EdfGB3A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=oaTQzEuQ/VG6uRqNdzAyriYFIwCcBpwY+GrrmY/iH7k=; b=hgyZQdHIHRF/q0oXmjCeoHxtqfdOfneiwkwRPwVG7q2vzeW9lAqdRxdNFs4nysxk6vMYALvBkMLBBTC3uTMzJwmFw0bFC5nznjHPviGcu6YyxEbosWphGJxL/OH4mpDMVBeYFGctX6PygSjFlG7xMLmosOORdhpv8RWWlWE5PNZsthpt6Pm8xZdpqqhleRRvwLXB3DtpoQZmmnhJm/DID8xAHPp7oz5yyE5sOIXC7/hejcBmIXM+W/+wqi2ISCMWr73JpOwlHNn4gq0+XpahtAXmgpn0W7cSE2Ypewg65d9Bnn3gEDFNGOsPag3Svg6vYAedW+OR10JmIn1oimBzcQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=oaTQzEuQ/VG6uRqNdzAyriYFIwCcBpwY+GrrmY/iH7k=; b=6cL+ZvElNuGOwV+JP99HBKFynp5p2IgPYW7tNM5ojc9P6oSD8E1PaCw412vQhk8Ju0CD6XvUK87pRiiD7i7St9mBhJvAxZFt7g0ikgaoGRFSW7/GQ0KLYP9Uy5IT8cf15dmdMflq4GGlSQUryzDKfzwtwf2H2BPze5DfQm/BaOQ= Received: from AM4PR0802MB2212.eurprd08.prod.outlook.com (2603:10a6:200:59::8) by AM0PR08MB5540.eurprd08.prod.outlook.com (2603:10a6:208:144::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3131.23; Tue, 30 Jun 2020 23:01:16 +0000 Received: from AM4PR0802MB2212.eurprd08.prod.outlook.com ([fe80::9130:1e61:ef03:c4e1]) by AM4PR0802MB2212.eurprd08.prod.outlook.com ([fe80::9130:1e61:ef03:c4e1%3]) with mapi id 15.20.3131.028; Tue, 30 Jun 2020 23:01:16 +0000 From: Honnappa Nagarahalli To: Konstantin Ananyev , "dev@dpdk.org" CC: Feifei Wang , Honnappa Nagarahalli , nd , nd Thread-Topic: [PATCH] test/ring: add stress test for ST peek API Thread-Index: AQHWTvqxVSFwpX8xa0e1Pc5gOO0NEajxwWQg Date: Tue, 30 Jun 2020 23:01:16 +0000 Message-ID: References: <20200630162139.19512-1-konstantin.ananyev@intel.com> In-Reply-To: <20200630162139.19512-1-konstantin.ananyev@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ts-tracking-id: cb24ea1c-de05-4bc6-8ad1-036115ffda81.0 x-checkrecipientchecked: true Authentication-Results-Original: intel.com; dkim=none (message not signed) header.d=none;intel.com; dmarc=none action=none header.from=arm.com; x-originating-ip: [70.112.90.121] x-ms-publictraffictype: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: c301a060-98fc-4b6a-39f5-08d81d498395 x-ms-traffictypediagnostic: AM0PR08MB5540:|VI1PR08MB3309: x-ms-exchange-transport-forked: True X-Microsoft-Antispam-PRVS: x-checkrecipientrouted: true nodisclaimer: true x-ms-oob-tlc-oobclassifiers: OLM:4714;OLM:4714; x-forefront-prvs: 0450A714CB X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: K3JUB2l0/2gGiKY6oG+/MSQtLGYv2/j5THIfp0yllnv8fjqSrhGBGNCv0TIAoJHIBnfu4fEmNsGTPcV5A/xXmGysoDlt0PHmtELVCcJb6d3n3tFBJZNNusfj7gvyrGcz3Wv/M+TqSSO+b1wKI/MC1QVW9nSo6lm4CI2G1Kp/qh19Je7XX76yC+mpfT9fueEGBKa8vkPzE2V5XFjQlwV6pkgVqqhxUtR7M49YOzPKLqFoxof+KH9CObmV4RL3wUbjInyVMOTEBn1acKa/bFOnHW7salnV7DMax81AhUn+re/wGQx4dgSrKRxj42/39rZI/ZUmHzrI6sTUKebiGzc5rGFM0WkTiz9G0JP4ltj8Astv8PPIknWh+zvIBh0gwF4YXKmJwdxj7O35X2lb2TI23w== X-Forefront-Antispam-Report-Untrusted: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AM4PR0802MB2212.eurprd08.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(4636009)(39860400002)(376002)(346002)(136003)(396003)(366004)(7696005)(26005)(83380400001)(8676002)(8936002)(76116006)(2906002)(52536014)(186003)(9686003)(5660300002)(55016002)(478600001)(66946007)(66476007)(66556008)(64756008)(66446008)(6506007)(33656002)(4326008)(54906003)(110136005)(316002)(71200400001)(86362001); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata: 7TjkiyonPy8sX5JEgJcHS96cAzN8tNX1a9liCcGd1oVJwC3CLn0TFfWD5kmjNcEu8QivboLizNeoMPVbw6fjySvX4sW9cfDlLBql17nPG/MIe3q6Q3DfF6/ULSiwXH51YAVvlnqNukP5de87JGMOMZz4wHxwlrqO3deS/n1rM+d6yCdf7E5sDg8hK22yZVKlsUNGre/vkQmg5iUz1ItcrMtmukZ1A8/DEIQ4r71IEwH1Km3KoR9BYlJl+esrBBGHIC0DSLEpFMbwxaYpNawRRhYJUvUWg/+CkbzM9dhICIqTk+1uvI2/JML9SiQQ6ucv9NXKTeQgQDTcnWRgMbsADU5ldsN1e3gzLkn/ylu50667muHJgQTXONH6HePVNMC/GbwJzPMiZ5MJaQjyYyRz7wQXWbi/4wO1uGDALW+HHBAlP6YJj5kvfUuMFyNgy0RidHWXWfEJAC95Lcxo4iU301NIw1Qwo9RPYDG8uxtxJ1WcomWGnQxH2hG3NShG3gJ2 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR08MB5540 Original-Authentication-Results: intel.com; dkim=none (message not signed) header.d=none;intel.com; dmarc=none action=none header.from=arm.com; X-EOPAttributedMessage: 0 X-MS-Exchange-Transport-CrossTenantHeadersStripped: VE1EUR03FT027.eop-EUR03.prod.protection.outlook.com X-Forefront-Antispam-Report: CIP:63.35.35.123; CTRY:IE; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:64aa7808-outbound-1.mta.getcheckrecipient.com; PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com; CAT:NONE; SFTY:; SFS:(4636009)(376002)(346002)(39860400002)(396003)(136003)(46966005)(70206006)(86362001)(316002)(36906005)(2906002)(82740400003)(70586007)(82310400002)(356005)(54906003)(4326008)(8676002)(81166007)(33656002)(7696005)(110136005)(26005)(478600001)(9686003)(186003)(47076004)(336012)(8936002)(83380400001)(6506007)(55016002)(52536014)(5660300002); DIR:OUT; SFP:1101; X-MS-Office365-Filtering-Correlation-Id-Prvs: b05fc08c-6613-4fdf-8316-08d81d497e94 X-Forefront-PRVS: 0450A714CB X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: nBQ+TJnzkNi29WhZxKNO2r2SRanqgeHxo2CtB1G1S6dnZsPJMCCEK8U0CvU6HBmTt6/qO7oZtj+URNn/MUWSBa3DyvL9UYw1CjramiPqO5vc+Tga56WZuL2Fbn0DaPoGxGeRO9fcFBwjbVQYqTyY2zTXnvjcH4TP5AQH1mwVjdcLZbrIRdNepb1jp0spKyPXJ87COkpY4r93Q8AHfptmuONq2cHnfvQh4BHAE/hxxNQBFhque+IXg5ZEYMuXXK52itXZpyVQUWt878tWRWIJC0jpqvqFR8jqhCpeWJSHINhvXRVlf6nMlA6HKufTvPkPZEWOHDrAk/D2ScwVsVeVr+/CVvpJ8vCeJr2v1SA17NfhbMq2UWS7A3Kg1fLvcay09cSuBWQ7Qx1s0zOer19pcU4aSlGI0okeDA77FXDig/VPrP0ekHh0/otgKTXLZjm7Hy5aohPgz0DCYEgd6l2xirEgjSNveU/SznzGqnVobDA= X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Jun 2020 23:01:24.9048 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: c301a060-98fc-4b6a-39f5-08d81d498395 X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d; Ip=[63.35.35.123]; Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com] X-MS-Exchange-CrossTenant-AuthSource: VE1EUR03FT027.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR08MB3309 Subject: Re: [dpdk-dev] [PATCH] test/ring: add stress test for ST peek API X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Hi Konstantin, It looks fine overall, few comments inline. > Subject: [PATCH] test/ring: add stress test for ST peek API >=20 > Introduce new test case to test ST peek API. >=20 > Signed-off-by: Konstantin Ananyev > --- >=20 > This patch depends on the following patch: > "ring: fix error vlaue of tail in the peek API for ST mode" > (http://patches.dpdk.org/patch/72374/) > to run successfully. >=20 > app/test/Makefile | 1 + > app/test/meson.build | 1 + > app/test/test_ring_st_peek_stress.c | 54 +++++++++++++++++++++++++++++ > app/test/test_ring_stress.c | 3 ++ > app/test/test_ring_stress.h | 1 + > 5 files changed, 60 insertions(+) > create mode 100644 app/test/test_ring_st_peek_stress.c >=20 > diff --git a/app/test/Makefile b/app/test/Makefile index > 7b96a03a6..37bdaf891 100644 > --- a/app/test/Makefile > +++ b/app/test/Makefile > @@ -83,6 +83,7 @@ SRCS-y +=3D test_ring_hts_stress.c SRCS-y +=3D > test_ring_perf.c SRCS-y +=3D test_ring_peek_stress.c SRCS-y +=3D > test_ring_rts_stress.c > +SRCS-y +=3D test_ring_st_peek_stress.c > SRCS-y +=3D test_ring_stress.c > SRCS-y +=3D test_pmd_perf.c >=20 > diff --git a/app/test/meson.build b/app/test/meson.build index > 5233ead46..4ec7da6b2 100644 > --- a/app/test/meson.build > +++ b/app/test/meson.build > @@ -108,6 +108,7 @@ test_sources =3D files('commands.c', > 'test_ring_peek_stress.c', > 'test_ring_perf.c', > 'test_ring_rts_stress.c', > + 'test_ring_st_peek_stress.c', I think we should rename test_ring_peek_stress.c to test_ring_mpmc_hts_peek= _stress.c to be consistent with this? > 'test_ring_stress.c', > 'test_rwlock.c', > 'test_sched.c', > diff --git a/app/test/test_ring_st_peek_stress.c > b/app/test/test_ring_st_peek_stress.c > new file mode 100644 > index 000000000..bc573de47 > --- /dev/null > +++ b/app/test/test_ring_st_peek_stress.c > @@ -0,0 +1,54 @@ > +/* SPDX-License-Identifier: BSD-3-Clause > + * Copyright(c) 2020 Intel Corporation > + */ > + > +#include "test_ring_stress_impl.h" > +#include > + > +static inline uint32_t > +_st_ring_dequeue_bulk(struct rte_ring *r, void **obj, uint32_t n, > + uint32_t *avail) > +{ > + uint32_t m; > + > + static rte_spinlock_t lck =3D RTE_SPINLOCK_INITIALIZER; > + > + rte_spinlock_lock(&lck); > + > + m =3D rte_ring_dequeue_bulk_start(r, obj, n, avail); > + n =3D (m =3D=3D n) ? n : 0; > + rte_ring_dequeue_finish(r, n); > + > + rte_spinlock_unlock(&lck); > + return n; > +} > + > +static inline uint32_t > +_st_ring_enqueue_bulk(struct rte_ring *r, void * const *obj, uint32_t n, > + uint32_t *free) > +{ > + uint32_t m; > + > + static rte_spinlock_t lck =3D RTE_SPINLOCK_INITIALIZER; > + > + rte_spinlock_lock(&lck); > + > + m =3D rte_ring_enqueue_bulk_start(r, n, free); > + n =3D (m =3D=3D n) ? n : 0; > + rte_ring_enqueue_finish(r, obj, n); > + > + rte_spinlock_unlock(&lck); > + return n; > +} > + > +static int > +_st_ring_init(struct rte_ring *r, const char *name, uint32_t num) { > + return rte_ring_init(r, name, num, RING_F_SP_ENQ | > RING_F_SC_DEQ); } > + > +const struct test test_ring_st_peek_stress =3D { > + .name =3D "ST_PEEK", > + .nb_case =3D RTE_DIM(tests), > + .cases =3D tests, > +}; > diff --git a/app/test/test_ring_stress.c b/app/test/test_ring_stress.c in= dex > 853fcc190..387cfa747 100644 > --- a/app/test/test_ring_stress.c > +++ b/app/test/test_ring_stress.c > @@ -49,6 +49,9 @@ test_ring_stress(void) > n +=3D test_ring_peek_stress.nb_case; > k +=3D run_test(&test_ring_peek_stress); >=20 > + n +=3D test_ring_st_peek_stress.nb_case; > + k +=3D run_test(&test_ring_st_peek_stress); > + > printf("Number of tests:\t%u\nSuccess:\t%u\nFailed:\t%u\n", > n, k, n - k); > return (k !=3D n); > diff --git a/app/test/test_ring_stress.h b/app/test/test_ring_stress.h in= dex > 60953ce47..a9a390341 100644 > --- a/app/test/test_ring_stress.h > +++ b/app/test/test_ring_stress.h > @@ -36,3 +36,4 @@ extern const struct test test_ring_mpmc_stress; extern > const struct test test_ring_rts_stress; extern const struct test > test_ring_hts_stress; extern const struct test test_ring_peek_stress; > +extern const struct test test_ring_st_peek_stress; > -- > 2.17.1