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 06B1EA0577; Tue, 14 Apr 2020 18:47:09 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id B765F1C2F2; Tue, 14 Apr 2020 18:47:08 +0200 (CEST) Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by dpdk.org (Postfix) with ESMTP id 3FC371C2BB for ; Tue, 14 Apr 2020 18:47:05 +0200 (CEST) IronPort-SDR: znGSt8uZpxJjbrRYqX0egCtLp+KJDUolkUOaXxli06a3nSeMwYC4p9hSB9u1MuKxG45fMDWEOE qDunvqoLfU0Q== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Apr 2020 09:47:04 -0700 IronPort-SDR: lxw8m8fZWOPCu/bAzFp8MKheSL5BLbEboQVrUEOOiE+RMvNQs9/Zgencx+J9q8Z/I8HCHwtIHI BA2tWX1rgbwA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.72,383,1580803200"; d="scan'208";a="270887355" Received: from orsmsx110.amr.corp.intel.com ([10.22.240.8]) by orsmga008.jf.intel.com with ESMTP; 14 Apr 2020 09:47:04 -0700 Received: from ORSEDG002.ED.cps.intel.com (10.7.248.5) by ORSMSX110.amr.corp.intel.com (10.22.240.8) with Microsoft SMTP Server (TLS) id 14.3.439.0; Tue, 14 Apr 2020 09:47:04 -0700 Received: from NAM12-DM6-obe.outbound.protection.outlook.com (104.47.59.171) by edgegateway.intel.com (134.134.137.101) with Microsoft SMTP Server (TLS) id 14.3.439.0; Tue, 14 Apr 2020 09:47:03 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=fJJNfLew2dmp5b4hf4twPx5jt0++dCbRLNn8qeEJThn/zpZQMSYLwyjYa1v8AEnqGgaJyWoqGMQCuoljGHusnBZqoc5r6A/mpPDSYuavLnIYZm+ek65EDb+/0JWY3JaUo+wnSPZmzcYhw4pNjYUKiwlwyjV1vz0WF/PWiUCucgmZ0Ef7+5iwx0JriyiCBYkkdCdiyE1u0yrfXw+idX+0w8UCaVgP97Bzw/UJ6gfpqhSaqU4FvxFCsq/S3qacgIOKei07fCEwkbxMf9dHKfdYp1Ta688Q4doADSE7rx1/9mWQgOAdDx60wsUuskQZmLvLZdJyky1PuahsAr5pEGPFEg== 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=6kFluJ1a9tl0ZjeLhN8XCKC1YDKzr8+UJV4jtCjYz+E=; b=dKVYM21dpgF5KR+c3rPhRk34tNnvIdDgCizcWBMyFCXSu/5QGfbcV0Z+oEacMBMcUiQx6vR48fBxDIyAxHSK4vkuCzhSKq1ada5IfLtK6ohCd9K44I9p/pxW67zBEyMU3+ZpiTyanohMrR+7HF1dIBu/kwwIB3YfO1+RmGlX8Z4uwyEnyLKc66O0IY/WkkHG753WIjjNpq0mORFnWEyVXvP0V3m8m+bVO5WffUdu7e7rGo2Ukxl98k3jK9SDxfAdidtRaMH/5q4atqMTOK+nlR5xp7+nD53bihb0tHxiBZS3ojlHwM1QZalit8M/mM9BiB/AAEA1Qvcqnh4KH2W8Vw== 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=6kFluJ1a9tl0ZjeLhN8XCKC1YDKzr8+UJV4jtCjYz+E=; b=K+90eOOweeDaJlvlwElkIk/kMGd5nO9t+JsO/la6ygSf6gQ8byMMXrGl0Cm5W/44RH/QWOeRzOIgUeQ76r4FPwp2bFVUu3v6qPHm2xDveEOgZ9MW5VwpB2Xf0xHweLLgZ6ZhXoOAKSbQjF8V/YrJcJMNi8OyznjMYtuo02PQ88U= Received: from BYAPR11MB3301.namprd11.prod.outlook.com (2603:10b6:a03:7f::26) by BYAPR11MB3847.namprd11.prod.outlook.com (2603:10b6:a03:b1::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2900.24; Tue, 14 Apr 2020 16:47:01 +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.2900.028; Tue, 14 Apr 2020 16:47:01 +0000 From: "Ananyev, Konstantin" To: Honnappa Nagarahalli , "dev@dpdk.org" CC: "david.marchand@redhat.com" , "jielong.zjl@antfin.com" , nd , nd Thread-Topic: [PATCH v3 7/9] ring: introduce peek style API Thread-Index: AQHWCd91Q1vKyBUGI0er7xmp0OLAnah4CnYAgADVnZA= Date: Tue, 14 Apr 2020 16:47:00 +0000 Message-ID: References: <20200402220959.29885-1-konstantin.ananyev@intel.com> <20200403174235.23308-1-konstantin.ananyev@intel.com> <20200403174235.23308-8-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: spf=none (sender IP is ) smtp.mailfrom=konstantin.ananyev@intel.com; x-originating-ip: [192.198.151.172] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 0123ac26-28b8-40b4-6159-08d7e0937439 x-ms-traffictypediagnostic: BYAPR11MB3847: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:10000; x-forefront-prvs: 0373D94D15 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:(10019020)(346002)(376002)(39860400002)(396003)(136003)(366004)(66446008)(64756008)(186003)(478600001)(6506007)(7696005)(66476007)(66946007)(316002)(54906003)(110136005)(52536014)(66556008)(71200400001)(86362001)(5660300002)(30864003)(26005)(76116006)(33656002)(4326008)(9686003)(8936002)(55016002)(8676002)(2906002)(81156014); DIR:OUT; SFP:1102; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: 04PzSuyR5a+rW2Za9HNYEbW35rjkRJX17WRvpnZ6kkh/ZUSi9W3gNM40w9hs33vyo0VaknQFZzVkSVoFEebpIwkx4lBTOu0oWePH5OxnehrNcTcswFsQjoK9s3yDE4ZkndEUAbn09trZpwYLbkVjxSj5KuVLC5D797OTWBNpVb0Y9rqn75P2KDed18sOsWDBQ/WQ7nPAT/AA8Ahe4nnhvxQd+61Rrqvs5m77iKmXi4yOL70WaYteZxXe+7fAawFb8HbpjM/BJtAwtwq0PO8TeZhqZKosLXGbOBCE72/e/ZeC1UvF9jQmcyQGKOaVIM2cGvs1Mtx6k9WaCM3S0mDzOu0NMbqUWc4mZPY51GJvHReVzPkf1ojw/9RkAwDrFhCKq/zLNHcsFOrYkFiRN82Kb6b9T+jqCH9xKjcWhrOAoBafZLohbXaE5PteL+/qIjpg x-ms-exchange-antispam-messagedata: Xb7tt2yXzGLTfP1hyMdPoGDNj6Wi8tZpsMg/l3Pyrcrr8jr+8dmxNvEnp01uqchd8mhprlg8SXvrgNcT4rVowBZx6C4FPglBJN7i9/k5kWSFROzbK9l6pJxfovKrMW1oexloC7o3tN+635qfMaSpXQ== 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: 0123ac26-28b8-40b4-6159-08d7e0937439 X-MS-Exchange-CrossTenant-originalarrivaltime: 14 Apr 2020 16:47:00.8917 (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: y9lpnyh4YRsDUWjjPP9YabFeyQtGCO9bX0rqeWmQEeiDScfbjVC8G5+O/2ONiRTgVLmh8uWwdZz0DJUcQJfAcRYoQyOO7J2X9/d0xiTgHZc= X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR11MB3847 X-OriginatorOrg: intel.com Subject: Re: [dpdk-dev] [PATCH v3 7/9] ring: introduce peek style API 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" > > > > For rings with producer/consumer in RTE_RING_SYNC_ST, > > RTE_RING_SYNC_MT_HTS mode, provide an ability to split enqueue/dequeue > > operation into two phases: > > - enqueue/dequeue start > > - enqueue/dequeue finish > > That allows user to inspect objects in the ring without removing them f= rom it > > (aka MT safe peek). > > > > Signed-off-by: Konstantin Ananyev > > --- > > lib/librte_ring/Makefile | 1 + > > lib/librte_ring/meson.build | 1 + > > lib/librte_ring/rte_ring_c11_mem.h | 44 +++ > > lib/librte_ring/rte_ring_elem.h | 4 + > > lib/librte_ring/rte_ring_generic.h | 48 ++++ > > lib/librte_ring/rte_ring_hts_generic.h | 47 ++- > > lib/librte_ring/rte_ring_peek.h | 379 +++++++++++++++++++++++++ > > 7 files changed, 519 insertions(+), 5 deletions(-) create mode 100644 > > lib/librte_ring/rte_ring_peek.h > > > > diff --git a/lib/librte_ring/Makefile b/lib/librte_ring/Makefile index > > 6fe500f0d..5f8662737 100644 > > --- a/lib/librte_ring/Makefile > > +++ b/lib/librte_ring/Makefile > > @@ -22,6 +22,7 @@ SYMLINK-$(CONFIG_RTE_LIBRTE_RING)-include :=3D > > rte_ring.h \ > > rte_ring_hts.h \ > > rte_ring_hts_elem.h \ > > rte_ring_hts_generic.h \ > > + rte_ring_peek.h \ > > rte_ring_rts.h \ > > rte_ring_rts_elem.h \ > > rte_ring_rts_generic.h > > diff --git a/lib/librte_ring/meson.build b/lib/librte_ring/meson.build = index > > 8e86e037a..f5f84dc6e 100644 > > --- a/lib/librte_ring/meson.build > > +++ b/lib/librte_ring/meson.build > > @@ -9,6 +9,7 @@ headers =3D files('rte_ring.h', > > 'rte_ring_hts.h', > > 'rte_ring_hts_elem.h', > > 'rte_ring_hts_generic.h', > > + 'rte_ring_peek.h', > > 'rte_ring_rts.h', > > 'rte_ring_rts_elem.h', > > 'rte_ring_rts_generic.h') > > diff --git a/lib/librte_ring/rte_ring_c11_mem.h > > b/lib/librte_ring/rte_ring_c11_mem.h > > index 0fb73a337..bb3096721 100644 > > --- a/lib/librte_ring/rte_ring_c11_mem.h > > +++ b/lib/librte_ring/rte_ring_c11_mem.h > > @@ -10,6 +10,50 @@ > > #ifndef _RTE_RING_C11_MEM_H_ > > #define _RTE_RING_C11_MEM_H_ > > > > +/** > > + * @internal get current tail value. > > + * This function should be used only for single thread producer/consum= er. > > + * Check that user didn't request to move tail above the head. > Do we need this check? This could be a data path function, we could docum= ent a warning and leave it to the users to provide the correct > value. I don't think this extra check will cause any extra slowdown. >From other side, it seems useful to have it - might help people to debug/root-cause an issue. =20 > > + * In that situation: > > + * - return zero, that will cause abort any pending changes and > > + * return head to its previous position. > > + * - throw an assert in debug mode. > > + */ > > +static __rte_always_inline uint32_t > > +__rte_ring_st_get_tail(struct rte_ring_headtail *ht, uint32_t *tail, > > + uint32_t num) > > +{ > > + uint32_t h, n, t; > > + > > + h =3D ht->head; > > + t =3D ht->tail; > > + n =3D h - t; > > + > > + RTE_ASSERT(n >=3D num); > > + num =3D (n >=3D num) ? num : 0; > > + > > + *tail =3D h; > > + return num; > > +} > > + > > +/** > > + * @internal set new values for head and tail. > > + * This function should be used only for single thread producer/consum= er. > > + * Should be used only in conjunction with __rte_ring_st_get_tail. > > + */ > > +static __rte_always_inline void > > +__rte_ring_st_set_head_tail(struct rte_ring_headtail *ht, uint32_t tai= l, > > + uint32_t num, uint32_t enqueue) > > +{ > > + uint32_t pos; > > + > > + RTE_SET_USED(enqueue); > > + > > + pos =3D tail + num; > > + ht->head =3D pos; > > + __atomic_store_n(&ht->tail, pos, __ATOMIC_RELEASE); } > > + > > static __rte_always_inline void > > update_tail(struct rte_ring_headtail *ht, uint32_t old_val, uint32_t n= ew_val, > > uint32_t single, uint32_t enqueue) > > diff --git a/lib/librte_ring/rte_ring_elem.h b/lib/librte_ring/rte_ring= _elem.h > > index 010a564c1..5bf7c1c1b 100644 > > --- a/lib/librte_ring/rte_ring_elem.h > > +++ b/lib/librte_ring/rte_ring_elem.h > > @@ -1083,6 +1083,10 @@ rte_ring_dequeue_burst_elem(struct rte_ring *r, > > void *obj_table, > > return 0; > > } > > > > +#ifdef ALLOW_EXPERIMENTAL_API > > +#include > > +#endif > > + > > #ifdef __cplusplus > > } > > #endif > > diff --git a/lib/librte_ring/rte_ring_generic.h > > b/lib/librte_ring/rte_ring_generic.h > > index 953cdbbd5..9f5fdf13b 100644 > > --- a/lib/librte_ring/rte_ring_generic.h > > +++ b/lib/librte_ring/rte_ring_generic.h > > @@ -10,6 +10,54 @@ > > #ifndef _RTE_RING_GENERIC_H_ > > #define _RTE_RING_GENERIC_H_ > > > > +/** > > + * @internal get current tail value. > > + * This function should be used only for single thread producer/consum= er. > > + * Check that user didn't request to move tail above the head. > > + * In that situation: > > + * - return zero, that will cause abort any pending changes and > > + * return head to its previous position. > > + * - throw an assert in debug mode. > > + */ > > +static __rte_always_inline uint32_t > > +__rte_ring_st_get_tail(struct rte_ring_headtail *ht, uint32_t *tail, > > + uint32_t num) > > +{ > > + uint32_t h, n, t; > > + > > + h =3D ht->head; > > + t =3D ht->tail; > > + n =3D h - t; > > + > > + RTE_ASSERT(n >=3D num); > > + num =3D (n >=3D num) ? num : 0; > > + > > + *tail =3D h; > > + return num; > > +} > > + > > +/** > > + * @internal set new values for head and tail. > > + * This function should be used only for single thread producer/consum= er. > > + * Should be used only in conjunction with __rte_ring_st_get_tail. > > + */ > > +static __rte_always_inline void > > +__rte_ring_st_set_head_tail(struct rte_ring_headtail *ht, uint32_t tai= l, > > + uint32_t num, uint32_t enqueue) > > +{ > > + uint32_t pos; > > + > > + pos =3D tail + num; > > + > > + if (enqueue) > > + rte_smp_wmb(); > > + else > > + rte_smp_rmb(); > > + > > + ht->head =3D pos; > > + ht->tail =3D pos; > > +} > > + > > static __rte_always_inline void > > update_tail(struct rte_ring_headtail *ht, uint32_t old_val, uint32_t n= ew_val, > > uint32_t single, uint32_t enqueue) > > diff --git a/lib/librte_ring/rte_ring_hts_generic.h > > b/lib/librte_ring/rte_ring_hts_generic.h > > index da08f1d94..8e699c006 100644 > > --- a/lib/librte_ring/rte_ring_hts_generic.h > > +++ b/lib/librte_ring/rte_ring_hts_generic.h > > @@ -18,9 +18,38 @@ > > * For more information please refer to . > > */ > > > > +/** > > + * @internal get current tail value. > > + * Check that user didn't request to move tail above the head. > > + * In that situation: > > + * - return zero, that will cause abort any pending changes and > > + * return head to its previous position. > > + * - throw an assert in debug mode. > > + */ > > +static __rte_always_inline uint32_t > > +__rte_ring_hts_get_tail(struct rte_ring_hts_headtail *ht, uint32_t *ta= il, > > + uint32_t num) > > +{ > > + uint32_t n; > > + union rte_ring_ht_pos p; > > + > > + p.raw =3D rte_atomic64_read((rte_atomic64_t *)(uintptr_t)&ht- > > >ht.raw); > > + n =3D p.pos.head - p.pos.tail; > > + > > + RTE_ASSERT(n >=3D num); > > + num =3D (n >=3D num) ? num : 0; > > + > > + *tail =3D p.pos.tail; > > + return num; > > +} > > + > > +/** > > + * @internal set new values for head and tail as one atomic 64 bit ope= ration. > > + * Should be used only in conjunction with __rte_ring_hts_get_tail. > > + */ > > static __rte_always_inline void > > -__rte_ring_hts_update_tail(struct rte_ring_hts_headtail *ht, uint32_t = num, > > - uint32_t enqueue) > > +__rte_ring_hts_set_head_tail(struct rte_ring_hts_headtail *ht, uint32_= t tail, > > + uint32_t num, uint32_t enqueue) > > { > > union rte_ring_ht_pos p; > > > > @@ -29,14 +58,22 @@ __rte_ring_hts_update_tail(struct > > rte_ring_hts_headtail *ht, uint32_t num, > > else > > rte_smp_rmb(); > > > > - p.raw =3D rte_atomic64_read((rte_atomic64_t *)(uintptr_t)&ht- > > >ht.raw); > > - > > - p.pos.head =3D p.pos.tail + num; > > + p.pos.head =3D tail + num; > > p.pos.tail =3D p.pos.head; > > > > rte_atomic64_set((rte_atomic64_t *)(uintptr_t)&ht->ht.raw, p.raw); } > > > > +static __rte_always_inline void > > +__rte_ring_hts_update_tail(struct rte_ring_hts_headtail *ht, uint32_t = num, > > + uint32_t enqueue) > > +{ > > + uint32_t tail; > > + > > + num =3D __rte_ring_hts_get_tail(ht, &tail, num); > > + __rte_ring_hts_set_head_tail(ht, tail, num, enqueue); } > > + > > /** > > * @internal waits till tail will become equal to head. > > * Means no writer/reader is active for that ring. > > diff --git a/lib/librte_ring/rte_ring_peek.h b/lib/librte_ring/rte_ring= _peek.h > > new file mode 100644 index 000000000..baefd2f7b > > --- /dev/null > > +++ b/lib/librte_ring/rte_ring_peek.h > > @@ -0,0 +1,379 @@ > > +/* SPDX-License-Identifier: BSD-3-Clause > > + * > > + * Copyright (c) 2010-2017 Intel Corporation > > + * Copyright (c) 2007-2009 Kip Macy kmacy@freebsd.org > > + * All rights reserved. > > + * Derived from FreeBSD's bufring.h > > + * Used as BSD-3 Licensed with permission from Kip Macy. > > + */ > > + > > +#ifndef _RTE_RING_PEEK_H_ > > +#define _RTE_RING_PEEK_H_ > > + > > +/** > > + * @file > > + * @b EXPERIMENTAL: this API may change without prior notice > > + * It is not recommended to include this file directly. > > + * Please include instead. > > + * > > + * Ring Peek AP > ^^^ API > > + * Introduction of rte_ring with serialized producer/consumer (HTS syn= c > > +mode) > > + * makes possible to split public enqueue/dequeue API into two phases: > > + * - enqueue/dequeue start > > + * - enqueue/dequeue finish > > + * That allows user to inspect objects in the ring without removing > > +them > > + * from it (aka MT safe peek). > > + * Note that right now this new API is avaialble only for two sync mod= es: > > + * 1) Single Producer/Single Consumer (RTE_RING_SYNC_ST) > > + * 2) Serialized Producer/Serialized Consumer (RTE_RING_SYNC_MT_HTS). > > + * It is a user responsibility to create/init ring with appropriate > > +sync > > + * modes selected. > > + * As an example: > > + * // read 1 elem from the ring: > > + * n =3D rte_ring_hts_dequeue_bulk_start(ring, &obj, 1, NULL); > > + * if (n !=3D 0) { > > + * //examine object > > + * if (object_examine(obj) =3D=3D KEEP) > > + * //decided to keep it in the ring. > > + * rte_ring_hts_dequeue_finish(ring, 0); > > + * else > > + * //decided to remove it from the ring. > > + * rte_ring_hts_dequeue_finish(ring, n); > > + * } > > + * Note that between _start_ and _finish_ the ring is sort of locked - > = ^^^^^^^^^^^^^^^^^^^^ - 'locked' can mean different to different pe= ople, may be remove this, > the next sentence anyway has the description > > + * none other thread can proceed with enqueue(/dequeue) operation till > ^^^^ no > > + * _finish_ will complete. > ^^^^^^^^^^^ completes > > + */ > > + > > +#ifdef __cplusplus > > +extern "C" { > > +#endif > > + >=20 > >=20 > > + > > +/** > > + * Start to enqueue several objects on the ring. > > + * Note that no actual objects are put in the queue by this function, > > + * it just reserves for user such ability. > > + * User has to call appropriate enqueue_finish() to copy objects into > > +the > > + * queue and complete given enqueue operation. > > + * > > + * @param r > > + * A pointer to the ring structure. > > + * @param n > > + * The number of objects to add in the ring from the obj_table. > > + * @param free_space > > + * if non-NULL, returns the amount of space in the ring after the > > + * enqueue operation has finished. > > + * @return > > + * The number of objects that can be enqueued, either 0 or n > > + */ > > +__rte_experimental > > +static __rte_always_inline unsigned int > > +rte_ring_enqueue_bulk_start(struct rte_ring *r, unsigned int n, > > + unsigned int *free_space) > If one wants to use _elem_ APIs for ring peek, a combination of legacy AP= I (format) and a _elem_ API is required. > For ex: > rte_ring_enqueue_bulk_start > rte_ring_enqueue_elem_finish >=20 > I understand why you have done this. I think this is getting somewhat too= inconsistent. >=20 Agree, there could be some confusion. Don't know what would be a better approach here.... 2 similar functions with exactly same parameter list (one wrapper for anoth= er): rte_ring_enqueue_elem_bulk_start() and rte_ring_enqueue_elem_bulk_start(). ? > > +{ > > + return __rte_ring_do_enqueue_start(r, n, RTE_RING_QUEUE_FIXED, > > + free_space); > > +} > > + >=20