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 471EEA04F3; Tue, 7 Jan 2020 17:13:19 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 6F5311D9F1; Tue, 7 Jan 2020 17:13:18 +0100 (CET) Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by dpdk.org (Postfix) with ESMTP id 9FB4B1D56B for ; Tue, 7 Jan 2020 17:13:16 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 07 Jan 2020 08:13:15 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.69,406,1571727600"; d="scan'208";a="395415380" Received: from fmsmsx107.amr.corp.intel.com ([10.18.124.205]) by orsmga005.jf.intel.com with ESMTP; 07 Jan 2020 08:13:15 -0800 Received: from fmsmsx608.amr.corp.intel.com (10.18.126.88) by fmsmsx107.amr.corp.intel.com (10.18.124.205) with Microsoft SMTP Server (TLS) id 14.3.439.0; Tue, 7 Jan 2020 08:13:15 -0800 Received: from fmsmsx608.amr.corp.intel.com (10.18.126.88) by fmsmsx608.amr.corp.intel.com (10.18.126.88) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Tue, 7 Jan 2020 08:13:14 -0800 Received: from FMSEDG001.ED.cps.intel.com (10.1.192.133) by fmsmsx608.amr.corp.intel.com (10.18.126.88) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.1.1713.5 via Frontend Transport; Tue, 7 Jan 2020 08:13:14 -0800 Received: from NAM11-CO1-obe.outbound.protection.outlook.com (104.47.56.172) by edgegateway.intel.com (192.55.55.68) with Microsoft SMTP Server (TLS) id 14.3.439.0; Tue, 7 Jan 2020 08:13:10 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=LSEzA1zX+WSaOM7AOHt2AsVedefzYld8BvkRCNIPfiEWKjVVDD0FlmSHYMCCCOnZpzCjEz/bVU0MkisgolRBZ3GvfHSGhHdZb+94IDKuM5hW6mvmPTjuEDOA//X2TGAoBQ8W/CYHo6NA7ppH6vcKm1FVd0DMtrUy5fpge+NoHwgTcooD86ws3BwFXvep7qhxEH8iqOtl7MFT2Tb659yQ8f7s22C/DAWiL+1Hi0ctNA/b4GC8xTwCL7idRT23Xq+vfTJ9i8imHJM6y5zV4jfsfMSXvCzhmPnRE8PBqnoAumYzq4aKO8kiHgbb3AIZJr2ewDsDNHXKIVlZ11BB9th8Lw== 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=xZ17Swo+Adijq2/fO5uTQgftgh4v+wM8fS0h84iBn+Q=; b=faL4emSl8fQtDN2syYs/wPr8c0zQqmiPf8l2UsAPq92TAWGI7S0Ih+Tcbj/fdg92ySr2oh/mm30iD/Q99kxj/6JtDNgWSkLIeYTyofyzxWv2QsuHCEgVw1TogOBdTEBTsZ4uSkATfrSawWYFaOEyNJw8D/s99ZEK0J4RbkZhe+mx4KRSvsGeayjIP8K5Uah+qzr1wepluYRphrlyLMSJzF2C5CM9Gx3jH5xMGHovhwTR38SaMVy5U0G9wc698m7GtAQl46MNDkODrp8NsWsKqxHBQ7kmOq2z32BI7aw2RhEM64ccKHqMu8jHsSbbzk5h9ullTNxgfQ9vH+S/CPjZBg== 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=xZ17Swo+Adijq2/fO5uTQgftgh4v+wM8fS0h84iBn+Q=; b=EwMUA+cEXWqtpnvSlclT20a3dqjlmRm4CnR9kddxEc179wQATUCBHv/RxE4c3TU1MY3KN1Wsf+3D8zD2H79eW8794wwX6/TvLq2ydCWShqNPOdYB/AQUhI2TyRPbyQRb3VIuUPJ9yAHFr0DC3YS+CV2c376XJJKut9b0qNNdBQA= Received: from SN6PR11MB2558.namprd11.prod.outlook.com (52.135.94.19) by SN6PR11MB3485.namprd11.prod.outlook.com (52.135.112.205) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2602.15; Tue, 7 Jan 2020 16:13:05 +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.2623.008; Tue, 7 Jan 2020 16:13:05 +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 , Ruifeng Wang , Gavin Hu , nd , nd Thread-Topic: [PATCH v7 10/17] test/ring: modify single element enq/deq perf test cases Thread-Index: AQHVtvBydPKi7S4R5U6NPLreQc9/yqfXq9AggAckSoCAAKtlQA== Date: Tue, 7 Jan 2020 16:13:05 +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: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiZTViYWI1ZDMtNTMyNS00YTY4LWJlNjEtYjczNmU3NzRkN2RmIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiRG9Nd0RkUVp2TmZ1WDdtUWdcLzZLYmRMeTdoNXVVV01RQWs3ZStDVEhVR20wbHZHM3p4cHlGdUxMQ3JJbzF4TXMifQ== 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.179] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: be67363c-859c-4fad-7477-08d7938c7aa8 x-ms-traffictypediagnostic: SN6PR11MB3485: 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:4303; x-forefront-prvs: 027578BB13 x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(366004)(39860400002)(346002)(136003)(376002)(396003)(199004)(51234002)(189003)(66476007)(64756008)(66556008)(66446008)(86362001)(4326008)(6506007)(66946007)(8676002)(71200400001)(7696005)(5660300002)(81166006)(76116006)(81156014)(9686003)(7416002)(110136005)(54906003)(33656002)(8936002)(26005)(52536014)(186003)(55016002)(316002)(478600001)(2906002)(21314003); DIR:OUT; SFP:1102; SCL:1; SRVR:SN6PR11MB3485; H:SN6PR11MB2558.namprd11.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: 7ejcj/JRk84C/5zTLndsFRd3I+PvF3eg8Dgcad2WE4BmeNGGVZIpHpNxTQx16N3mzkTr93Ot+LU2B9N7/n3KqlL2eY4WGlsIyyoU0ty9j8F7GpkVkk6iLIZliI3BrxWS1yGLCbC8Bj/4pi1bMKPpCNc5h9+3STvFuQ+PVLhlsJRomai/dngMEDGZO9KCBAmKpVXm48xyegGFwC16m4/fE34MGfWUEj4RWV0TmCFUJkyKksW/3n+HPEXR2rVeUCd2J2ufWRrcy35s6IiVcWEOZtP33ZHDPPVGR8Ucz9O+4Q9kYRnlOCaMKZxITQ0Og7E33d9LkybetdnBScVwrrm15V9d7P6hPISbkzkpv571qkZbmvIevilzpNammV1plVGVXGpKhrDKwI5CPO0EzSaDIvsGN3pBQSZ4P420ZiaEzu5WBQdG5zicPvyaXw1ovgKI4ZdqCzD5kAUNtiGX0gsLTCelsBzVdLCa5MMZiN8EflUtQ60al+IQ4gssEVP2eJ/ZbTKYzBb1GiMvyLvA0Ii3Cg== Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: be67363c-859c-4fad-7477-08d7938c7aa8 X-MS-Exchange-CrossTenant-originalarrivaltime: 07 Jan 2020 16:13:05.7330 (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: 7krc1lXo+/00Bf/+ZG7El+2diLkwwWzxCgVnF42PUFFAEozcTEy/B6vFukehNmvJMVDa1nYH7CfuMuSao7tHsDnt27RsXxo9tKbeCgz3vyw= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN6PR11MB3485 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" > > > Add test cases to test rte_ring_xxx_elem APIs for single element > > > enqueue/dequeue test cases. > > > > > > Signed-off-by: Honnappa Nagarahalli > > > Reviewed-by: Gavin Hu > > > --- > > > app/test/test_ring_perf.c | 100 > > > ++++++++++++++++++++++++++++++-------- > > > 1 file changed, 80 insertions(+), 20 deletions(-) > > > > > > 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 > > > > > > #include "test.h" > > > +#include "test_ring.h" > > > > > > /* > > > * Ring > > > @@ -41,6 +42,35 @@ struct lcore_pair { > > > > > > static volatile unsigned lcore_count =3D 0; > > > > > > +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 > > > tests ***/ > > > > > > 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 > > single item > > > * takes on a single lcore. Result is for comparison with the bulk e= nq+deq. > > > */ > > > -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; > > > > > > - 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. > The compiler throws an error since 'ret' is assigned a value, but it is n= ot used. Probably one way to change TEST_RING_ENQUEUE() from macro to inline-function returning ret. =20 >=20 > > > > > + /* alloc dummy object pointers */ > > > + burst =3D test_ring_calloc(1, esize); > > > + if (burst =3D=3D NULL) > > > + return -1; > > > > > > - 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); > > > > > > - 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; > > > } > > > > > > /*