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 ED650A034F; Tue, 5 May 2020 20:58:30 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id BB03B1D6B7; Tue, 5 May 2020 20:58:30 +0200 (CEST) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by dpdk.org (Postfix) with ESMTP id 2521E1D68F for ; Tue, 5 May 2020 20:58:27 +0200 (CEST) IronPort-SDR: /SrpplepS6soVFg/CwhqFnjdtzm15jCchBiMMPUAs3qaOGc5eYMGJBbsqMS5XClMA2CWy2ir8j aNHo0J4xRDmw== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga004.jf.intel.com ([10.7.209.38]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 May 2020 11:58:27 -0700 IronPort-SDR: y1h5p1j10jDycu/lS8JI7N6GQU/fzYseD6NsAUib9pIi/JKcSYZ8ky6IDBLhGyYlWmwfaCbfyx G+DWv/yTdokA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.73,356,1583222400"; d="scan'208";a="406960664" Received: from fmsmsx106.amr.corp.intel.com ([10.18.124.204]) by orsmga004.jf.intel.com with ESMTP; 05 May 2020 11:58:26 -0700 Received: from fmsmsx156.amr.corp.intel.com (10.18.116.74) by FMSMSX106.amr.corp.intel.com (10.18.124.204) with Microsoft SMTP Server (TLS) id 14.3.439.0; Tue, 5 May 2020 11:58:26 -0700 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; Tue, 5 May 2020 11:58:25 -0700 Received: from NAM11-DM6-obe.outbound.protection.outlook.com (104.47.57.175) by edgegateway.intel.com (192.55.55.69) with Microsoft SMTP Server (TLS) id 14.3.439.0; Tue, 5 May 2020 11:58:00 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=GzL+PNOjMhzAgfiyl3UGbfBE2Cp7POMTJ7kBUCIAvPvZYlXSqI4POvc1G9Q/kn1xhCw+vVktM+1eBHWIc0yP1qLZDrj/O4yXA2qvLFSggzOZoWj3dK4ZOvHG6rxVjSwXU+xFF5WPCA+cO+zhUGfb3IX8zClTdWUUtZDyJ6fnlVVv8ta8M5fEJRQPFgLwg3F2xipeRxwmwqj4BZC9tZY8K1oLf3YZHybYjXNd+9CSn59g1Ut3r6AZ+jus5r163JcEN7nOrfjTqP3mBs6tTmRzr0iaoIErsXIoYIXHlBMzjuzrGj+QRuVXAblwOymTEDLFywqW6GU2D/lyCiOs1m3R/g== 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=Er/mFDrP+CgiOTgTGTGoF1tBuBgO9JHvG3CSctNkI4g=; b=ftTV/1RT3JKmBTqOx4Sl3BKxmBtbOVw5g9k4U396lA8cO0trcmxoE4V1qusT0UPw+iriwvJmaHXkiN3X5ETB+YA5HMNMyXNmy43ntknax4/36A+dui3PMu0iUMcxDcWKA9MxAL1K8x8L+Z68w24xk1hVBkvek0wTbjjLw4nFz5SPO4cJ2CkxCZJDUcnpcLDFJgx0BSK6+mgOvAk/1YHXQl/piq7LFKcQxW7NAGspRcT1wB/ra8xKpyEoswrmDkQI6N2AYDW5TnXqtE9fskrJvUsUrykvp0bZ6NI1rkeGC/p81fVzPkGITatlf3R+7pCWhiMt+WB6PvEG07viEhDDFA== 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=Er/mFDrP+CgiOTgTGTGoF1tBuBgO9JHvG3CSctNkI4g=; b=WmpaZyiXm1F67bp1DT+mS45gnHN2aDlYBnrkdbNsOFL2MQ/MLf9z8f+aArKY7xnHGd22KaHvHS9d+vhGU0k5RUAl3f4++0F7mw7DKel4Z6ehP/UduuVFWZosyTEZmNV++nJFMjyPNd3+9aTl7EhbhOreqx8Id280+GS057k59Dk= Received: from BYAPR11MB3301.namprd11.prod.outlook.com (2603:10b6:a03:7f::26) by BYAPR11MB3446.namprd11.prod.outlook.com (2603:10b6:a03:1a::29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2958.20; Tue, 5 May 2020 18:57:56 +0000 Received: from BYAPR11MB3301.namprd11.prod.outlook.com ([fe80::f8cb:58cd:e958:fff4]) by BYAPR11MB3301.namprd11.prod.outlook.com ([fe80::f8cb:58cd:e958:fff4%6]) with mapi id 15.20.2958.030; Tue, 5 May 2020 18:57:56 +0000 From: "Ananyev, Konstantin" To: Honnappa Nagarahalli , "dev@dpdk.org" CC: "aconole@redhat.com" , nd , nd Thread-Topic: [PATCH] test/ring: code rework to reduce compilation time Thread-Index: AQHWHk+83qvZh/D4lkSDqayxys8lo6iQ6NuAgAC+FfCAAd3OAIAF4jmwgAAsKwCAAAFFAIAAQNgAgAAJKZA= Date: Tue, 5 May 2020 18:57:56 +0000 Message-ID: References: <20200429175714.31141-1-konstantin.ananyev@intel.com> In-Reply-To: Accept-Language: en-GB, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-reaction: no-action dlp-version: 11.2.0.6 authentication-results: arm.com; dkim=none (message not signed) header.d=none;arm.com; dmarc=none action=none header.from=intel.com; x-originating-ip: [192.198.151.181] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 3367d3f9-94c2-4ff8-7eb2-08d7f12638fd x-ms-traffictypediagnostic: BYAPR11MB3446: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:9508; x-forefront-prvs: 0394259C80 x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: XPSzEx/S3Bn5tLvapha/O3W4wic9ZghYGvoL/KJ40ro9E3dgzp4HYs1k8zXm3YSYz0Azln4yYYeRtMqeFJ4pXDLMvtwgjE7jJMutbxKxUxzqXovrb9sTnFsIxEE7DreDg3t76Km8zTykj5iCRtP42SgXhe8XZ5OdGHUMYBRiF22for/xkzi+OiNacsdxlZ8j+XSor7FP52v1QbzU3zTq+7UIsH2coLjSjRuS3I4GQlUeIFtfZRxIcIS5Z3eI84b5co3Jm91RdKf57GT3nkzjm+UGl8wrdGM8kLxLck0gg5tnnlkmJHVTu8YzLbQ/xVH4GxvsVZLaUFE/OZhP4lgvdJztvtxOFP9ToGjnAWixrBZIpf0ffubTmGxL87bJyCQY6zb0WxbMfIX+BAZBANZOo1LnQvpZNKA/h3JuNfJoxSmYZhP3kOfoHyD7ra2LgjsE7NxDFgCtSRRBeOFTyHJC6/DFni0CZAH0mfA8ybAlhof2ThDTy3S0BNFGDC2RRnyyPTSM9J94Mxr6VjnHCai9szbVJI1pAtaHvOb3bOePqAwR6d8EUbnbZQSvwxtZLKZWpCnMPKmXZ+7DN1Mq1gxhC9ygtMdV9jmxvgPld6/gyLU= x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:BYAPR11MB3301.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(366004)(33430700001)(4326008)(76116006)(54906003)(64756008)(71200400001)(66476007)(498600001)(5660300002)(66556008)(33440700001)(110136005)(8676002)(66446008)(86362001)(966005)(9686003)(66946007)(6506007)(30864003)(2906002)(55016002)(8936002)(7696005)(52536014)(186003)(26005)(33656002)(579004)(559001); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata: +9KoQRjIH8iGp4hlYPYEhPoySvHWKaX2vRhxvtEk+dIIM0YM5uFrbfK0+5OVGUGul7scR45H/3DR2lsck4Ir304HX4AfeA6fD2kK54dYQgBxVm8R4mY2Ht5Qv9zm8EOcm9QUgC6sDjz6Ml1sEH5tjAJh1c/ajULPDKSkG1dNLEq476why4jNeu2CwR9pAL6MxCaAmxB/hBghmfFsZwig4RCUtk13y0dYSd/uQi5974Yj/McDF+YvOpfOBdTt5PAyLFEb+6Y/XSvTOoESSFHMObbC2Is/3laaIWn6/ffR8P7Ikv3mxkaM2gcEqCIVla2r9DztWTmCjXrbD6sYLK/YkLOwcb4mqJ0OgKGksJGo5peQj9bctwxiW7jl4Kqpze1QXU6elCNaJqQcCc6UUEYZsBUBsg1B9amha1nE1DhO9AaRcYVJDairqVoA/Wck1miAeC8gdK80OYIFF+2ghDLj7248zcDouYA7v9d86b1/HXQ/9Uc1Ey9BsRwXObh+k/O6CKtJ4YF4J7+dyTBcdErcMQRsCfyIg6barjVaXU4Lel4PbrInILXepCwIf9LwvhM2a7xYWvd4kmHmEYBtsQJ9hNXPlKiqfYpHwc58/uUkTWRPS4wwISLeRYwuzUq2PywWpWUtu5pF8fMR38v7JOewm588Q3PO6LXTh3F9tVvsMcU6248Gtq9Fyg0FLzIh4hvNifl31Ty7L22Y5TM9UojNc4JGYJeQZ1UYjvCfgEkbqI4lUgnM4Ut+SHNchk9jsqBxwFyaAZQ+8V+iurlsgaT/cSUbz83fPk/nSkZ53sEBBXxo62tudEMNs7IIbqIb3jB1 x-ms-exchange-transport-forked: True Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: 3367d3f9-94c2-4ff8-7eb2-08d7f12638fd X-MS-Exchange-CrossTenant-originalarrivaltime: 05 May 2020 18:57:56.0864 (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: vUfckG3rwrNnASYHai7VceDynLXNOgupVyZFrkYLboO2mXj8mU0gku/KrBAP94NN+0lwIpeXLIzA2luBTGFtZ+EqYHqWLKvDKwJi6Kb9X6Y= X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR11MB3446 X-OriginatorOrg: intel.com Subject: Re: [dpdk-dev] [PATCH] test/ring: code rework to reduce compilation time 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 > > > > > > > > > > > > > Hi Konstantin, > > > > > > > I like the way the tests are organized and it looks good. > > > > > > > > > > > > > > I am just wondering about the way it is being tested here. Th= e > > > > > > > intent to write the test cases the way they are currently is > > > > > > > to mimic how the APIs would be used mostly. IMO, the APIs > > > > > > > would be used with a constant > > > > > > value for element size so that the compiler will throw away the > > > > > > unwanted code (in the functions where the actual copy is being = done). > > > > > > > > > > > > > > With your method here, it looks to me like all the branches i= n > > > > > > > the copy > > > > > > functions are kept and the branch decisions are done at run tim= e. > > > > > > > Is my understanding correct? > > > > > > > > > > > > You mean branching on esize[] values? > > > > > Yes > > > > > > > > > > > Actually from what I've seen that happens for both cases: > > > > > > before and after the patch (gcc 7.3 -O3). > > > > > I did not look at the generated code. If it is happening with you= r > > > > > patch too, I > > > > think we can go with your patch. > > > > > > > > Just to clarify, what I meant: > > > > For both binaries (without the patch and with the patch) inside > > > > test_ring() I see runtime branches on esize value. > > > > Literally the code that corresponds to: > > > > if (esize =3D=3D 8) {...} > > > > else if (esize =3D=3D 16) {...} > > > > else {...} > I am not concerned about the functions in test_ring.c. >=20 > > > Do you see this in the actual ring library functions? > > > > Which ones? AFAIK all ring dequeue/enqueue functions are inline right n= ow. > Please see below. >=20 > > > > > I want to make sure that the library functions > > > '__rte_ring_enqueue_elems' and '__rte_ring_dequeue_elems' are optimiz= ed. > Each enqueue/dequeue function ultimately calls these 2 functions. Yes, and then each instance of enqueue/dequeue functions that is used by up= per layer would be in-lined. So what upper layer function (library or app) you asked me to check? =20 > The compiler here should remove the 'if (esize =3D=3D 8) {...} else if (e= size =3D=3D > 16) {...} else {...}' with just the required piece of code depending on t= he 'esize'. > If we can validate that for at least one ring library function > used in this patch, we should be good. >=20 > > > > > > > > > > > Probably gcc wasn't able to remove it because we use esize[] instea= d > > > > of hard- coded values, might be there is some other reason, I don't= know > > for sure. > > > > As it is a functional (not performance) test, I didn't dig further. > > > The esize[] array is declared as a const. The compiler should be able= to see > > that it is a compile time constant. > > > > That was my expectation too, but that not what I am seeing. > > > > > > > > > > > But, can you do similar > > > > > change to test_ring_perf.c to keep it consistent? > > > > > > > > In principle it is doable, but needs extra care. > > > > We need to make sure that compiler will be able to inline functions > > > > via pointers. > > > > AFAIK, gcc does that with -O3', but not with '-O2'. > > > If the unwanted code is not removed during compilation, we will see i= t > > affect the performance numbers. > > > > Exactly. > > The last thing I want - someone who uses older version of compiler, etc= ., will > > start to see lower performance numbers with that test. > > > > > > Don't know what the story with clang and different versions of the > > compiler. > > > > Is there any real need for that? > > > > On my box test_ring_perf.c compilation takes ~8s. > > > > Konstantin > > > > > > > > > > > > > > > > > > > > > > > > > Main intention in my changes was to avoid using > > > > > > test_ring_enqueue/test_ring_dequeue, > > > > > > as it seems too many branches here and it takes compiler a lot > > > > > > of effort to resolve all of them at compile time. > > > > > > So I replaced it with array of function pointers > > > > > > (test_enqdeq_impl[]) and iterating over it. > > > > > > That way compiler knows straightway which function to use. > > > > > > > > > > > > > Can you please check this? > > > > > > > https://patches.dpdk.org/patch/69567/ > > > > > > > > > > > > As I can see your approach reduces number of test-cases by fact= or of 5: > > > > > > now each of test_ring_burst_bulk_tests[1-4] is executed only > > > > > > with just one esize value, correct? > > > > > Yes, basically test_ring_burst_bulk_tests[1-4] were covering > > > > > different scenarios with the same APIs. So, distributed the esize > > > > > across different test > > > > functions. > > > > > > > > > > > In term of compilation speed - it helps. > > > > > > On my box with (gcc 7.3 -O3) compiling test_ring.c takes: > > > > > > orig code: ~100s > > > > > > with 69567 (your patch): < 20s > > > > > > with 69559 (my patch): < 10s > > > > > > > > > > > > Konstantin > > > > > > > > > > > > > > > > > > > > > -----Original Message----- > > > > > > > > From: Konstantin Ananyev > > > > > > > > Sent: Wednesday, April 29, 2020 12:57 PM > > > > > > > > To: dev@dpdk.org > > > > > > > > Cc: aconole@redhat.com; Honnappa Nagarahalli > > > > > > > > ; Konstantin Ananyev > > > > > > > > > > > > > > > > Subject: [PATCH] test/ring: code rework to reduce > > > > > > > > compilation time > > > > > > > > > > > > > > > > Rework test code to reduce code complexity for the compiler > > > > > > > > and bring down compilation time and memory consumption. > > > > > > > > > > > > > > > > Signed-off-by: Konstantin Ananyev > > > > > > > > > > > > > > > > --- > > > > > > > > app/test/test_ring.c | 373 > > > > > > > > +++++++++++++++++++++++++++++-------------- > > > > > > > > 1 file changed, 249 insertions(+), 124 deletions(-) > > > > > > > > > > > > > > > > diff --git a/app/test/test_ring.c b/app/test/test_ring.c > > > > > > > > index > > > > > > > > e21557cd9..0ae97d341 100644 > > > > > > > > --- a/app/test/test_ring.c > > > > > > > > +++ b/app/test/test_ring.c > > > > > > > > @@ -58,6 +58,181 @@ > > > > > > > > > > > > > > > > static const int esize[] =3D {-1, 4, 8, 16, 20}; > > > > > > > > > > > > > > > > +static const struct { > > > > > > > > + const char *desc; > > > > > > > > + uint32_t api_type; > > > > > > > > + uint32_t create_flags; > > > > > > > > + struct { > > > > > > > > + unsigned int (*flegacy)(struct rte_ring *r, > > > > > > > > + void * const *obj_table, unsigned int n, > > > > > > > > + unsigned int *free_space); > > > > > > > > + unsigned int (*felem)(struct rte_ring *r, const void > > > > *obj_table, > > > > > > > > + unsigned int esize, unsigned int n, > > > > > > > > + unsigned int *free_space); > > > > > > > > + } enq; > > > > > > > > + struct { > > > > > > > > + unsigned int (*flegacy)(struct rte_ring *r, > > > > > > > > + void **obj_table, unsigned int n, > > > > > > > > + unsigned int *available); > > > > > > > > + unsigned int (*felem)(struct rte_ring *r, void > > > > *obj_table, > > > > > > > > + unsigned int esize, unsigned int n, > > > > > > > > + unsigned int *available); > > > > > > > > + } deq; > > > > > > > > +} test_enqdeq_impl[] =3D { > > > > > > > > + { > > > > > > > > + .desc =3D "MP/MC sync mode", > > > > > > > Details about the tests are already printed by the function > > > > > > 'test_ring_print_test_string'. This string should be 'Test stan= dard ring'. > > > > > > > > > > > > > > > + .api_type =3D TEST_RING_ELEM_BULK | > > > > > > > > TEST_RING_THREAD_DEF, > > > > > > > > + .create_flags =3D 0, > > > > > > > > + .enq =3D { > > > > > > > > + .flegacy =3D rte_ring_enqueue_bulk, > > > > > > > > + .felem =3D rte_ring_enqueue_bulk_elem, > > > > > > > > + }, > > > > > > > > + .deq =3D { > > > > > > > > + .flegacy =3D rte_ring_dequeue_bulk, > > > > > > > > + .felem =3D rte_ring_dequeue_bulk_elem, > > > > > > > > + }, > > > > > > > > + }, > > > > > > > > + { > > > > > > > > + .desc =3D "SP/SC sync mode", > > > > > > > > + .api_type =3D TEST_RING_ELEM_BULK | > > > > > > > > TEST_RING_THREAD_SPSC, > > > > > > > > + .create_flags =3D RING_F_SP_ENQ | RING_F_SC_DEQ, > > > > > > > > + .enq =3D { > > > > > > > > + .flegacy =3D rte_ring_sp_enqueue_bulk, > > > > > > > > + .felem =3D rte_ring_sp_enqueue_bulk_elem, > > > > > > > > + }, > > > > > > > > + .deq =3D { > > > > > > > > + .flegacy =3D rte_ring_sc_dequeue_bulk, > > > > > > > > + .felem =3D rte_ring_sc_dequeue_bulk_elem, > > > > > > > > + }, > > > > > > > > + }, > > > > > > > > + { > > > > > > > > + .desc =3D "MP/MC sync mode", > > > > > > > > + .api_type =3D TEST_RING_ELEM_BULK | > > > > > > > > TEST_RING_THREAD_MPMC, > > > > > > > > + .create_flags =3D 0, > > > > > > > > + .enq =3D { > > > > > > > > + .flegacy =3D rte_ring_mp_enqueue_bulk, > > > > > > > > + .felem =3D rte_ring_mp_enqueue_bulk_elem, > > > > > > > > + }, > > > > > > > > + .deq =3D { > > > > > > > > + .flegacy =3D rte_ring_mc_dequeue_bulk, > > > > > > > > + .felem =3D rte_ring_mc_dequeue_bulk_elem, > > > > > > > > + }, > > > > > > > > + }, > > > > > > > > + { > > > > > > > > + .desc =3D "MP_RTS/MC_RTS sync mode", > > > > > > > > + .api_type =3D TEST_RING_ELEM_BULK | > > > > > > > > TEST_RING_THREAD_DEF, > > > > > > > > + .create_flags =3D RING_F_MP_RTS_ENQ | > > > > > > > > RING_F_MC_RTS_DEQ, > > > > > > > > + .enq =3D { > > > > > > > > + .flegacy =3D rte_ring_enqueue_bulk, > > > > > > > > + .felem =3D rte_ring_enqueue_bulk_elem, > > > > > > > > + }, > > > > > > > > + .deq =3D { > > > > > > > > + .flegacy =3D rte_ring_dequeue_bulk, > > > > > > > > + .felem =3D rte_ring_dequeue_bulk_elem, > > > > > > > > + }, > > > > > > > > + }, > > > > > > > > + { > > > > > > > > + .desc =3D "MP_HTS/MC_HTS sync mode", > > > > > > > > + .api_type =3D TEST_RING_ELEM_BULK | > > > > > > > > TEST_RING_THREAD_DEF, > > > > > > > > + .create_flags =3D RING_F_MP_HTS_ENQ | > > > > > > > > RING_F_MC_HTS_DEQ, > > > > > > > > + .enq =3D { > > > > > > > > + .flegacy =3D rte_ring_enqueue_bulk, > > > > > > > > + .felem =3D rte_ring_enqueue_bulk_elem, > > > > > > > > + }, > > > > > > > > + .deq =3D { > > > > > > > > + .flegacy =3D rte_ring_dequeue_bulk, > > > > > > > > + .felem =3D rte_ring_dequeue_bulk_elem, > > > > > > > > + }, > > > > > > > > + }, > > > > > > > > + { > > > > > > > > + .desc =3D "MP/MC sync mode", > > > > > > > > + .api_type =3D TEST_RING_ELEM_BURST | > > > > > > > > TEST_RING_THREAD_DEF, > > > > > > > > + .create_flags =3D 0, > > > > > > > > + .enq =3D { > > > > > > > > + .flegacy =3D rte_ring_enqueue_burst, > > > > > > > > + .felem =3D rte_ring_enqueue_burst_elem, > > > > > > > > + }, > > > > > > > > + .deq =3D { > > > > > > > > + .flegacy =3D rte_ring_dequeue_burst, > > > > > > > > + .felem =3D rte_ring_dequeue_burst_elem, > > > > > > > > + }, > > > > > > > > + }, > > > > > > > > + { > > > > > > > > + .desc =3D "SP/SC sync mode", > > > > > > > > + .api_type =3D TEST_RING_ELEM_BURST | > > > > > > > > TEST_RING_THREAD_SPSC, > > > > > > > > + .create_flags =3D RING_F_SP_ENQ | RING_F_SC_DEQ, > > > > > > > > + .enq =3D { > > > > > > > > + .flegacy =3D rte_ring_sp_enqueue_burst, > > > > > > > > + .felem =3D rte_ring_sp_enqueue_burst_elem, > > > > > > > > + }, > > > > > > > > + .deq =3D { > > > > > > > > + .flegacy =3D rte_ring_sc_dequeue_burst, > > > > > > > > + .felem =3D rte_ring_sc_dequeue_burst_elem, > > > > > > > > + }, > > > > > > > > + }, > > > > > > > > + { > > > > > > > > + .desc =3D "MP/MC sync mode", > > > > > > > > + .api_type =3D TEST_RING_ELEM_BURST | > > > > > > > > TEST_RING_THREAD_MPMC, > > > > > > > > + .create_flags =3D 0, > > > > > > > > + .enq =3D { > > > > > > > > + .flegacy =3D rte_ring_mp_enqueue_burst, > > > > > > > > + .felem =3D rte_ring_mp_enqueue_burst_elem, > > > > > > > > + }, > > > > > > > > + .deq =3D { > > > > > > > > + .flegacy =3D rte_ring_mc_dequeue_burst, > > > > > > > > + .felem =3D rte_ring_mc_dequeue_burst_elem, > > > > > > > > + }, > > > > > > > > + }, > > > > > > > > + { > > > > > > > > + .desc =3D "MP_RTS/MC_RTS sync mode", > > > > > > > > + .api_type =3D TEST_RING_ELEM_BURST | > > > > > > > > TEST_RING_THREAD_DEF, > > > > > > > > + .create_flags =3D RING_F_MP_RTS_ENQ | > > > > > > > > RING_F_MC_RTS_DEQ, > > > > > > > > + .enq =3D { > > > > > > > > + .flegacy =3D rte_ring_enqueue_burst, > > > > > > > > + .felem =3D rte_ring_enqueue_burst_elem, > > > > > > > > + }, > > > > > > > > + .deq =3D { > > > > > > > > + .flegacy =3D rte_ring_dequeue_burst, > > > > > > > > + .felem =3D rte_ring_dequeue_burst_elem, > > > > > > > > + }, > > > > > > > > + }, > > > > > > > > + { > > > > > > > > + .desc =3D "MP_HTS/MC_HTS sync mode", > > > > > > > > + .api_type =3D TEST_RING_ELEM_BURST | > > > > > > > > TEST_RING_THREAD_DEF, > > > > > > > > + .create_flags =3D RING_F_MP_HTS_ENQ | > > > > > > > > RING_F_MC_HTS_DEQ, > > > > > > > > + .enq =3D { > > > > > > > > + .flegacy =3D rte_ring_enqueue_burst, > > > > > > > > + .felem =3D rte_ring_enqueue_burst_elem, > > > > > > > > + }, > > > > > > > > + .deq =3D { > > > > > > > > + .flegacy =3D rte_ring_dequeue_burst, > > > > > > > > + .felem =3D rte_ring_dequeue_burst_elem, > > > > > > > > + }, > > > > > > > > + }, > > > > > > > > +}; > > > > > > > > + > > > > > > > > +static unsigned int > > > > > > > > +test_ring_enq_impl(struct rte_ring *r, void **obj, int > > > > > > > > +esize, unsigned > > > > int n, > > > > > > > > + unsigned int test_idx) > > > > > > > > +{ > > > > > > > > + if (esize =3D=3D -1) > > > > > > > > + return test_enqdeq_impl[test_idx].enq.flegacy(r, obj, > > > > n, NULL); > > > > > > > > + else > > > > > > > > + return test_enqdeq_impl[test_idx].enq.felem(r, obj, > > > > esize, n, > > > > > > > > + NULL); > > > > > > > > +} > > > > > > > > + > > > > > > > > +static unsigned int > > > > > > > > +test_ring_deq_impl(struct rte_ring *r, void **obj, int > > > > > > > > +esize, unsigned > > > > int n, > > > > > > > > + unsigned int test_idx) > > > > > > > > +{ > > > > > > > > + if (esize =3D=3D -1) > > > > > > > > + return test_enqdeq_impl[test_idx].deq.flegacy(r, obj, > > > > n, NULL); > > > > > > > > + else > > > > > > > > + return test_enqdeq_impl[test_idx].deq.felem(r, obj, > > > > esize, n, > > > > > > > > + NULL); > > > > > > > > +} > > > > > > > > + > > > > > > > > static void** > > > > > > > > test_ring_inc_ptr(void **obj, int esize, unsigned int n) = { > > > > > > > > @@ > > > > > > > > -203,8 +378,7 @@ test_ring_negative_tests(void) > > > > > > > > * Random number of elements are enqueued and dequeued. > > > > > > > > */ > > > > > > > > static int > > > > > > > > -test_ring_burst_bulk_tests1(unsigned int api_type, unsigne= d > > > > > > > > int > > > > > > create_flags, > > > > > > > > - const char *tname) > > > > > > > > +test_ring_burst_bulk_tests1(unsigned int test_idx) > > > > > > > > { > > > > > > > > struct rte_ring *r; > > > > > > > > void **src =3D NULL, **cur_src =3D NULL, **dst =3D NULL, > > > > > > > > **cur_dst =3D NULL; @@ -214,11 +388,13 @@ > > > > test_ring_burst_bulk_tests1(unsigned > > > > > > > > int api_type, unsigned int create_flags, > > > > > > > > const unsigned int rsz =3D RING_SIZE - 1; > > > > > > > > > > > > > > > > for (i =3D 0; i < RTE_DIM(esize); i++) { > > > > > > > > - test_ring_print_test_string(tname, api_type, esize[i]); > > > > > > > > + > > > > test_ring_print_test_string(test_enqdeq_impl[test_idx].desc, > > > > > > > > + test_enqdeq_impl[test_idx].api_type, esize[i]); > > > > > > > > > > > > > > > > /* Create the ring */ > > > > > > > > r =3D test_ring_create("test_ring_burst_bulk_tests", > > esize[i], > > > > > > > > - RING_SIZE, SOCKET_ID_ANY, > > > > > > > > create_flags); > > > > > > > > + RING_SIZE, SOCKET_ID_ANY, > > > > > > > > + > > > > test_enqdeq_impl[test_idx].create_flags); > > > > > > > > > > > > > > > > /* alloc dummy object pointers */ > > > > > > > > src =3D test_ring_calloc(RING_SIZE * 2, esize[i]); @@ > > > > > > > > -240,17 > > > > > > > > +416,17 @@ test_ring_burst_bulk_tests1(unsigned int > > > > > > > > +api_type, unsigned int > > > > > > > > create_flags, > > > > > > > > rand =3D RTE_MAX(rte_rand() % RING_SIZE, > > 1UL); > > > > > > > > printf("%s: iteration %u, random shift: %u;\n", > > > > > > > > __func__, i, rand); > > > > > > > > - ret =3D test_ring_enqueue(r, cur_src, esize[i], > > > > rand, > > > > > > > > - api_type); > > > > > > > > + ret =3D test_ring_enq_impl(r, cur_src, esize[i], > > > > rand, > > > > > > > > + test_idx); > > > > > > > > TEST_RING_VERIFY(ret !=3D 0); > > > > > > > > > > > > > > > > - ret =3D test_ring_dequeue(r, cur_dst, esize[i], > > > > rand, > > > > > > > > - api_type); > > > > > > > > + ret =3D test_ring_deq_impl(r, cur_dst, esize[i], > > > > rand, > > > > > > > > + test_idx); > > > > > > > > TEST_RING_VERIFY(ret =3D=3D rand); > > > > > > > > > > > > > > > > /* fill the ring */ > > > > > > > > - ret =3D test_ring_enqueue(r, cur_src, esize[i], rsz, > > > > > > > > - api_type); > > > > > > > > + ret =3D test_ring_enq_impl(r, cur_src, esize[i], > > > > rsz, > > > > > > > > + test_idx); > > > > > > > > TEST_RING_VERIFY(ret !=3D 0); > > > > > > > > > > > > > > > > TEST_RING_VERIFY(rte_ring_free_count(r) =3D=3D > > 0); @@ > > > > > > > > -259,8 +435,8 @@ test_ring_burst_bulk_tests1(unsigned int > > > > > > > > api_type, unsigned int create_flags, > > > > > > > > TEST_RING_VERIFY(rte_ring_empty(r) =3D=3D 0); > > > > > > > > > > > > > > > > /* empty the ring */ > > > > > > > > - ret =3D test_ring_dequeue(r, cur_dst, esize[i], rsz, > > > > > > > > - api_type); > > > > > > > > + ret =3D test_ring_deq_impl(r, cur_dst, esize[i], > > > > rsz, > > > > > > > > + test_idx); > > > > > > > > TEST_RING_VERIFY(ret =3D=3D (int)rsz); > > > > > > > > TEST_RING_VERIFY(rsz =3D=3D > > rte_ring_free_count(r)); > > > > > > > > TEST_RING_VERIFY(rte_ring_count(r) =3D=3D 0); > > @@ - > > > > > > > > 294,8 +470,7 @@ test_ring_burst_bulk_tests1(unsigned int > > > > > > > > api_type, unsigned int create_flags, > > > > > > > > * dequeued data. > > > > > > > > */ > > > > > > > > static int > > > > > > > > -test_ring_burst_bulk_tests2(unsigned int api_type, unsigne= d > > > > > > > > int > > > > > > create_flags, > > > > > > > > - const char *tname) > > > > > > > > +test_ring_burst_bulk_tests2(unsigned int test_idx) > > > > > > > > { > > > > > > > > struct rte_ring *r; > > > > > > > > void **src =3D NULL, **cur_src =3D NULL, **dst =3D NULL, > > > > > > > > **cur_dst =3D NULL; @@ -303,11 +478,13 @@ > > > > test_ring_burst_bulk_tests2(unsigned > > > > > > > > int api_type, unsigned int create_flags, > > > > > > > > unsigned int i; > > > > > > > > > > > > > > > > for (i =3D 0; i < RTE_DIM(esize); i++) { > > > > > > > > - test_ring_print_test_string(tname, api_type, esize[i]); > > > > > > > > + > > > > test_ring_print_test_string(test_enqdeq_impl[test_idx].desc, > > > > > > > > + test_enqdeq_impl[test_idx].api_type, esize[i]); > > > > > > > > > > > > > > > > /* Create the ring */ > > > > > > > > r =3D test_ring_create("test_ring_burst_bulk_tests", > > esize[i], > > > > > > > > - RING_SIZE, SOCKET_ID_ANY, > > > > > > > > create_flags); > > > > > > > > + RING_SIZE, SOCKET_ID_ANY, > > > > > > > > + > > > > test_enqdeq_impl[test_idx].create_flags); > > > > > > > > > > > > > > > > /* alloc dummy object pointers */ > > > > > > > > src =3D test_ring_calloc(RING_SIZE * 2, esize[i]); @@ > > > > > > > > -323,39 > > > > > > > > +500,39 @@ test_ring_burst_bulk_tests2(unsigned int > > > > > > > > +api_type, unsigned int > > > > > > > > create_flags, > > > > > > > > cur_dst =3D dst; > > > > > > > > > > > > > > > > printf("enqueue 1 obj\n"); > > > > > > > > - ret =3D test_ring_enqueue(r, cur_src, esize[i], 1, > > > > api_type); > > > > > > > > + ret =3D test_ring_enq_impl(r, cur_src, esize[i], 1, > > > > test_idx); > > > > > > > > if (ret !=3D 1) > > > > > > > > goto fail; > > > > > > > > cur_src =3D test_ring_inc_ptr(cur_src, esize[i], 1); > > > > > > > > > > > > > > > > printf("enqueue 2 objs\n"); > > > > > > > > - ret =3D test_ring_enqueue(r, cur_src, esize[i], 2, > > > > api_type); > > > > > > > > + ret =3D test_ring_enq_impl(r, cur_src, esize[i], 2, > > > > test_idx); > > > > > > > > if (ret !=3D 2) > > > > > > > > goto fail; > > > > > > > > cur_src =3D test_ring_inc_ptr(cur_src, esize[i], 2); > > > > > > > > > > > > > > > > printf("enqueue MAX_BULK objs\n"); > > > > > > > > - ret =3D test_ring_enqueue(r, cur_src, esize[i], > > > > MAX_BULK, > > > > > > > > - api_type); > > > > > > > > + ret =3D test_ring_enq_impl(r, cur_src, esize[i], > > > > MAX_BULK, > > > > > > > > + test_idx); > > > > > > > > if (ret !=3D MAX_BULK) > > > > > > > > goto fail; > > > > > > > > cur_src =3D test_ring_inc_ptr(cur_src, esize[i], > > MAX_BULK); > > > > > > > > > > > > > > > > printf("dequeue 1 obj\n"); > > > > > > > > - ret =3D test_ring_dequeue(r, cur_dst, esize[i], 1, > > > > api_type); > > > > > > > > + ret =3D test_ring_deq_impl(r, cur_dst, esize[i], 1, > > > > test_idx); > > > > > > > > if (ret !=3D 1) > > > > > > > > goto fail; > > > > > > > > cur_dst =3D test_ring_inc_ptr(cur_dst, esize[i], 1); > > > > > > > > > > > > > > > > printf("dequeue 2 objs\n"); > > > > > > > > - ret =3D test_ring_dequeue(r, cur_dst, esize[i], 2, > > > > api_type); > > > > > > > > + ret =3D test_ring_deq_impl(r, cur_dst, esize[i], 2, > > > > test_idx); > > > > > > > > if (ret !=3D 2) > > > > > > > > goto fail; > > > > > > > > cur_dst =3D test_ring_inc_ptr(cur_dst, esize[i], 2); > > > > > > > > > > > > > > > > printf("dequeue MAX_BULK objs\n"); > > > > > > > > - ret =3D test_ring_dequeue(r, cur_dst, esize[i], > > > > MAX_BULK, > > > > > > > > - api_type); > > > > > > > > + ret =3D test_ring_deq_impl(r, cur_dst, esize[i], > > > > MAX_BULK, > > > > > > > > + test_idx); > > > > > > > > if (ret !=3D MAX_BULK) > > > > > > > > goto fail; > > > > > > > > cur_dst =3D test_ring_inc_ptr(cur_dst, esize[i], > > MAX_BULK); > > > > > > > > @@ > > > > > > > > -390,8 +567,7 @@ test_ring_burst_bulk_tests2(unsigned int > > > > > > > > api_type, unsigned int create_flags, > > > > > > > > * Enqueue and dequeue to cover the entire ring length. > > > > > > > > */ > > > > > > > > static int > > > > > > > > -test_ring_burst_bulk_tests3(unsigned int api_type, unsigne= d > > > > > > > > int > > > > > > create_flags, > > > > > > > > - const char *tname) > > > > > > > > +test_ring_burst_bulk_tests3(unsigned int test_idx) > > > > > > > > { > > > > > > > > struct rte_ring *r; > > > > > > > > void **src =3D NULL, **cur_src =3D NULL, **dst =3D NULL, > > > > > > > > **cur_dst =3D NULL; @@ -399,11 +575,13 @@ > > > > test_ring_burst_bulk_tests3(unsigned > > > > > > > > int api_type, unsigned int create_flags, > > > > > > > > unsigned int i, j; > > > > > > > > > > > > > > > > for (i =3D 0; i < RTE_DIM(esize); i++) { > > > > > > > > - test_ring_print_test_string(tname, api_type, esize[i]); > > > > > > > > + > > > > test_ring_print_test_string(test_enqdeq_impl[test_idx].desc, > > > > > > > > + test_enqdeq_impl[test_idx].api_type, esize[i]); > > > > > > > > > > > > > > > > /* Create the ring */ > > > > > > > > r =3D test_ring_create("test_ring_burst_bulk_tests", > > esize[i], > > > > > > > > - RING_SIZE, SOCKET_ID_ANY, > > > > > > > > create_flags); > > > > > > > > + RING_SIZE, SOCKET_ID_ANY, > > > > > > > > + > > > > test_enqdeq_impl[test_idx].create_flags); > > > > > > > > > > > > > > > > /* alloc dummy object pointers */ > > > > > > > > src =3D test_ring_calloc(RING_SIZE * 2, esize[i]); @@ > > > > > > > > -420,15 > > > > > > > > +598,15 @@ test_ring_burst_bulk_tests3(unsigned int > > > > > > > > +api_type, unsigned int > > > > > > > > create_flags, > > > > > > > > > > > > > > > > printf("fill and empty the ring\n"); > > > > > > > > for (j =3D 0; j < RING_SIZE / MAX_BULK; j++) { > > > > > > > > - ret =3D test_ring_enqueue(r, cur_src, esize[i], > > > > > > > > MAX_BULK, > > > > > > > > - api_type); > > > > > > > > + ret =3D test_ring_enq_impl(r, cur_src, esize[i], > > > > > > > > MAX_BULK, > > > > > > > > + test_idx); > > > > > > > > if (ret !=3D MAX_BULK) > > > > > > > > goto fail; > > > > > > > > cur_src =3D test_ring_inc_ptr(cur_src, esize[i], > > > > > > > > > > MAX_BULK); > > > > > > > > > > > > > > > > - ret =3D test_ring_dequeue(r, cur_dst, esize[i], > > > > > > > > MAX_BULK, > > > > > > > > - api_type); > > > > > > > > + ret =3D test_ring_deq_impl(r, cur_dst, esize[i], > > > > > > > > MAX_BULK, > > > > > > > > + test_idx); > > > > > > > > if (ret !=3D MAX_BULK) > > > > > > > > goto fail; > > > > > > > > cur_dst =3D test_ring_inc_ptr(cur_dst, esize[i], > > @@ - > > > > > > > > 465,21 +643,24 @@ test_ring_burst_bulk_tests3(unsigned int > > > > > > > > api_type, unsigned int create_flags, > > > > > > > > * Enqueue till the ring is full and dequeue till the ring= becomes > > empty. > > > > > > > > */ > > > > > > > > static int > > > > > > > > -test_ring_burst_bulk_tests4(unsigned int api_type, unsigne= d > > > > > > > > int > > > > > > create_flags, > > > > > > > > - const char *tname) > > > > > > > > +test_ring_burst_bulk_tests4(unsigned int test_idx) > > > > > > > > { > > > > > > > > struct rte_ring *r; > > > > > > > > void **src =3D NULL, **cur_src =3D NULL, **dst =3D NULL, = **cur_dst > > =3D NULL; > > > > > > > > int ret; > > > > > > > > unsigned int i, j; > > > > > > > > - unsigned int num_elems; > > > > > > > > + unsigned int api_type, num_elems; > > > > > > > > + > > > > > > > > + api_type =3D test_enqdeq_impl[test_idx].api_type; > > > > > > > > > > > > > > > > for (i =3D 0; i < RTE_DIM(esize); i++) { > > > > > > > > - test_ring_print_test_string(tname, api_type, esize[i]); > > > > > > > > + > > > > test_ring_print_test_string(test_enqdeq_impl[test_idx].desc, > > > > > > > > + test_enqdeq_impl[test_idx].api_type, esize[i]); > > > > > > > > > > > > > > > > /* Create the ring */ > > > > > > > > r =3D test_ring_create("test_ring_burst_bulk_tests", > > esize[i], > > > > > > > > - RING_SIZE, SOCKET_ID_ANY, > > > > > > > > create_flags); > > > > > > > > + RING_SIZE, SOCKET_ID_ANY, > > > > > > > > + > > > > test_enqdeq_impl[test_idx].create_flags); > > > > > > > > > > > > > > > > /* alloc dummy object pointers */ > > > > > > > > src =3D test_ring_calloc(RING_SIZE * 2, esize[i]); @@ > > > > > > > > -496,8 > > > > > > > > +677,8 @@ test_ring_burst_bulk_tests4(unsigned int api_type= , > > > > > > > > +unsigned int > > > > > > > > create_flags, > > > > > > > > > > > > > > > > printf("Test enqueue without enough memory > > space\n"); > > > > > > > > for (j =3D 0; j < (RING_SIZE/MAX_BULK - 1); j++) { > > > > > > > > - ret =3D test_ring_enqueue(r, cur_src, esize[i], > > > > > > > > MAX_BULK, > > > > > > > > - api_type); > > > > > > > > + ret =3D test_ring_enq_impl(r, cur_src, esize[i], > > > > > > > > MAX_BULK, > > > > > > > > + test_idx); > > > > > > > > if (ret !=3D MAX_BULK) > > > > > > > > goto fail; > > > > > > > > cur_src =3D test_ring_inc_ptr(cur_src, esize[i], > > @@ - > > > > > > > > 505,7 +686,7 @@ test_ring_burst_bulk_tests4(unsigned int > > > > > > > > api_type, unsigned int create_flags, > > > > > > > > } > > > > > > > > > > > > > > > > printf("Enqueue 2 objects, free entries =3D MAX_BULK - > > 2\n"); > > > > > > > > - ret =3D test_ring_enqueue(r, cur_src, esize[i], 2, > > > > api_type); > > > > > > > > + ret =3D test_ring_enq_impl(r, cur_src, esize[i], 2, > > > > test_idx); > > > > > > > > if (ret !=3D 2) > > > > > > > > goto fail; > > > > > > > > cur_src =3D test_ring_inc_ptr(cur_src, esize[i], 2); @@ > > > > > > > > -517,8 > > > > > > > > +698,8 @@ test_ring_burst_bulk_tests4(unsigned int api_type= , > > > > > > > > +unsigned int > > > > > > > > create_flags, > > > > > > > > else > > > > > > > > num_elems =3D MAX_BULK; > > > > > > > > /* Always one free entry left */ > > > > > > > > - ret =3D test_ring_enqueue(r, cur_src, esize[i], > > > > num_elems, > > > > > > > > - api_type); > > > > > > > > + ret =3D test_ring_enq_impl(r, cur_src, esize[i], > > > > num_elems, > > > > > > > > + test_idx); > > > > > > > > if (ret !=3D MAX_BULK - 3) > > > > > > > > goto fail; > > > > > > > > cur_src =3D test_ring_inc_ptr(cur_src, esize[i], > > MAX_BULK - > > > > > > > > 3); > > > > > > @@ > > > > > > > > -528,15 +709,15 @@ test_ring_burst_bulk_tests4(unsigned int > > > > > > > > api_type, unsigned int create_flags, > > > > > > > > goto fail; > > > > > > > > > > > > > > > > printf("Test enqueue for a full entry\n"); > > > > > > > > - ret =3D test_ring_enqueue(r, cur_src, esize[i], > > > > MAX_BULK, > > > > > > > > - api_type); > > > > > > > > + ret =3D test_ring_enq_impl(r, cur_src, esize[i], > > > > MAX_BULK, > > > > > > > > + test_idx); > > > > > > > > if (ret !=3D 0) > > > > > > > > goto fail; > > > > > > > > > > > > > > > > printf("Test dequeue without enough objects\n"); > > > > > > > > for (j =3D 0; j < RING_SIZE / MAX_BULK - 1; j++) { > > > > > > > > - ret =3D test_ring_dequeue(r, cur_dst, esize[i], > > > > > > > > MAX_BULK, > > > > > > > > - api_type); > > > > > > > > + ret =3D test_ring_deq_impl(r, cur_dst, esize[i], > > > > > > > > MAX_BULK, > > > > > > > > + test_idx); > > > > > > > > if (ret !=3D MAX_BULK) > > > > > > > > goto fail; > > > > > > > > cur_dst =3D test_ring_inc_ptr(cur_dst, esize[i], > > @@ - > > > > > > > > 544,7 +725,7 @@ test_ring_burst_bulk_tests4(unsigned int > > > > > > > > api_type, unsigned int create_flags, > > > > > > > > } > > > > > > > > > > > > > > > > /* Available memory space for the exact MAX_BULK > > entries > > > > > > */ > > > > > > > > - ret =3D test_ring_dequeue(r, cur_dst, esize[i], 2, > > > > api_type); > > > > > > > > + ret =3D test_ring_deq_impl(r, cur_dst, esize[i], 2, > > > > test_idx); > > > > > > > > if (ret !=3D 2) > > > > > > > > goto fail; > > > > > > > > cur_dst =3D test_ring_inc_ptr(cur_dst, esize[i], 2); @@ > > > > > > > > -554,8 > > > > > > > > +735,8 @@ test_ring_burst_bulk_tests4(unsigned int api_type= , > > > > > > > > +unsigned int > > > > > > > > create_flags, > > > > > > > > num_elems =3D MAX_BULK - 3; > > > > > > > > else > > > > > > > > num_elems =3D MAX_BULK; > > > > > > > > - ret =3D test_ring_dequeue(r, cur_dst, esize[i], > > > > num_elems, > > > > > > > > - api_type); > > > > > > > > + ret =3D test_ring_deq_impl(r, cur_dst, esize[i], > > > > num_elems, > > > > > > > > + test_idx); > > > > > > > > if (ret !=3D MAX_BULK - 3) > > > > > > > > goto fail; > > > > > > > > cur_dst =3D test_ring_inc_ptr(cur_dst, esize[i], > > MAX_BULK - > > > > > > > > 3); > > > > > > @@ > > > > > > > > -816,22 +997,7 @@ static int > > > > > > > > test_ring(void) > > > > > > > > { > > > > > > > > int32_t rc; > > > > > > > > - unsigned int i, j; > > > > > > > > - const char *tname; > > > > > > > > - > > > > > > > > - static const struct { > > > > > > > > - uint32_t create_flags; > > > > > > > > - const char *name; > > > > > > > > - } test_sync_modes[] =3D { > > > > > > > > - { > > > > > > > > - RING_F_MP_RTS_ENQ | > > > > RING_F_MC_RTS_DEQ, > > > > > > > > - "Test MT_RTS ring", > > > > > > > > - }, > > > > > > > > - { > > > > > > > > - RING_F_MP_HTS_ENQ | > > > > RING_F_MC_HTS_DEQ, > > > > > > > > - "Test MT_HTS ring", > > > > > > > > - }, > > > > > > > > - }; > > > > > > > > + unsigned int i; > > > > > > > > > > > > > > > > /* Negative test cases */ > > > > > > > > if (test_ring_negative_tests() < 0) @@ -848,65 +1014,24 @= @ > > > > > > > > test_ring(void) > > > > > > > > * The test cases are split into smaller test cases to > > > > > > > > * help clang compile faster. > > > > > > > > */ > > > > > > > > - tname =3D "Test standard ring"; > > > > > > > > - > > > > > > > > - for (j =3D TEST_RING_ELEM_BULK; j <=3D TEST_RING_ELEM_BUR= ST; > > > > j <<=3D 1) > > > > > > > > - for (i =3D TEST_RING_THREAD_DEF; > > > > > > > > - i <=3D > > > > TEST_RING_THREAD_MPMC; i > > > > > > > > <<=3D 1) > > > > > > > > - if (test_ring_burst_bulk_tests1(i | j, 0, tname) > > > > < 0) > > > > > > > > - goto test_fail; > > > > > > > > - > > > > > > > > - for (j =3D TEST_RING_ELEM_BULK; j <=3D TEST_RING_ELEM_BUR= ST; > > > > j <<=3D 1) > > > > > > > > - for (i =3D TEST_RING_THREAD_DEF; > > > > > > > > - i <=3D > > > > TEST_RING_THREAD_MPMC; i > > > > > > > > <<=3D 1) > > > > > > > > - if (test_ring_burst_bulk_tests2(i | j, 0, tname) > > > > < 0) > > > > > > > > - goto test_fail; > > > > > > > > - > > > > > > > > - for (j =3D TEST_RING_ELEM_BULK; j <=3D TEST_RING_ELEM_BUR= ST; > > > > j <<=3D 1) > > > > > > > > - for (i =3D TEST_RING_THREAD_DEF; > > > > > > > > - i <=3D > > > > TEST_RING_THREAD_MPMC; i > > > > > > > > <<=3D 1) > > > > > > > > - if (test_ring_burst_bulk_tests3(i | j, 0, tname) > > > > < 0) > > > > > > > > - goto test_fail; > > > > > > > > - > > > > > > > > - for (j =3D TEST_RING_ELEM_BULK; j <=3D TEST_RING_ELEM_BUR= ST; > > > > j <<=3D 1) > > > > > > > > - for (i =3D TEST_RING_THREAD_DEF; > > > > > > > > - i <=3D > > > > TEST_RING_THREAD_MPMC; i > > > > > > > > <<=3D 1) > > > > > > > > - if (test_ring_burst_bulk_tests4(i | j, 0, tname) > > > > < 0) > > > > > > > > - goto test_fail; > > > > > > > > - > > > > > > > > - /* Burst and bulk operations with MT_RTS and MT_HTS sync > > > > modes > > > > > > > > */ > > > > > > > > - for (i =3D 0; i !=3D RTE_DIM(test_sync_modes); i++) { > > > > > > > > - for (j =3D TEST_RING_ELEM_BULK; j <=3D > > > > TEST_RING_ELEM_BURST; > > > > > > > > - j <<=3D 1) { > > > > > > > > - > > > > > > > > - rc =3D test_ring_burst_bulk_tests1( > > > > > > > > - TEST_RING_THREAD_DEF | j, > > > > > > > > - test_sync_modes[i].create_flags, > > > > > > > > - test_sync_modes[i].name); > > > > > > > > - if (rc < 0) > > > > > > > > - goto test_fail; > > > > > > > > - > > > > > > > > - rc =3D test_ring_burst_bulk_tests2( > > > > > > > > - TEST_RING_THREAD_DEF | j, > > > > > > > > - test_sync_modes[i].create_flags, > > > > > > > > - test_sync_modes[i].name); > > > > > > > > - if (rc < 0) > > > > > > > > - goto test_fail; > > > > > > > > - > > > > > > > > - rc =3D test_ring_burst_bulk_tests3( > > > > > > > > - TEST_RING_THREAD_DEF | j, > > > > > > > > - test_sync_modes[i].create_flags, > > > > > > > > - test_sync_modes[i].name); > > > > > > > > - if (rc < 0) > > > > > > > > - goto test_fail; > > > > > > > > - > > > > > > > > - rc =3D test_ring_burst_bulk_tests3( > > > > > > > > - TEST_RING_THREAD_DEF | j, > > > > > > > > - test_sync_modes[i].create_flags, > > > > > > > > - test_sync_modes[i].name); > > > > > > > > - if (rc < 0) > > > > > > > > - goto test_fail; > > > > > > > > - } > > > > > > > > + for (i =3D 0; i !=3D RTE_DIM(test_enqdeq_impl); i++) { > > > > > > > > + > > > > > > > > + > > > > > > > > + rc =3D test_ring_burst_bulk_tests1(i); > > > > > > > > + if (rc < 0) > > > > > > > > + goto test_fail; > > > > > > > > + > > > > > > > > + rc =3D test_ring_burst_bulk_tests2(i); > > > > > > > > + if (rc < 0) > > > > > > > > + goto test_fail; > > > > > > > > + > > > > > > > > + rc =3D test_ring_burst_bulk_tests3(i); > > > > > > > > + if (rc < 0) > > > > > > > > + goto test_fail; > > > > > > > > + > > > > > > > > + rc =3D test_ring_burst_bulk_tests4(i); > > > > > > > > + if (rc < 0) > > > > > > > > + goto test_fail; > > > > > > > > } > > > > > > > > > > > > > > > > /* dump the ring status */ > > > > > > > > -- > > > > > > > > 2.17.1