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 8C6D4A2EDB for ; Wed, 2 Oct 2019 10:40:05 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 61E6A1BDFD; Wed, 2 Oct 2019 10:40:04 +0200 (CEST) Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by dpdk.org (Postfix) with ESMTP id E508F1B952 for ; Wed, 2 Oct 2019 10:40:01 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 02 Oct 2019 01:40:00 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,573,1559545200"; d="scan'208";a="190878837" Received: from irsmsx103.ger.corp.intel.com ([163.33.3.157]) by fmsmga008.fm.intel.com with ESMTP; 02 Oct 2019 01:39:58 -0700 Received: from irsmsx155.ger.corp.intel.com (163.33.192.3) by IRSMSX103.ger.corp.intel.com (163.33.3.157) with Microsoft SMTP Server (TLS) id 14.3.439.0; Wed, 2 Oct 2019 09:39:57 +0100 Received: from irsmsx105.ger.corp.intel.com ([169.254.7.164]) by irsmsx155.ger.corp.intel.com ([169.254.14.139]) with mapi id 14.03.0439.000; Wed, 2 Oct 2019 09:39:57 +0100 From: "Ananyev, Konstantin" To: Honnappa Nagarahalli , "olivier.matz@6wind.com" , "Wang, Yipeng1" , "Gobriel, Sameh" , "Richardson, Bruce" , "De Lara Guarch, Pablo" CC: "dev@dpdk.org" , Dharmik Thakkar , "Gavin Hu (Arm Technology China)" , "Ruifeng Wang (Arm Technology China)" , nd , nd Thread-Topic: [dpdk-dev] [PATCH 2/5] lib/ring: add template to support different element sizes Thread-Index: AQHVXa90autmMQgO70SevYhypWJbKqdF3rfwgAEG+ICAAFeBkA== Date: Wed, 2 Oct 2019 08:39:56 +0000 Message-ID: <2601191342CEEE43887BDE71AB977258019196FAC9@irsmsx105.ger.corp.intel.com> References: <20190828144614.25284-1-honnappa.nagarahalli@arm.com> <20190828144614.25284-3-honnappa.nagarahalli@arm.com> <2601191342CEEE43887BDE71AB977258019196E21E@irsmsx105.ger.corp.intel.com> In-Reply-To: Accept-Language: en-IE, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiYmRjNWI1YTgtZTQ3ZC00ZWE3LWE1MjQtYWJkMGJmOTdlZGU4IiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiYzU4SCsyamFZUmFVT2ZrbytRMFRrZlwvZTdSYm1yU3BUcnZEN2FTRUVLdXFQdHFreEttSGJ3Mzk4UHFENFwvSWFzIn0= x-ctpclassification: CTP_NT dlp-product: dlpe-windows dlp-version: 11.2.0.6 dlp-reaction: no-action x-originating-ip: [163.33.239.180] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH 2/5] lib/ring: add template to support different element sizes 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" > -----Original Message----- > From: Honnappa Nagarahalli [mailto:Honnappa.Nagarahalli@arm.com] > Sent: Wednesday, October 2, 2019 5:22 AM > To: Ananyev, Konstantin ; olivier.matz@6win= d.com; Wang, Yipeng1 ; Gobriel, > Sameh ; Richardson, Bruce ; De Lara Guarch, Pablo > > Cc: dev@dpdk.org; Dharmik Thakkar ; Gavin Hu (Ar= m Technology China) ; Ruifeng > Wang (Arm Technology China) ; Honnappa Nagarahalli = ; nd > ; nd > Subject: RE: [dpdk-dev] [PATCH 2/5] lib/ring: add template to support dif= ferent element sizes >=20 > > > Add templates to support creating ring APIs with different ring > > > element sizes. > > > > > > Signed-off-by: Honnappa Nagarahalli > > > Reviewed-by: Dharmik Thakkar > > > Reviewed-by: Gavin Hu > > > Reviewed-by: Ruifeng Wang > > > --- > > > lib/librte_ring/Makefile | 4 +- > > > lib/librte_ring/meson.build | 4 +- > > > lib/librte_ring/rte_ring_template.c | 46 ++++ > > > lib/librte_ring/rte_ring_template.h | 330 +++++++++++++++++++++++++++= + > > > 4 files changed, 382 insertions(+), 2 deletions(-) create mode > > > 100644 lib/librte_ring/rte_ring_template.c > > > create mode 100644 lib/librte_ring/rte_ring_template.h > > > > > > diff --git a/lib/librte_ring/Makefile b/lib/librte_ring/Makefile inde= x > > > 4c8410229..818898110 100644 > > > --- a/lib/librte_ring/Makefile > > > +++ b/lib/librte_ring/Makefile > > > @@ -19,6 +19,8 @@ SRCS-$(CONFIG_RTE_LIBRTE_RING) :=3D rte_ring.c # > > > install includes SYMLINK-$(CONFIG_RTE_LIBRTE_RING)-include :=3D > > > rte_ring.h \ > > > rte_ring_generic.h \ > > > - rte_ring_c11_mem.h > > > + rte_ring_c11_mem.h \ > > > + rte_ring_template.h \ > > > + rte_ring_template.c > > > > > > include $(RTE_SDK)/mk/rte.lib.mk > > > diff --git a/lib/librte_ring/meson.build b/lib/librte_ring/meson.buil= d > > > index 74219840a..e4e208a7c 100644 > > > --- a/lib/librte_ring/meson.build > > > +++ b/lib/librte_ring/meson.build > > > @@ -5,7 +5,9 @@ version =3D 2 > > > sources =3D files('rte_ring.c') > > > headers =3D files('rte_ring.h', > > > 'rte_ring_c11_mem.h', > > > - 'rte_ring_generic.h') > > > + 'rte_ring_generic.h', > > > + 'rte_ring_template.h', > > > + 'rte_ring_template.c') > > > > > > # rte_ring_create_elem and rte_ring_get_memsize_elem are experimenta= l > > > allow_experimental_apis =3D true diff --git > > > a/lib/librte_ring/rte_ring_template.c > > > b/lib/librte_ring/rte_ring_template.c > > > new file mode 100644 > > > index 000000000..1ca593f95 > > > --- /dev/null > > > +++ b/lib/librte_ring/rte_ring_template.c > > > @@ -0,0 +1,46 @@ > > > +/* SPDX-License-Identifier: BSD-3-Clause > > > + * Copyright (c) 2019 Arm Limited > > > + */ > > > + > > > +#include > > > +#include > > > +#include > > > +#include > > > +#include > > > +#include > > > +#include > > > + > > > +#include > > > +#include > > > +#include > > > +#include > > > +#include > > > +#include > > > +#include > > > +#include > > > +#include > > > +#include > > > +#include > > > +#include > > > +#include > > > +#include > > > +#include > > > +#include > > > + > > > +#include "rte_ring.h" > > > + > > > +/* return the size of memory occupied by a ring */ ssize_t > > > +__RTE_RING_CONCAT(rte_ring_get_memsize)(unsigned count) { > > > + return rte_ring_get_memsize_elem(count, > > RTE_RING_TMPLT_ELEM_SIZE); } > > > + > > > +/* create the ring */ > > > +struct rte_ring * > > > +__RTE_RING_CONCAT(rte_ring_create)(const char *name, unsigned count, > > > + int socket_id, unsigned flags) > > > +{ > > > + return rte_ring_create_elem(name, count, > > RTE_RING_TMPLT_ELEM_SIZE, > > > + socket_id, flags); > > > +} > > > diff --git a/lib/librte_ring/rte_ring_template.h > > > b/lib/librte_ring/rte_ring_template.h > > > new file mode 100644 > > > index 000000000..b9b14dfbb > > > --- /dev/null > > > +++ b/lib/librte_ring/rte_ring_template.h > > > @@ -0,0 +1,330 @@ > > > +/* SPDX-License-Identifier: BSD-3-Clause > > > + * Copyright (c) 2019 Arm Limited > > > + */ > > > + > > > +#ifndef _RTE_RING_TEMPLATE_H_ > > > +#define _RTE_RING_TEMPLATE_H_ > > > + > > > +#ifdef __cplusplus > > > +extern "C" { > > > +#endif > > > + > > > +#include > > > +#include > > > +#include > > > +#include > > > +#include > > > +#include > > > +#include > > > +#include > > > +#include > > > +#include > > > +#include > > > +#include > > > +#include > > > + > > > +/* Ring API suffix name - used to append to API names */ #ifndef > > > +RTE_RING_TMPLT_API_SUFFIX #error RTE_RING_TMPLT_API_SUFFIX not > > > +defined #endif > > > + > > > +/* Ring's element size in bits, should be a power of 2 */ #ifndef > > > +RTE_RING_TMPLT_ELEM_SIZE #error RTE_RING_TMPLT_ELEM_SIZE not > > defined > > > +#endif > > > + > > > +/* Type of ring elements */ > > > +#ifndef RTE_RING_TMPLT_ELEM_TYPE > > > +#error RTE_RING_TMPLT_ELEM_TYPE not defined #endif > > > + > > > +#define _rte_fuse(a, b) a##_##b > > > +#define __rte_fuse(a, b) _rte_fuse(a, b) #define __RTE_RING_CONCAT(a= ) > > > +__rte_fuse(a, RTE_RING_TMPLT_API_SUFFIX) > > > + > > > +/* Calculate the memory size needed for a ring */ > > > +RTE_RING_TMPLT_EXPERIMENTAL ssize_t > > > +__RTE_RING_CONCAT(rte_ring_get_memsize)(unsigned count); > > > + > > > +/* Create a new ring named *name* in memory. */ > > > +RTE_RING_TMPLT_EXPERIMENTAL struct rte_ring * > > > +__RTE_RING_CONCAT(rte_ring_create)(const char *name, unsigned count, > > > + int socket_id, unsigned flags); > > > > > > Just an idea - probably same thing can be achieved in a different way. > > Instead of all these defines - replace ENQUEUE_PTRS/DEQUEUE_PTRS macros > > with static inline functions and then make all internal functions, i.e. > > __rte_ring_do_dequeue() > > to accept enqueue/dequeue function pointer as a parameter. > > Then let say default rte_ring_mc_dequeue_bulk will do: > > > > 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_FI= XED, > > __IS_MC, available, dequeue_ptr_default); > > } > > > > Then if someone will like to define ring functions forelt_size=3D=3DX, = all he would > > need to do: > > 1. define his own enqueue/dequeuer functions. > > 2. do something like: > > 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_FI= XED, > > __IS_MC, available, dequeue_X); > > } > > > > Konstantin > Thanks for the feedback/idea. The goal of this patch was to make it simpl= e enough to define APIs to store any element size without code > duplication.=20 Well, then if we store elt_size inside the ring, it should be easy enough to add to the API generic functions that would use memcpy(or rte_memcpy) f= or enqueue/dequeue. Yes, it might be slower than existing (8B per elem), but might be still acc= eptable. >With this patch, the user has to write ~4 lines of code to get APIs for an= y element size. I would like to keep the goal still the > same. >=20 > If we have to avoid the macro-fest, the main problem that needs to be add= ressed is - how to represent different sizes of element types in a > generic way? IMO, we can do this by defining the element type to be a mul= tiple of uint32_t (I do not think we need to go to uint16_t). >=20 > For ex: > rte_ring_mp_enqueue_bulk_objs(struct rte_ring *r, > uint32_t *obj_table, unsigned int num_objs, > unsigned int n, > enum rte_ring_queue_behavior behavior, unsigned int is_sp= , > unsigned int *free_space) > { > } >=20 > This approach would ensure that we have generic enough APIs and they can = be used for elements of any size. But the element itself needs > to be a multiple of 32b - I think this should not be a concern. >=20 > The API suffix definitely needs to be better, any suggestions? >=20 > > > > > > > + > > > +/** > > > + * @internal Enqueue several objects on the ring > > > + */ > > > +static __rte_always_inline unsigned int > > > +__RTE_RING_CONCAT(__rte_ring_do_enqueue)(struct rte_ring *r, > > > + RTE_RING_TMPLT_ELEM_TYPE 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, > > > + RTE_RING_TMPLT_ELEM_TYPE); > > > + > > > + 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 > > > + */ > > > +static __rte_always_inline unsigned int > > > +__RTE_RING_CONCAT(__rte_ring_do_dequeue)(struct rte_ring *r, > > > + RTE_RING_TMPLT_ELEM_TYPE *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, > > > + RTE_RING_TMPLT_ELEM_TYPE); > > > + > > > + 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). > > > + */ > > > +static __rte_always_inline unsigned int > > > +__RTE_RING_CONCAT(rte_ring_mp_enqueue_bulk)(struct rte_ring *r, > > > + RTE_RING_TMPLT_ELEM_TYPE const *obj_table, unsigned int n, > > > + unsigned int *free_space) > > > +{ > > > + return __RTE_RING_CONCAT(__rte_ring_do_enqueue)(r, obj_table, n, > > > + RTE_RING_QUEUE_FIXED, __IS_MP, free_space); > > > +} > > > + > > > +/** > > > + * Enqueue several objects on a ring (NOT multi-producers safe). > > > + */ > > > +static __rte_always_inline unsigned int > > > +__RTE_RING_CONCAT(rte_ring_sp_enqueue_bulk)(struct rte_ring *r, > > > + RTE_RING_TMPLT_ELEM_TYPE const *obj_table, unsigned int n, > > > + unsigned int *free_space) > > > +{ > > > + return __RTE_RING_CONCAT(__rte_ring_do_enqueue)(r, obj_table, n, > > > + RTE_RING_QUEUE_FIXED, __IS_SP, free_space); > > > +} > > > + > > > +/** > > > + * Enqueue several objects on a ring. > > > + */ > > > +static __rte_always_inline unsigned int > > > +__RTE_RING_CONCAT(rte_ring_enqueue_bulk)(struct rte_ring *r, > > > + RTE_RING_TMPLT_ELEM_TYPE const *obj_table, unsigned int n, > > > + unsigned int *free_space) > > > +{ > > > + return __RTE_RING_CONCAT(__rte_ring_do_enqueue)(r, obj_table, n, > > > + RTE_RING_QUEUE_FIXED, r->prod.single, free_space); > > > +} > > > + > > > +/** > > > + * Enqueue one object on a ring (multi-producers safe). > > > + */ > > > +static __rte_always_inline int > > > +__RTE_RING_CONCAT(rte_ring_mp_enqueue)(struct rte_ring *r, > > > + RTE_RING_TMPLT_ELEM_TYPE obj) > > > +{ > > > + return __RTE_RING_CONCAT(rte_ring_mp_enqueue_bulk)(r, &obj, 1, > > NULL) ? > > > + 0 : -ENOBUFS; > > > +} > > > + > > > +/** > > > + * Enqueue one object on a ring (NOT multi-producers safe). > > > + */ > > > +static __rte_always_inline int > > > +__RTE_RING_CONCAT(rte_ring_sp_enqueue)(struct rte_ring *r, > > > + RTE_RING_TMPLT_ELEM_TYPE obj) > > > +{ > > > + return __RTE_RING_CONCAT(rte_ring_sp_enqueue_bulk)(r, &obj, 1, > > NULL) ? > > > + 0 : -ENOBUFS; > > > +} > > > + > > > +/** > > > + * Enqueue one object on a ring. > > > + */ > > > +static __rte_always_inline int > > > +__RTE_RING_CONCAT(rte_ring_enqueue)(struct rte_ring *r, > > > + RTE_RING_TMPLT_ELEM_TYPE *obj) > > > +{ > > > + return __RTE_RING_CONCAT(rte_ring_enqueue_bulk)(r, obj, 1, > > NULL) ? > > > + 0 : -ENOBUFS; > > > +} > > > + > > > +/** > > > + * Dequeue several objects from a ring (multi-consumers safe). > > > + */ > > > +static __rte_always_inline unsigned int > > > +__RTE_RING_CONCAT(rte_ring_mc_dequeue_bulk)(struct rte_ring *r, > > > + RTE_RING_TMPLT_ELEM_TYPE *obj_table, unsigned int n, > > > + unsigned int *available) > > > +{ > > > + return __RTE_RING_CONCAT(__rte_ring_do_dequeue)(r, obj_table, n, > > > + RTE_RING_QUEUE_FIXED, __IS_MC, available); > > > +} > > > + > > > +/** > > > + * Dequeue several objects from a ring (NOT multi-consumers safe). > > > + */ > > > +static __rte_always_inline unsigned int > > > +__RTE_RING_CONCAT(rte_ring_sc_dequeue_bulk)(struct rte_ring *r, > > > + RTE_RING_TMPLT_ELEM_TYPE *obj_table, unsigned int n, > > > + unsigned int *available) > > > +{ > > > + return __RTE_RING_CONCAT(__rte_ring_do_dequeue)(r, obj_table, n, > > > + RTE_RING_QUEUE_FIXED, __IS_SC, available); > > > +} > > > + > > > +/** > > > + * Dequeue several objects from a ring. > > > + */ > > > +static __rte_always_inline unsigned int > > > +__RTE_RING_CONCAT(rte_ring_dequeue_bulk)(struct rte_ring *r, > > > + RTE_RING_TMPLT_ELEM_TYPE *obj_table, unsigned int n, > > > + unsigned int *available) > > > +{ > > > + return __RTE_RING_CONCAT(__rte_ring_do_dequeue)(r, obj_table, n, > > > + RTE_RING_QUEUE_FIXED, r->cons.single, available); > > > +} > > > + > > > +/** > > > + * Dequeue one object from a ring (multi-consumers safe). > > > + */ > > > +static __rte_always_inline int > > > +__RTE_RING_CONCAT(rte_ring_mc_dequeue)(struct rte_ring *r, > > > + RTE_RING_TMPLT_ELEM_TYPE *obj_p) > > > +{ > > > + return __RTE_RING_CONCAT(rte_ring_mc_dequeue_bulk)(r, obj_p, 1, > > NULL) ? > > > + 0 : -ENOENT; > > > +} > > > + > > > +/** > > > + * Dequeue one object from a ring (NOT multi-consumers safe). > > > + */ > > > +static __rte_always_inline int > > > +__RTE_RING_CONCAT(rte_ring_sc_dequeue)(struct rte_ring *r, > > > + RTE_RING_TMPLT_ELEM_TYPE *obj_p) > > > +{ > > > + return __RTE_RING_CONCAT(rte_ring_sc_dequeue_bulk)(r, obj_p, 1, > > NULL) ? > > > + 0 : -ENOENT; > > > +} > > > + > > > +/** > > > + * Dequeue one object from a ring. > > > + */ > > > +static __rte_always_inline int > > > +__RTE_RING_CONCAT(rte_ring_dequeue)(struct rte_ring *r, > > > + RTE_RING_TMPLT_ELEM_TYPE *obj_p) > > > +{ > > > + return __RTE_RING_CONCAT(rte_ring_dequeue_bulk)(r, obj_p, 1, > > NULL) ? > > > + 0 : -ENOENT; > > > +} > > > + > > > +/** > > > + * Enqueue several objects on the ring (multi-producers safe). > > > + */ > > > +static __rte_always_inline unsigned > > > +__RTE_RING_CONCAT(rte_ring_mp_enqueue_burst)(struct rte_ring *r, > > > + RTE_RING_TMPLT_ELEM_TYPE *obj_table, > > > + unsigned int n, unsigned int *free_space) > > > +{ > > > + return __RTE_RING_CONCAT(__rte_ring_do_enqueue)(r, obj_table, n, > > > + RTE_RING_QUEUE_VARIABLE, __IS_MP, free_space); > > > +} > > > + > > > +/** > > > + * Enqueue several objects on a ring (NOT multi-producers safe). > > > + */ > > > +static __rte_always_inline unsigned > > > +__RTE_RING_CONCAT(rte_ring_sp_enqueue_burst)(struct rte_ring *r, > > > + RTE_RING_TMPLT_ELEM_TYPE *obj_table, > > > + unsigned int n, unsigned int *free_space) > > > +{ > > > + return __RTE_RING_CONCAT(__rte_ring_do_enqueue)(r, obj_table, n, > > > + RTE_RING_QUEUE_VARIABLE, __IS_SP, free_space); > > > +} > > > + > > > +/** > > > + * Enqueue several objects on a ring. > > > + */ > > > +static __rte_always_inline unsigned > > > +__RTE_RING_CONCAT(rte_ring_enqueue_burst)(struct rte_ring *r, > > > + RTE_RING_TMPLT_ELEM_TYPE *obj_table, unsigned int n, > > > + unsigned int *free_space) > > > +{ > > > + return __RTE_RING_CONCAT(__rte_ring_do_enqueue)(r, obj_table, n, > > > + RTE_RING_QUEUE_VARIABLE, r->prod.single, > > free_space); > > > +} > > > + > > > +/** > > > + * Dequeue several objects from a ring (multi-consumers safe). When = the > > request > > > + * objects are more than the available objects, only dequeue the act= ual > > number > > > + * of objects > > > + */ > > > +static __rte_always_inline unsigned > > > +__RTE_RING_CONCAT(rte_ring_mc_dequeue_burst)(struct rte_ring *r, > > > + RTE_RING_TMPLT_ELEM_TYPE *obj_table, unsigned int n, > > > + unsigned int *available) > > > +{ > > > + return __RTE_RING_CONCAT(__rte_ring_do_dequeue)(r, obj_table, n, > > > + RTE_RING_QUEUE_VARIABLE, __IS_MC, available); > > > +} > > > + > > > +/** > > > + * Dequeue several objects from a ring (NOT multi-consumers safe).Wh= en > > the > > > + * request objects are more than the available objects, only dequeue= the > > > + * actual number of objects > > > + */ > > > +static __rte_always_inline unsigned > > > +__RTE_RING_CONCAT(rte_ring_sc_dequeue_burst)(struct rte_ring *r, > > > + RTE_RING_TMPLT_ELEM_TYPE *obj_table, unsigned int n, > > > + unsigned int *available) > > > +{ > > > + return __RTE_RING_CONCAT(__rte_ring_do_dequeue)(r, obj_table, n, > > > + RTE_RING_QUEUE_VARIABLE, __IS_SC, available); > > > +} > > > + > > > +/** > > > + * Dequeue multiple objects from a ring up to a maximum number. > > > + */ > > > +static __rte_always_inline unsigned > > > +__RTE_RING_CONCAT(rte_ring_dequeue_burst)(struct rte_ring *r, > > > + RTE_RING_TMPLT_ELEM_TYPE *obj_table, unsigned int n, > > > + unsigned int *available) > > > +{ > > > + return __RTE_RING_CONCAT(__rte_ring_do_dequeue)(r, obj_table, n, > > > + RTE_RING_QUEUE_VARIABLE, > > > + r->cons.single, available); > > > +} > > > + > > > +#ifdef __cplusplus > > > +} > > > +#endif > > > + > > > +#endif /* _RTE_RING_TEMPLATE_H_ */ > > > -- > > > 2.17.1