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 16CC1A04F3; Thu, 2 Jan 2020 18:03:50 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 71ADE1C12C; Thu, 2 Jan 2020 18:03:49 +0100 (CET) Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by dpdk.org (Postfix) with ESMTP id 49AC71C126 for ; Thu, 2 Jan 2020 18:03:47 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 02 Jan 2020 09:03:47 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.69,387,1571727600"; d="scan'208";a="252311191" Received: from fmsmsx108.amr.corp.intel.com ([10.18.124.206]) by fmsmga002.fm.intel.com with ESMTP; 02 Jan 2020 09:03:47 -0800 Received: from fmsmsx156.amr.corp.intel.com (10.18.116.74) by FMSMSX108.amr.corp.intel.com (10.18.124.206) with Microsoft SMTP Server (TLS) id 14.3.439.0; Thu, 2 Jan 2020 09:03:46 -0800 Received: from FMSEDG002.ED.cps.intel.com (10.1.192.134) by fmsmsx156.amr.corp.intel.com (10.18.116.74) with Microsoft SMTP Server (TLS) id 14.3.439.0; Thu, 2 Jan 2020 09:03:46 -0800 Received: from NAM02-CY1-obe.outbound.protection.outlook.com (104.47.37.58) by edgegateway.intel.com (192.55.55.69) with Microsoft SMTP Server (TLS) id 14.3.439.0; Thu, 2 Jan 2020 09:03:46 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Z4Nd8ZXCTX7eGEXNwj6onR4r7t7+ZnROgFH+ON00z1+wy/G/l8JIz12y3In+OX/lO74MHPvVPr3Jm/V09wZkryF4iqMj6GwieE50vBszypOvmS0WnylkLsDtfwN+JpUAKOwVXSSzbbKmJU9wT5jM4EVZPdShMQqCg/TwzOfEasQfdxAp/Kt2ndk3Dp0SmSXHzxIqs9ZQYaFn8IweJE89/SV4qLRfYDNHzP7jL3erT1BjIUBteoyL9SVVS29y1giNCQMjakbSgiSltta1F2DxZLiu2aG0UbNWSQ2VxWhEEQyi7oOyvhX2lceqgDuPMEjbbpXweMeNJvqGMTO32QAwPg== 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=F+9InkYTUXl2CGe1D6HW0aXmfAs0u010P40qQXRgojw=; b=B837mrkP4CzF2OGu7QNGIaxasn0xFAZAFU+61Tdh+VFpw8L5u/c1Sbs2Ec1wOVmr3eT1phZqJTCmF7hmcjefD7ztDlWGYEhdiuzuNKgstT+Zb1kWjM9UiECPV0MWwLppG4HRrD+nrDUTdP2yNpHMPY9SvOD3DYwSqL14TYyawmDjZyS1OJtQ18G7AZqEdcBrTcDjymn3lvbqHqXiraPF4ZG2gzvY2L5oUXrLVYBw+BqMnVqdAOhQxwR5LA2dcZv6NF0TlDBfi19DTl4x/qcP0JjjMhiIghFt63s2CadfMkGWss4ORenWKLrnfmHt6+XkkLRuWoNxE614+mjkCWsuiQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel.onmicrosoft.com; s=selector2-intel-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=F+9InkYTUXl2CGe1D6HW0aXmfAs0u010P40qQXRgojw=; b=Xo0FfUDIYmgtIt7smWsYVxqvj9pcS/KY8TwcOq0j3cAl6V/18J4/IeD8TmFYRYbhdcSdg5VZdLcxY3K2Nn/rxRcFjE5CmY+K3eujI601NAP5pp0Z8+J/KiYKltGlk5lnZWag2NxIaWHQm1H0uLFUL5WCVPczZe4I5dIC5Zihs9o= Received: from SN6PR11MB2558.namprd11.prod.outlook.com (52.135.94.19) by SN6PR11MB3038.namprd11.prod.outlook.com (52.135.124.78) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2602.12; Thu, 2 Jan 2020 17:03:44 +0000 Received: from SN6PR11MB2558.namprd11.prod.outlook.com ([fe80::4d86:362a:13c3:8386]) by SN6PR11MB2558.namprd11.prod.outlook.com ([fe80::4d86:362a:13c3:8386%7]) with mapi id 15.20.2602.012; Thu, 2 Jan 2020 17:03:44 +0000 From: "Ananyev, Konstantin" To: Honnappa Nagarahalli , "olivier.matz@6wind.com" , "sthemmin@microsoft.com" , "jerinj@marvell.com" , "Richardson, Bruce" , "david.marchand@redhat.com" , "pbhagavatula@marvell.com" CC: "dev@dpdk.org" , "dharmik.thakkar@arm.com" , "ruifeng.wang@arm.com" , "gavin.hu@arm.com" , "nd@arm.com" Thread-Topic: [PATCH v7 10/17] test/ring: modify single element enq/deq perf test cases Thread-Index: AQHVtvBydPKi7S4R5U6NPLreQc9/yqfXq9Ag Date: Thu, 2 Jan 2020 17:03:44 +0000 Message-ID: References: <20190906190510.11146-1-honnappa.nagarahalli@arm.com> <20191220044524.32910-1-honnappa.nagarahalli@arm.com> <20191220044524.32910-11-honnappa.nagarahalli@arm.com> In-Reply-To: <20191220044524.32910-11-honnappa.nagarahalli@arm.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiNWM4ZmU2MWQtNzBiMy00ZWRhLWFiMTAtZmVlMmFmZjU5MjQ2IiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiRzNCTHZmVUlwUkNnQ2lvb1V5R1FVY0JNdEc1bUxFNVVmKzVmRGZWN3FuMUM2Vkd0SWdBSEp0K3NZSHVYRWdUdiJ9 dlp-product: dlpe-windows dlp-reaction: no-action dlp-version: 11.2.0.6 x-ctpclassification: CTP_NT authentication-results: spf=none (sender IP is ) smtp.mailfrom=konstantin.ananyev@intel.com; x-originating-ip: [192.198.151.189] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: c8092af0-02af-4cb1-8df8-08d78fa5b9eb x-ms-traffictypediagnostic: SN6PR11MB3038: x-ld-processed: 46c98d88-e344-4ed4-8496-4ed7712e255d,ExtAddr x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:2043; x-forefront-prvs: 0270ED2845 x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(376002)(346002)(396003)(136003)(39860400002)(366004)(189003)(199004)(51234002)(33656002)(7416002)(55016002)(8936002)(52536014)(81166006)(81156014)(8676002)(5660300002)(54906003)(4326008)(186003)(66556008)(66946007)(86362001)(64756008)(66446008)(66476007)(110136005)(26005)(76116006)(71200400001)(6506007)(2906002)(478600001)(7696005)(316002)(9686003)(21314003); DIR:OUT; SFP:1102; SCL:1; SRVR:SN6PR11MB3038; H:SN6PR11MB2558.namprd11.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: yo1tWshSCzd6HQhHD9mK2SQXLE6C+cE1s7pPnXl5wUokc9JaUyoFjidfmxh8fd+ipJC3RJ1C82T56PFh53Jm9/hMIO2av6n8Ilj4JAiQaJx40lBh1zoEQN8q5ERwyzs/9ED8iIpcSLGaZ98VwoBLBEF03jXt6c9T3oTP8QSWcmR1XVeJ5f4JLrsXuXvixSuQSACDPlrzCp8mec75At7RiGSdaTMm5e/ow79rUdh2OaahTMGnIwScD0SRKBpdgKu3jLn7a8dwgIHm9jtFWUJRj+QPdONlJoOT8WCNiWk7CWtjjMc03iSuhSy7PXf1RHta39Ne46Zw3ywK1fLdEe33RtSoMpbmP8m1PpRf24nqz+6m5X8LeAuHaeTqmsZUwo2V7krUFUQ/EdKExlVOfWjLilhF+GygI6AFqyMJrL6MF8/mTbzUf3r58dKJ5ukQIzJuIBtBir/dl4OwARbCW2+rkYYLXJiK5eK9uIhQzp6vOe9LJ8wDBM3bt8up3KOigZkeWC4/msjuSJqofTaXn4oGmQ== Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: c8092af0-02af-4cb1-8df8-08d78fa5b9eb X-MS-Exchange-CrossTenant-originalarrivaltime: 02 Jan 2020 17:03:44.5793 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: JtCEuwFM/Ppw4P8Mo/UE20d+rJCCu58NX/5thHKmzyPs3tJnwWP0tVuNCvnhENI7XNaCmQ0CEU68mM6UyPmVdaPB3OruLysDMalu9nPxU4g= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN6PR11MB3038 X-OriginatorOrg: intel.com Subject: Re: [dpdk-dev] [PATCH v7 10/17] test/ring: modify single element enq/deq perf test cases 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" >=20 > Add test cases to test rte_ring_xxx_elem APIs for single > element enqueue/dequeue test cases. >=20 > Signed-off-by: Honnappa Nagarahalli > Reviewed-by: Gavin Hu > --- > app/test/test_ring_perf.c | 100 ++++++++++++++++++++++++++++++-------- > 1 file changed, 80 insertions(+), 20 deletions(-) >=20 > diff --git a/app/test/test_ring_perf.c b/app/test/test_ring_perf.c > index 6c2aca483..5829718c1 100644 > --- a/app/test/test_ring_perf.c > +++ b/app/test/test_ring_perf.c > @@ -13,6 +13,7 @@ > #include >=20 > #include "test.h" > +#include "test_ring.h" >=20 > /* > * Ring > @@ -41,6 +42,35 @@ struct lcore_pair { >=20 > static volatile unsigned lcore_count =3D 0; >=20 > +static void > +test_ring_print_test_string(unsigned int api_type, int esize, > + unsigned int bsz, double value) > +{ > + if (esize =3D=3D -1) > + printf("legacy APIs"); > + else > + printf("elem APIs: element size %dB", esize); > + > + if (api_type =3D=3D TEST_RING_IGNORE_API_TYPE) > + return; > + > + if ((api_type & TEST_RING_N) =3D=3D TEST_RING_N) > + printf(": default enqueue/dequeue: "); > + else if ((api_type & TEST_RING_S) =3D=3D TEST_RING_S) > + printf(": SP/SC: "); > + else if ((api_type & TEST_RING_M) =3D=3D TEST_RING_M) > + printf(": MP/MC: "); > + > + if ((api_type & TEST_RING_SL) =3D=3D TEST_RING_SL) > + printf("single: "); > + else if ((api_type & TEST_RING_BL) =3D=3D TEST_RING_BL) > + printf("bulk (size: %u): ", bsz); > + else if ((api_type & TEST_RING_BR) =3D=3D TEST_RING_BR) > + printf("burst (size: %u): ", bsz); > + > + printf("%.2F\n", value); > +} > + > /**** Functions to analyse our core mask to get cores for different test= s ***/ >=20 > static int > @@ -335,32 +365,35 @@ run_on_all_cores(struct rte_ring *r) > * Test function that determines how long an enqueue + dequeue of a sing= le item > * takes on a single lcore. Result is for comparison with the bulk enq+d= eq. > */ > -static void > -test_single_enqueue_dequeue(struct rte_ring *r) > +static int > +test_single_enqueue_dequeue(struct rte_ring *r, const int esize, > + const unsigned int api_type) > { > - const unsigned iter_shift =3D 24; > - const unsigned iterations =3D 1< - unsigned i =3D 0; > + int ret; > + const unsigned int iter_shift =3D 24; > + const unsigned int iterations =3D 1 << iter_shift; > + unsigned int i =3D 0; > void *burst =3D NULL; >=20 > - const uint64_t sc_start =3D rte_rdtsc(); > - for (i =3D 0; i < iterations; i++) { > - rte_ring_sp_enqueue(r, burst); > - rte_ring_sc_dequeue(r, &burst); > - } > - const uint64_t sc_end =3D rte_rdtsc(); > + (void)ret; Here, and in few other places, looks redundant. > + /* alloc dummy object pointers */ > + burst =3D test_ring_calloc(1, esize); > + if (burst =3D=3D NULL) > + return -1; >=20 > - const uint64_t mc_start =3D rte_rdtsc(); > + const uint64_t start =3D rte_rdtsc(); > for (i =3D 0; i < iterations; i++) { > - rte_ring_mp_enqueue(r, burst); > - rte_ring_mc_dequeue(r, &burst); > + TEST_RING_ENQUEUE(r, burst, esize, 1, ret, api_type); > + TEST_RING_DEQUEUE(r, burst, esize, 1, ret, api_type); > } > - const uint64_t mc_end =3D rte_rdtsc(); > + const uint64_t end =3D rte_rdtsc(); > + > + test_ring_print_test_string(api_type, esize, 1, > + ((double)(end - start)) / iterations); > + > + rte_free(burst); >=20 > - printf("SP/SC single enq/dequeue: %.2F\n", > - ((double)(sc_end-sc_start)) / iterations); > - printf("MP/MC single enq/dequeue: %.2F\n", > - ((double)(mc_end-mc_start)) / iterations); > + return 0; > } >=20 > /*