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 A8392A00BE; Tue, 7 Jul 2020 16:04:24 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id E38141DD15; Tue, 7 Jul 2020 16:04:23 +0200 (CEST) Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by dpdk.org (Postfix) with ESMTP id 648AB1DCF7 for ; Tue, 7 Jul 2020 16:04:21 +0200 (CEST) IronPort-SDR: xX2o3cNbvtoX7lL9my4j2ngizK99c2E9IlInTGKO32dDiNgHqnIYVXVfPNa5NVn1obg2tljpfo nD3VTFEVPZNQ== X-IronPort-AV: E=McAfee;i="6000,8403,9674"; a="127685011" X-IronPort-AV: E=Sophos;i="5.75,324,1589266800"; d="scan'208";a="127685011" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Jul 2020 07:04:17 -0700 IronPort-SDR: kQSXlhCaihxM0Ef6ciEIQM2BDf5JW0MtFxWM9Yf9SzjfLsarGlZpO3rwCB4J7UxfRXF9xbQoc5 C/qITWbv+pGw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.75,324,1589266800"; d="scan'208";a="322668612" Received: from fmsmsx602.amr.corp.intel.com ([10.18.126.82]) by FMSMGA003.fm.intel.com with ESMTP; 07 Jul 2020 07:04:17 -0700 Received: from fmsmsx610.amr.corp.intel.com (10.18.126.90) by fmsmsx602.amr.corp.intel.com (10.18.126.82) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Tue, 7 Jul 2020 07:04:16 -0700 Received: from fmsmsx610.amr.corp.intel.com (10.18.126.90) by fmsmsx610.amr.corp.intel.com (10.18.126.90) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Tue, 7 Jul 2020 07:04:16 -0700 Received: from FMSEDG002.ED.cps.intel.com (10.1.192.134) by fmsmsx610.amr.corp.intel.com (10.18.126.90) 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 Jul 2020 07:04:16 -0700 Received: from NAM11-DM6-obe.outbound.protection.outlook.com (104.47.57.177) by edgegateway.intel.com (192.55.55.69) with Microsoft SMTP Server (TLS) id 14.3.439.0; Tue, 7 Jul 2020 07:04:16 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=XN19w+0eqyehysatnEScryJ1l8TZTpxMJlisWRuxG9cr76Ug07+S+uWZ1udGF3hWAg/rQ6Ndl/sgvMT9tyxBmb05LAJNIFoJDutK06+DufaotXkkWR9GL3LUGaWcQWznOppFqkfpZFzB19oqXaSbSLozwiPmI6JbUJj03aQYJDgY2Yff4Co2U75T/rE31JOyPgMEu6SOkVTbarGr+a755ZgHKsPE7UgBZlZ8n6IF9989nWmhyD91OMREkHZZd6D6WZeqYNaqL9d2IDpYPoWmi4/4Re0pvMb6zQdPOvQYsvxXOgphvzz5rPu84G4tn/FUEa9L9F1gec/PTyRwiJWX3g== 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=ZnwWMSRTe0ReCmImhM4uBvYURyqj3JkyOyFTefiZYc0=; b=IGM0If4fFfTlrxlLFCfiQDr9UjXn+xwq89m+Ln+pY979N5mpxrVYly/iIagWovq4hBPdUGBjxHJ2/20thGAJOxKrCtxLL8iIMWLoGxU8BNvN3QLOqtqCT6p2Zq66lv5Rwy0irVSK7XVE9+Vpw7ssSxjRvyj85w9loBd/CjmbAeZ62DVvX0XmwwXpMegD9jQiw/L7vN34yKiwIifwd8vNfmacAEFpFOeYt7SsUuglehCnags4frceu0QyIEUsfdKQfSNmDSBXq9LUH/9nIz9bFB+Y1deI2vG8JKk3EF1BFAIX5ImbS52YnEOCQfpSNrIescC3Inje+419JyaYhUINBg== 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=ZnwWMSRTe0ReCmImhM4uBvYURyqj3JkyOyFTefiZYc0=; b=C5u3cjBvdDBXMpet/zQo1MOcOpX3eUKoXQYoSGTs9fUO3jTAVJ7zbtIKtjDvI1WuKOtSAnkVkWwre1kyA6LejpCQLgdg7ag9pjLCmODnGIUy40dYy2UGsIdJSpn8xEIGo0cRNcKkVW+9WKJXJ0Q79MjxA58aw3l2NDvILzYE8NA= Received: from BYAPR11MB3301.namprd11.prod.outlook.com (2603:10b6:a03:7f::26) by BY5PR11MB4307.namprd11.prod.outlook.com (2603:10b6:a03:1bd::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3174.20; Tue, 7 Jul 2020 14:04:14 +0000 Received: from BYAPR11MB3301.namprd11.prod.outlook.com ([fe80::f160:29ab:b8f9:4189]) by BYAPR11MB3301.namprd11.prod.outlook.com ([fe80::f160:29ab:b8f9:4189%6]) with mapi id 15.20.3153.029; Tue, 7 Jul 2020 14:04:13 +0000 From: "Ananyev, Konstantin" To: Feifei Wang , Honnappa Nagarahalli , "drc@linux.vnet.ibm.com" CC: "dev@dpdk.org" , nd , Ruifeng Wang , nd Thread-Topic: [PATCH 3/3] ring: use element APIs to implement legacy APIs Thread-Index: AQHWUSSM8adxDbkzOUi+h3UPzGKBWKj7mgSAgACR7JA= Date: Tue, 7 Jul 2020 14:04:13 +0000 Message-ID: References: <20200703102651.8918-1-feifei.wang2@arm.com> <20200703102651.8918-4-feifei.wang2@arm.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.178] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: f9bef537-ff31-47a8-a357-08d8227ea13e x-ms-traffictypediagnostic: BY5PR11MB4307: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:9508; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: jqg6mnhwxpJNVX57Y98KtyrpKZBJJp73oNhNdq+hDw/0XbX6dwOG6KLqiVQ8dZN13opYwqI0njHGbzZibEE4E0hl3RXkb0MIExlhT081Y/Iuv30AoWFFJRhANdv5R7eYuHJJDXHe/jWl94GsynFtF9jT5vmdhEclRAaDrz+rkiS0dS5RTM7TCvMx9sul7YZ//5FxfW/nWUHLGR7d8G4+nTr/+tKfabXAOz7AcfjyJksgbgqXDx19mIhn6nUGf1f6TalNflOK+yy9PQIVjIqU7JE+51jLV7gLrUoT1JuzU3AwLP+ADBJlIUM5rJTQTibysFbHBj/1I9GpnmLjvp/UHmCwp+jFem8QSD56ZMP+k5NjhmswNzis/gZRoZJzzn0w 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:(4636009)(366004)(136003)(396003)(39860400002)(376002)(346002)(33656002)(316002)(8676002)(71200400001)(8936002)(478600001)(66556008)(66476007)(66946007)(5660300002)(30864003)(66446008)(76116006)(64756008)(52536014)(186003)(26005)(110136005)(4326008)(83380400001)(55016002)(2906002)(86362001)(54906003)(9686003)(7696005)(53546011)(6506007)(21314003); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata: 0aCRGCveZFmOr6+qsdhamgr5CxyAWVOf+6FBUveEdTMWSS1TfpZypDFnDaGH4WUWtvrdoYBuXk3MZeJmHDIrMbWBzuGwHULqzXgGROUObBCpEglf9j3DgW9sgrQDdNmCEYynYONma37EoSziHC04Xs2WcT9giDIkURFhU0u3OYXzVUdCnafJMr6YPYlVzMk3LVi8jcmY0gsMPV31dajpIA6E+QK0TiMQO0hB9P5GYcVTRNT5OhZAtp6Jghtu6c4kA1xqTkTDnDPxGaM6vUuVc3oNUcobWVBpFiauBQMbOsRIMwqGeve3OJNMETVMqkgMnPpPdbiPs7fobarih8OrFyrE+aDaNRZ9dtg9PXfba+/QTNPrrVISAn4KC9TQobuU0DUNZE3JCY7cynh4EqNQjBO4WJ1uahIDbq08UL0kOKR8NNprPI7dN8ARMRleZDYBpLz+UjgQ6jfBrnNymU6ZS+WhXBwHgZRus5ssiKhl67qdF7KOnZWiGMs37uqo80aG x-ms-exchange-transport-forked: True Content-Type: text/plain; charset="iso-2022-jp" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: BYAPR11MB3301.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: f9bef537-ff31-47a8-a357-08d8227ea13e X-MS-Exchange-CrossTenant-originalarrivaltime: 07 Jul 2020 14:04:13.7536 (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: p+NEut7+KatFp7fnnRDyZpnsDI0p/NtTo0vpWT0ZdzIENE77rWyKw5/63Vfq+jBtXB0G3lxJAsALe6rbohaSypM7ZP2wpbplIGAkwVWLRik= X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY5PR11MB4307 X-OriginatorOrg: intel.com Subject: Re: [dpdk-dev] [PATCH 3/3] ring: use element APIs to implement legacy APIs 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 Feifei, > Hi, Konstantin, David >=20 > I'm Feifei Wang from Arm. Sorry to make the following request: > Would you please do some ring performance tests of this patch in your pla= tforms at the time you are free? > And I want to know whether this patch has a significant impact on other p= latforms except ARM. I run few tests on SKX box and so far didn=1B$B!G=1B(Bt notice any real per= f difference. Konstantin =20 > Thanks very much. > Feifei >=20 > > -----Original Message----- > > From: Feifei Wang > > Sent: 2020=1B$BG/=1B(B7=1B$B7n=1B(B3=1B$BF|=1B(B 18:27 > > To: Honnappa Nagarahalli ; Konstantin > > Ananyev > > Cc: dev@dpdk.org; nd ; Feifei Wang > > > > Subject: [PATCH 3/3] ring: use element APIs to implement legacy APIs > > > > Use rte_ring_xxx_elem_xxx APIs to replace legacy API implementation. > > This reduces code duplication and improves code maintenance. > > > > aarch64: > > HW:N1sdp, 1 socket, 4 cores, 1 thread/core, 2.6GHz OS:Ubuntu 18.04.1 LT= S, > > Kernel: 5.4.0+ > > DPDK: 20.05-rc3, Configuration: arm64-n1sdp-linux-gcc > > gcc:9.2.1 > > > > $sudo ./arm64-n1sdp-linux-gcc/app/test -l 1-2 > > RTE>>ring_perf_autotest > > > > test results on aarch64 in the case of esize 4: > > > > without this patch with this pat= ch > > Testing burst enq/deq > > legacy APIs: SP/SC: burst (size: 8): 1.11 1.10 > > legacy APIs: SP/SC: burst (size: 32): 1.95 1.97 > > legacy APIs: MP/MC: burst (size: 8): 1.86 1.94 > > legacy APIs: MP/MC: burst (size: 32): 2.65 2.69 > > Testing bulk enq/deq > > legacy APIs: SP/SC: bulk (size: 8): 1.08 1.09 > > legacy APIs: SP/SC: bulk (size: 32): 1.89 1.90 > > legacy APIs: MP/MC: bulk (size: 8): 1.85 1.98 > > legacy APIs: MP/MC: bulk (size: 32): 2.65 2.69 > > > > x86: > > HW: dell, CPU Intel(R) Xeon(R) Gold 6240, 2 sockets, 18 cores/socket, > > 1 thread/core, 3.3GHz > > OS: Ubuntu 20.04 LTS, Kernel: 5.4.0-37-generic > > DPDK: 20.05-rc3, Configuration: x86_64-native-linuxapp-gcc > > gcc: 9.3.0 > > > > $sudo ./x86_64-native-linuxapp-gcc/app/test -l 14,16 > > RTE>>ring_perf_autotest > > > > test results on x86 in the case of esize 4: > > > > without this patch with this pat= ch > > Testing burst enq/deq > > legacy APIs: SP/SC: burst (size: 8): 29.35 27.78 > > legacy APIs: SP/SC: burst (size: 32): 73.11 73.39 > > legacy APIs: MP/MC: burst (size: 8): 62.36 62.37 > > legacy APIs: MP/MC: burst (size: 32): 101.01 101.03 > > Testing bulk enq/deq > > legacy APIs: SP/SC: bulk (size: 8): 25.94 29.55 > > legacy APIs: SP/SC: bulk (size: 32): 70.00 78.87 > > legacy APIs: MP/MC: bulk (size: 8): 63.41 62.48 > > legacy APIs: MP/MC: bulk (size: 32): 105.86 103.84 > > > > Summary: > > In aarch64 server with this patch, there is almost no performance diffe= rence. > > In x86 server with this patch, in some cases, the performance slightly > > improve, in other cases, the performance slightly drop. > > > > Signed-off-by: Feifei Wang > > Reviewed-by: Honnappa Nagarahalli > > Reviewed-by: Ruifeng Wang > > --- > > lib/librte_ring/rte_ring.h | 284 ++++--------------------------------- > > 1 file changed, 30 insertions(+), 254 deletions(-) > > > > diff --git a/lib/librte_ring/rte_ring.h b/lib/librte_ring/rte_ring.h in= dex > > 35f3f8c42..2a2190bfc 100644 > > --- a/lib/librte_ring/rte_ring.h > > +++ b/lib/librte_ring/rte_ring.h > > @@ -191,168 +191,6 @@ void rte_ring_free(struct rte_ring *r); > > */ > > void rte_ring_dump(FILE *f, const struct rte_ring *r); > > > > -/* the actual enqueue of pointers on the ring. > > - * Placed here since identical code needed in both > > - * single and multi producer enqueue functions */ -#define > > ENQUEUE_PTRS(r, ring_start, prod_head, obj_table, n, obj_type) do { \ > > - unsigned int i; \ > > - const uint32_t size =3D (r)->size; \ > > - uint32_t idx =3D prod_head & (r)->mask; \ > > - obj_type *ring =3D (obj_type *)ring_start; \ > > - if (likely(idx + n < size)) { \ > > - for (i =3D 0; i < (n & ~0x3); i +=3D 4, idx +=3D 4) { \ > > - ring[idx] =3D obj_table[i]; \ > > - ring[idx + 1] =3D obj_table[i + 1]; \ > > - ring[idx + 2] =3D obj_table[i + 2]; \ > > - ring[idx + 3] =3D obj_table[i + 3]; \ > > - } \ > > - switch (n & 0x3) { \ > > - case 3: \ > > - ring[idx++] =3D obj_table[i++]; /* fallthrough */ \ > > - case 2: \ > > - ring[idx++] =3D obj_table[i++]; /* fallthrough */ \ > > - case 1: \ > > - ring[idx++] =3D obj_table[i++]; \ > > - } \ > > - } else { \ > > - for (i =3D 0; idx < size; i++, idx++)\ > > - ring[idx] =3D obj_table[i]; \ > > - for (idx =3D 0; i < n; i++, idx++) \ > > - ring[idx] =3D obj_table[i]; \ > > - } \ > > -} while (0) > > - > > -/* the actual copy of pointers on the ring to obj_table. > > - * Placed here since identical code needed in both > > - * single and multi consumer dequeue functions */ -#define > > DEQUEUE_PTRS(r, ring_start, cons_head, obj_table, n, obj_type) do { \ > > - unsigned int i; \ > > - uint32_t idx =3D cons_head & (r)->mask; \ > > - const uint32_t size =3D (r)->size; \ > > - obj_type *ring =3D (obj_type *)ring_start; \ > > - if (likely(idx + n < size)) { \ > > - for (i =3D 0; i < (n & ~0x3); i +=3D 4, idx +=3D 4) {\ > > - obj_table[i] =3D ring[idx]; \ > > - obj_table[i + 1] =3D ring[idx + 1]; \ > > - obj_table[i + 2] =3D ring[idx + 2]; \ > > - obj_table[i + 3] =3D ring[idx + 3]; \ > > - } \ > > - switch (n & 0x3) { \ > > - case 3: \ > > - obj_table[i++] =3D ring[idx++]; /* fallthrough */ \ > > - case 2: \ > > - obj_table[i++] =3D ring[idx++]; /* fallthrough */ \ > > - case 1: \ > > - obj_table[i++] =3D ring[idx++]; \ > > - } \ > > - } else { \ > > - for (i =3D 0; idx < size; i++, idx++) \ > > - obj_table[i] =3D ring[idx]; \ > > - for (idx =3D 0; i < n; i++, idx++) \ > > - obj_table[i] =3D ring[idx]; \ > > - } \ > > -} while (0) > > - > > -/* Between load and load. there might be cpu reorder in weak model > > - * (powerpc/arm). > > - * There are 2 choices for the users > > - * 1.use rmb() memory barrier > > - * 2.use one-direction load_acquire/store_release barrier,defined by > > - * CONFIG_RTE_USE_C11_MEM_MODEL=3Dy > > - * It depends on performance test results. > > - * By default, move common functions to rte_ring_generic.h > > - */ > > -#ifdef RTE_USE_C11_MEM_MODEL > > -#include "rte_ring_c11_mem.h" > > -#else > > -#include "rte_ring_generic.h" > > -#endif > > - > > -/** > > - * @internal Enqueue several objects on the ring > > - * > > - * @param r > > - * A pointer to the ring structure. > > - * @param obj_table > > - * A pointer to a table of void * pointers (objects). > > - * @param n > > - * The number of objects to add in the ring from the obj_table. > > - * @param behavior > > - * RTE_RING_QUEUE_FIXED: Enqueue a fixed number of items from a > > ring > > - * RTE_RING_QUEUE_VARIABLE: Enqueue as many items as possible from > > ring > > - * @param is_sp > > - * Indicates whether to use single producer or multi-producer head u= pdate > > - * @param free_space > > - * returns the amount of space after the enqueue operation has finis= hed > > - * @return > > - * Actual number of objects enqueued. > > - * If behavior =3D=3D RTE_RING_QUEUE_FIXED, this will be 0 or n only= . > > - */ > > -static __rte_always_inline unsigned int -__rte_ring_do_enqueue(struct > > rte_ring *r, void * const *obj_table, > > - unsigned int n, enum rte_ring_queue_behavior behavior, > > - unsigned int is_sp, unsigned int *free_space) > > -{ > > - uint32_t prod_head, prod_next; > > - uint32_t free_entries; > > - > > - n =3D __rte_ring_move_prod_head(r, is_sp, n, behavior, > > - &prod_head, &prod_next, &free_entries); > > - if (n =3D=3D 0) > > - goto end; > > - > > - ENQUEUE_PTRS(r, &r[1], prod_head, obj_table, n, void *); > > - > > - update_tail(&r->prod, prod_head, prod_next, is_sp, 1); > > -end: > > - if (free_space !=3D NULL) > > - *free_space =3D free_entries - n; > > - return n; > > -} > > - > > -/** > > - * @internal Dequeue several objects from the ring > > - * > > - * @param r > > - * A pointer to the ring structure. > > - * @param obj_table > > - * A pointer to a table of void * pointers (objects). > > - * @param n > > - * The number of objects to pull from the ring. > > - * @param behavior > > - * RTE_RING_QUEUE_FIXED: Dequeue a fixed number of items from a > > ring > > - * RTE_RING_QUEUE_VARIABLE: Dequeue as many items as possible from > > ring > > - * @param is_sc > > - * Indicates whether to use single consumer or multi-consumer head > > update > > - * @param available > > - * returns the number of remaining ring entries after the dequeue ha= s > > finished > > - * @return > > - * - Actual number of objects dequeued. > > - * If behavior =3D=3D RTE_RING_QUEUE_FIXED, this will be 0 or n on= ly. > > - */ > > -static __rte_always_inline unsigned int -__rte_ring_do_dequeue(struct > > rte_ring *r, void **obj_table, > > - unsigned int n, enum rte_ring_queue_behavior behavior, > > - unsigned int is_sc, unsigned int *available) > > -{ > > - uint32_t cons_head, cons_next; > > - uint32_t entries; > > - > > - n =3D __rte_ring_move_cons_head(r, (int)is_sc, n, behavior, > > - &cons_head, &cons_next, &entries); > > - if (n =3D=3D 0) > > - goto end; > > - > > - DEQUEUE_PTRS(r, &r[1], cons_head, obj_table, n, void *); > > - > > - update_tail(&r->cons, cons_head, cons_next, is_sc, 0); > > - > > -end: > > - if (available !=3D NULL) > > - *available =3D entries - n; > > - return n; > > -} > > - > > /** > > * Enqueue several objects on the ring (multi-producers safe). > > * > > @@ -375,8 +213,8 @@ static __rte_always_inline unsigned int > > rte_ring_mp_enqueue_bulk(struct rte_ring *r, void * const *obj_table, > > unsigned int n, unsigned int *free_space) { > > - return __rte_ring_do_enqueue(r, obj_table, n, > > RTE_RING_QUEUE_FIXED, > > - RTE_RING_SYNC_MT, free_space); > > + return rte_ring_mp_enqueue_bulk_elem(r, obj_table, sizeof(void *), > > + n, free_space); > > } > > > > /** > > @@ -398,8 +236,8 @@ static __rte_always_inline unsigned int > > rte_ring_sp_enqueue_bulk(struct rte_ring *r, void * const *obj_table, > > unsigned int n, unsigned int *free_space) { > > - return __rte_ring_do_enqueue(r, obj_table, n, > > RTE_RING_QUEUE_FIXED, > > - RTE_RING_SYNC_ST, free_space); > > + return rte_ring_sp_enqueue_bulk_elem(r, obj_table, sizeof(void *), > > + n, free_space); > > } > > > > /** > > @@ -425,24 +263,8 @@ static __rte_always_inline unsigned int > > rte_ring_enqueue_bulk(struct rte_ring *r, void * const *obj_table, > > unsigned int n, unsigned int *free_space) { > > - switch (r->prod.sync_type) { > > - case RTE_RING_SYNC_MT: > > - return rte_ring_mp_enqueue_bulk(r, obj_table, n, > > free_space); > > - case RTE_RING_SYNC_ST: > > - return rte_ring_sp_enqueue_bulk(r, obj_table, n, > > free_space); > > -#ifdef ALLOW_EXPERIMENTAL_API > > - case RTE_RING_SYNC_MT_RTS: > > - return rte_ring_mp_rts_enqueue_bulk(r, obj_table, n, > > - free_space); > > - case RTE_RING_SYNC_MT_HTS: > > - return rte_ring_mp_hts_enqueue_bulk(r, obj_table, n, > > - free_space); > > -#endif > > - } > > - > > - /* valid ring should never reach this point */ > > - RTE_ASSERT(0); > > - return 0; > > + return rte_ring_enqueue_bulk_elem(r, obj_table, sizeof(void *), > > + n, free_space); > > } > > > > /** > > @@ -462,7 +284,7 @@ rte_ring_enqueue_bulk(struct rte_ring *r, void * > > const *obj_table, static __rte_always_inline int > > rte_ring_mp_enqueue(struct rte_ring *r, void *obj) { > > - return rte_ring_mp_enqueue_bulk(r, &obj, 1, NULL) ? 0 : -ENOBUFS; > > + return rte_ring_mp_enqueue_elem(r, obj, sizeof(void *)); > > } > > > > /** > > @@ -479,7 +301,7 @@ rte_ring_mp_enqueue(struct rte_ring *r, void *obj) > > static __rte_always_inline int rte_ring_sp_enqueue(struct rte_ring *r,= void > > *obj) { > > - return rte_ring_sp_enqueue_bulk(r, &obj, 1, NULL) ? 0 : -ENOBUFS; > > + return rte_ring_sp_enqueue_elem(r, obj, sizeof(void *)); > > } > > > > /** > > @@ -500,7 +322,7 @@ rte_ring_sp_enqueue(struct rte_ring *r, void *obj) > > static __rte_always_inline int rte_ring_enqueue(struct rte_ring *r, vo= id *obj) > > { > > - return rte_ring_enqueue_bulk(r, &obj, 1, NULL) ? 0 : -ENOBUFS; > > + return rte_ring_enqueue_elem(r, obj, sizeof(void *)); > > } > > > > /** > > @@ -525,8 +347,8 @@ static __rte_always_inline unsigned int > > rte_ring_mc_dequeue_bulk(struct rte_ring *r, void **obj_table, > > unsigned int n, unsigned int *available) { > > - return __rte_ring_do_dequeue(r, obj_table, n, > > RTE_RING_QUEUE_FIXED, > > - RTE_RING_SYNC_MT, available); > > + return rte_ring_mc_dequeue_bulk_elem(r, obj_table, sizeof(void *), > > + n, available); > > } > > > > /** > > @@ -549,8 +371,8 @@ static __rte_always_inline unsigned int > > rte_ring_sc_dequeue_bulk(struct rte_ring *r, void **obj_table, > > unsigned int n, unsigned int *available) { > > - return __rte_ring_do_dequeue(r, obj_table, n, > > RTE_RING_QUEUE_FIXED, > > - RTE_RING_SYNC_ST, available); > > + return rte_ring_sc_dequeue_bulk_elem(r, obj_table, sizeof(void *), > > + n, available); > > } > > > > /** > > @@ -576,22 +398,8 @@ static __rte_always_inline unsigned int > > rte_ring_dequeue_bulk(struct rte_ring *r, void **obj_table, unsigned in= t n, > > unsigned int *available) > > { > > - switch (r->cons.sync_type) { > > - case RTE_RING_SYNC_MT: > > - return rte_ring_mc_dequeue_bulk(r, obj_table, n, available); > > - case RTE_RING_SYNC_ST: > > - return rte_ring_sc_dequeue_bulk(r, obj_table, n, available); > > -#ifdef ALLOW_EXPERIMENTAL_API > > - case RTE_RING_SYNC_MT_RTS: > > - return rte_ring_mc_rts_dequeue_bulk(r, obj_table, n, > > available); > > - case RTE_RING_SYNC_MT_HTS: > > - return rte_ring_mc_hts_dequeue_bulk(r, obj_table, n, > > available); > > -#endif > > - } > > - > > - /* valid ring should never reach this point */ > > - RTE_ASSERT(0); > > - return 0; > > + return rte_ring_dequeue_bulk_elem(r, obj_table, sizeof(void *), > > + n, available); > > } > > > > /** > > @@ -612,7 +420,7 @@ rte_ring_dequeue_bulk(struct rte_ring *r, void > > **obj_table, unsigned int n, static __rte_always_inline int > > rte_ring_mc_dequeue(struct rte_ring *r, void **obj_p) { > > - return rte_ring_mc_dequeue_bulk(r, obj_p, 1, NULL) ? 0 : -ENOENT; > > + return rte_ring_mc_dequeue_elem(r, obj_p, sizeof(void *)); > > } > > > > /** > > @@ -630,7 +438,7 @@ rte_ring_mc_dequeue(struct rte_ring *r, void > > **obj_p) static __rte_always_inline int rte_ring_sc_dequeue(struct > > rte_ring *r, void **obj_p) { > > - return rte_ring_sc_dequeue_bulk(r, obj_p, 1, NULL) ? 0 : -ENOENT; > > + return rte_ring_sc_dequeue_elem(r, obj_p, sizeof(void *)); > > } > > > > /** > > @@ -652,7 +460,7 @@ rte_ring_sc_dequeue(struct rte_ring *r, void **obj_= p) > > static __rte_always_inline int rte_ring_dequeue(struct rte_ring *r, vo= id > > **obj_p) { > > - return rte_ring_dequeue_bulk(r, obj_p, 1, NULL) ? 0 : -ENOENT; > > + return rte_ring_dequeue_elem(r, obj_p, sizeof(void *)); > > } > > > > /** > > @@ -860,8 +668,8 @@ static __rte_always_inline unsigned int > > rte_ring_mp_enqueue_burst(struct rte_ring *r, void * const *obj_table, > > unsigned int n, unsigned int *free_space) { > > - return __rte_ring_do_enqueue(r, obj_table, n, > > - RTE_RING_QUEUE_VARIABLE, RTE_RING_SYNC_MT, > > free_space); > > + return rte_ring_mp_enqueue_burst_elem(r, obj_table, sizeof(void > > *), > > + n, free_space); > > } > > > > /** > > @@ -883,8 +691,8 @@ static __rte_always_inline unsigned int > > rte_ring_sp_enqueue_burst(struct rte_ring *r, void * const *obj_table, > > unsigned int n, unsigned int *free_space) { > > - return __rte_ring_do_enqueue(r, obj_table, n, > > - RTE_RING_QUEUE_VARIABLE, RTE_RING_SYNC_ST, > > free_space); > > + return rte_ring_sp_enqueue_burst_elem(r, obj_table, sizeof(void *), > > + n, free_space); > > } > > > > /** > > @@ -910,24 +718,8 @@ static __rte_always_inline unsigned int > > rte_ring_enqueue_burst(struct rte_ring *r, void * const *obj_table, > > unsigned int n, unsigned int *free_space) { > > - switch (r->prod.sync_type) { > > - case RTE_RING_SYNC_MT: > > - return rte_ring_mp_enqueue_burst(r, obj_table, n, > > free_space); > > - case RTE_RING_SYNC_ST: > > - return rte_ring_sp_enqueue_burst(r, obj_table, n, > > free_space); > > -#ifdef ALLOW_EXPERIMENTAL_API > > - case RTE_RING_SYNC_MT_RTS: > > - return rte_ring_mp_rts_enqueue_burst(r, obj_table, n, > > - free_space); > > - case RTE_RING_SYNC_MT_HTS: > > - return rte_ring_mp_hts_enqueue_burst(r, obj_table, n, > > - free_space); > > -#endif > > - } > > - > > - /* valid ring should never reach this point */ > > - RTE_ASSERT(0); > > - return 0; > > + return rte_ring_enqueue_burst_elem(r, obj_table, sizeof(void *), > > + n, free_space); > > } > > > > /** > > @@ -954,8 +746,8 @@ static __rte_always_inline unsigned int > > rte_ring_mc_dequeue_burst(struct rte_ring *r, void **obj_table, > > unsigned int n, unsigned int *available) { > > - return __rte_ring_do_dequeue(r, obj_table, n, > > - RTE_RING_QUEUE_VARIABLE, RTE_RING_SYNC_MT, > > available); > > + return rte_ring_mc_dequeue_burst_elem(r, obj_table, sizeof(void > > *), > > + n, available); > > } > > > > /** > > @@ -979,8 +771,8 @@ static __rte_always_inline unsigned int > > rte_ring_sc_dequeue_burst(struct rte_ring *r, void **obj_table, > > unsigned int n, unsigned int *available) { > > - return __rte_ring_do_dequeue(r, obj_table, n, > > - RTE_RING_QUEUE_VARIABLE, RTE_RING_SYNC_ST, > > available); > > + return rte_ring_sc_dequeue_burst_elem(r, obj_table, sizeof(void *), > > + n, available); > > } > > > > /** > > @@ -1006,24 +798,8 @@ static __rte_always_inline unsigned int > > rte_ring_dequeue_burst(struct rte_ring *r, void **obj_table, > > unsigned int n, unsigned int *available) { > > - switch (r->cons.sync_type) { > > - case RTE_RING_SYNC_MT: > > - return rte_ring_mc_dequeue_burst(r, obj_table, n, > > available); > > - case RTE_RING_SYNC_ST: > > - return rte_ring_sc_dequeue_burst(r, obj_table, n, available); > > -#ifdef ALLOW_EXPERIMENTAL_API > > - case RTE_RING_SYNC_MT_RTS: > > - return rte_ring_mc_rts_dequeue_burst(r, obj_table, n, > > - available); > > - case RTE_RING_SYNC_MT_HTS: > > - return rte_ring_mc_hts_dequeue_burst(r, obj_table, n, > > - available); > > -#endif > > - } > > - > > - /* valid ring should never reach this point */ > > - RTE_ASSERT(0); > > - return 0; > > + return rte_ring_dequeue_burst_elem(r, obj_table, sizeof(void *), > > + n, available); > > } > > > > #ifdef __cplusplus > > -- > > 2.17.1