get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

GET /api/patches/81858/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 81858,
    "url": "http://patches.dpdk.org/api/patches/81858/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20201023044343.13462-3-honnappa.nagarahalli@arm.com/",
    "project": {
        "id": 1,
        "url": "http://patches.dpdk.org/api/projects/1/?format=api",
        "name": "DPDK",
        "link_name": "dpdk",
        "list_id": "dev.dpdk.org",
        "list_email": "dev@dpdk.org",
        "web_url": "http://core.dpdk.org",
        "scm_url": "git://dpdk.org/dpdk",
        "webscm_url": "http://git.dpdk.org/dpdk",
        "list_archive_url": "https://inbox.dpdk.org/dev",
        "list_archive_url_format": "https://inbox.dpdk.org/dev/{}",
        "commit_url_format": ""
    },
    "msgid": "<20201023044343.13462-3-honnappa.nagarahalli@arm.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20201023044343.13462-3-honnappa.nagarahalli@arm.com",
    "date": "2020-10-23T04:43:40",
    "name": "[v3,2/5] lib/ring: add zero copy APIs",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "2794a29bf1eb4e8b0d0381399d71e1a454901915",
    "submitter": {
        "id": 1045,
        "url": "http://patches.dpdk.org/api/people/1045/?format=api",
        "name": "Honnappa Nagarahalli",
        "email": "honnappa.nagarahalli@arm.com"
    },
    "delegate": {
        "id": 24651,
        "url": "http://patches.dpdk.org/api/users/24651/?format=api",
        "username": "dmarchand",
        "first_name": "David",
        "last_name": "Marchand",
        "email": "david.marchand@redhat.com"
    },
    "mbox": "http://patches.dpdk.org/project/dpdk/patch/20201023044343.13462-3-honnappa.nagarahalli@arm.com/mbox/",
    "series": [
        {
            "id": 13245,
            "url": "http://patches.dpdk.org/api/series/13245/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=13245",
            "date": "2020-10-23T04:43:38",
            "name": "lib/ring: add zero copy APIs",
            "version": 3,
            "mbox": "http://patches.dpdk.org/series/13245/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/81858/comments/",
    "check": "success",
    "checks": "http://patches.dpdk.org/api/patches/81858/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<dev-bounces@dpdk.org>",
        "X-Original-To": "patchwork@inbox.dpdk.org",
        "Delivered-To": "patchwork@inbox.dpdk.org",
        "Received": [
            "from dpdk.org (dpdk.org [92.243.14.124])\n\tby inbox.dpdk.org (Postfix) with ESMTP id 80E66A04DE;\n\tFri, 23 Oct 2020 06:44:42 +0200 (CEST)",
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id 52B406C97;\n\tFri, 23 Oct 2020 06:44:22 +0200 (CEST)",
            "from foss.arm.com (foss.arm.com [217.140.110.172])\n by dpdk.org (Postfix) with ESMTP id 8DCFB6CAB\n for <dev@dpdk.org>; Fri, 23 Oct 2020 06:44:20 +0200 (CEST)",
            "from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14])\n by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 0D3A5101E;\n Thu, 22 Oct 2020 21:44:19 -0700 (PDT)",
            "from qc2400f-1.austin.arm.com (qc2400f-1.austin.arm.com\n [10.118.12.27])\n by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id F278F3F66B;\n Thu, 22 Oct 2020 21:44:18 -0700 (PDT)"
        ],
        "From": "Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>",
        "To": "dev@dpdk.org, honnappa.nagarahalli@arm.com, konstantin.ananyev@intel.com",
        "Cc": "olivier.matz@6wind.com, david.marchand@redhat.com,\n dharmik.thakkar@arm.com,\n ruifeng.wang@arm.com, nd@arm.com",
        "Date": "Thu, 22 Oct 2020 23:43:40 -0500",
        "Message-Id": "<20201023044343.13462-3-honnappa.nagarahalli@arm.com>",
        "X-Mailer": "git-send-email 2.17.1",
        "In-Reply-To": "<20201023044343.13462-1-honnappa.nagarahalli@arm.com>",
        "References": "<20200224203931.21256-1-honnappa.nagarahalli@arm.com>\n <20201023044343.13462-1-honnappa.nagarahalli@arm.com>",
        "Subject": "[dpdk-dev] [PATCH v3 2/5] lib/ring: add zero copy APIs",
        "X-BeenThere": "dev@dpdk.org",
        "X-Mailman-Version": "2.1.15",
        "Precedence": "list",
        "List-Id": "DPDK patches and discussions <dev.dpdk.org>",
        "List-Unsubscribe": "<https://mails.dpdk.org/options/dev>,\n <mailto:dev-request@dpdk.org?subject=unsubscribe>",
        "List-Archive": "<http://mails.dpdk.org/archives/dev/>",
        "List-Post": "<mailto:dev@dpdk.org>",
        "List-Help": "<mailto:dev-request@dpdk.org?subject=help>",
        "List-Subscribe": "<https://mails.dpdk.org/listinfo/dev>,\n <mailto:dev-request@dpdk.org?subject=subscribe>",
        "Errors-To": "dev-bounces@dpdk.org",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>"
    },
    "content": "Add zero-copy APIs. These APIs provide the capability to\ncopy the data to/from the ring memory directly, without\nhaving a temporary copy (for ex: an array of mbufs on\nthe stack). Use cases that involve copying large amount\nof data to/from the ring can benefit from these APIs.\n\nSigned-off-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>\nReviewed-by: Dharmik Thakkar <dharmik.thakkar@arm.com>\n---\n lib/librte_ring/meson.build        |   1 +\n lib/librte_ring/rte_ring_elem.h    |   1 +\n lib/librte_ring/rte_ring_peek_zc.h | 542 +++++++++++++++++++++++++++++\n 3 files changed, 544 insertions(+)\n create mode 100644 lib/librte_ring/rte_ring_peek_zc.h",
    "diff": "diff --git a/lib/librte_ring/meson.build b/lib/librte_ring/meson.build\nindex 31c0b4649..36fdcb6a5 100644\n--- a/lib/librte_ring/meson.build\n+++ b/lib/librte_ring/meson.build\n@@ -11,5 +11,6 @@ headers = files('rte_ring.h',\n \t\t'rte_ring_hts_c11_mem.h',\n \t\t'rte_ring_peek.h',\n \t\t'rte_ring_peek_c11_mem.h',\n+\t\t'rte_ring_peek_zc.h',\n \t\t'rte_ring_rts.h',\n \t\t'rte_ring_rts_c11_mem.h')\ndiff --git a/lib/librte_ring/rte_ring_elem.h b/lib/librte_ring/rte_ring_elem.h\nindex 938b398fc..7034d29c0 100644\n--- a/lib/librte_ring/rte_ring_elem.h\n+++ b/lib/librte_ring/rte_ring_elem.h\n@@ -1079,6 +1079,7 @@ rte_ring_dequeue_burst_elem(struct rte_ring *r, void *obj_table,\n \n #ifdef ALLOW_EXPERIMENTAL_API\n #include <rte_ring_peek.h>\n+#include <rte_ring_peek_zc.h>\n #endif\n \n #include <rte_ring.h>\ndiff --git a/lib/librte_ring/rte_ring_peek_zc.h b/lib/librte_ring/rte_ring_peek_zc.h\nnew file mode 100644\nindex 000000000..9db2d343f\n--- /dev/null\n+++ b/lib/librte_ring/rte_ring_peek_zc.h\n@@ -0,0 +1,542 @@\n+/* SPDX-License-Identifier: BSD-3-Clause\n+ *\n+ * Copyright (c) 2020 Arm Limited\n+ * Copyright (c) 2007-2009 Kip Macy kmacy@freebsd.org\n+ * All rights reserved.\n+ * Derived from FreeBSD's bufring.h\n+ * Used as BSD-3 Licensed with permission from Kip Macy.\n+ */\n+\n+#ifndef _RTE_RING_PEEK_ZC_H_\n+#define _RTE_RING_PEEK_ZC_H_\n+\n+/**\n+ * @file\n+ * @b EXPERIMENTAL: this API may change without prior notice\n+ * It is not recommended to include this file directly.\n+ * Please include <rte_ring_elem.h> instead.\n+ *\n+ * Ring Peek Zero Copy APIs\n+ * These APIs make it possible to split public enqueue/dequeue API\n+ * into 3 parts:\n+ * - enqueue/dequeue start\n+ * - copy data to/from the ring\n+ * - enqueue/dequeue finish\n+ * Along with the advantages of the peek APIs, these APIs provide the ability\n+ * to avoid copying of the data to temporary area (for ex: array of mbufs\n+ * on the stack).\n+ *\n+ * Note that currently these APIs are available only for two sync modes:\n+ * 1) Single Producer/Single Consumer (RTE_RING_SYNC_ST)\n+ * 2) Serialized Producer/Serialized Consumer (RTE_RING_SYNC_MT_HTS).\n+ * It is user's responsibility to create/init ring with appropriate sync\n+ * modes selected.\n+ *\n+ * Following are some examples showing the API usage.\n+ * 1)\n+ * struct elem_obj {uint64_t a; uint32_t b, c;};\n+ * struct elem_obj *obj;\n+ *\n+ * // Create ring with sync type RTE_RING_SYNC_ST or RTE_RING_SYNC_MT_HTS\n+ * // Reserve space on the ring\n+ * n = rte_ring_enqueue_zc_bulk_elem_start(r, sizeof(elem_obj), 1, &zcd, NULL);\n+ *\n+ * // Produce the data directly on the ring memory\n+ * obj = (struct elem_obj *)zcd->ptr1;\n+ * obj.a = rte_get_a();\n+ * obj.b = rte_get_b();\n+ * obj.c = rte_get_c();\n+ * rte_ring_enqueue_zc_elem_finish(ring, n);\n+ *\n+ * 2)\n+ * // Create ring with sync type RTE_RING_SYNC_ST or RTE_RING_SYNC_MT_HTS\n+ * // Reserve space on the ring\n+ * n = rte_ring_enqueue_zc_burst_start(r, 32, &zcd, NULL);\n+ *\n+ * // Pkt I/O core polls packets from the NIC\n+ * if (n == 32)\n+ *\tnb_rx = rte_eth_rx_burst(portid, queueid, zcd->ptr1, 32);\n+ * else\n+ *\tnb_rx = rte_eth_rx_burst(portid, queueid, zcd->ptr1, zcd->n1);\n+ *\n+ * // Provide packets to the packet processing cores\n+ * rte_ring_enqueue_zc_finish(r, nb_rx);\n+ *\n+ * Note that between _start_ and _finish_ none other thread can proceed\n+ * with enqueue/dequeue operation till _finish_ completes.\n+ */\n+\n+#ifdef __cplusplus\n+extern \"C\" {\n+#endif\n+\n+#include <rte_ring_peek_c11_mem.h>\n+\n+/**\n+ * Ring zero-copy information structure.\n+ *\n+ * This structure contains the pointers and length of the space\n+ * reserved on the ring storage.\n+ */\n+struct rte_ring_zc_data {\n+\t/* Pointer to the first space in the ring */\n+\tvoid **ptr1;\n+\t/* Pointer to the second space in the ring if there is wrap-around */\n+\tvoid **ptr2;\n+\t/* Number of elements in the first pointer. If this is equal to\n+\t * the number of elements requested, then ptr2 is NULL.\n+\t * Otherwise, subtracting n1 from number of elements requested\n+\t * will give the number of elements available at ptr2.\n+\t */\n+\tunsigned int n1;\n+} __rte_cache_aligned;\n+\n+static __rte_always_inline void\n+__rte_ring_get_elem_addr(struct rte_ring *r, uint32_t head,\n+\tuint32_t esize, uint32_t num, void **dst1, uint32_t *n1, void **dst2)\n+{\n+\tuint32_t idx, scale, nr_idx;\n+\tuint32_t *ring = (uint32_t *)&r[1];\n+\n+\t/* Normalize to uint32_t */\n+\tscale = esize / sizeof(uint32_t);\n+\tidx = head & r->mask;\n+\tnr_idx = idx * scale;\n+\n+\t*dst1 = ring + nr_idx;\n+\t*n1 = num;\n+\n+\tif (idx + num > r->size) {\n+\t\t*n1 = r->size - idx;\n+\t\t*dst2 = ring;\n+\t}\n+}\n+\n+/**\n+ * @internal This function moves prod head value.\n+ */\n+static __rte_always_inline unsigned int\n+__rte_ring_do_enqueue_zc_elem_start(struct rte_ring *r, unsigned int esize,\n+\t\tuint32_t n, enum rte_ring_queue_behavior behavior,\n+\t\tstruct rte_ring_zc_data *zcd, unsigned int *free_space)\n+{\n+\tuint32_t free, head, next;\n+\n+\tswitch (r->prod.sync_type) {\n+\tcase RTE_RING_SYNC_ST:\n+\t\tn = __rte_ring_move_prod_head(r, RTE_RING_SYNC_ST, n,\n+\t\t\tbehavior, &head, &next, &free);\n+\t\t__rte_ring_get_elem_addr(r, head, esize, n, (void **)&zcd->ptr1,\n+\t\t\t&zcd->n1, (void **)&zcd->ptr2);\n+\t\tbreak;\n+\tcase RTE_RING_SYNC_MT_HTS:\n+\t\tn = __rte_ring_hts_move_prod_head(r, n, behavior, &head, &free);\n+\t\t__rte_ring_get_elem_addr(r, head, esize, n, (void **)&zcd->ptr1,\n+\t\t\t&zcd->n1, (void **)&zcd->ptr2);\n+\t\tbreak;\n+\tcase RTE_RING_SYNC_MT:\n+\tcase RTE_RING_SYNC_MT_RTS:\n+\tdefault:\n+\t\t/* unsupported mode, shouldn't be here */\n+\t\tRTE_ASSERT(0);\n+\t\tn = 0;\n+\t\tfree = 0;\n+\t}\n+\n+\tif (free_space != NULL)\n+\t\t*free_space = free - n;\n+\treturn n;\n+}\n+\n+/**\n+ * Start to enqueue several objects on the ring.\n+ * Note that no actual objects are put in the queue by this function,\n+ * it just reserves space for the user on the ring.\n+ * User has to copy objects into the queue using the returned pointers.\n+ * User should call rte_ring_enqueue_zc_elem_finish to complete the\n+ * enqueue operation.\n+ *\n+ * @param r\n+ *   A pointer to the ring structure.\n+ * @param esize\n+ *   The size of ring element, in bytes. It must be a multiple of 4.\n+ * @param n\n+ *   The number of objects to add in the ring.\n+ * @param zcd\n+ *   Structure containing the pointers and length of the space\n+ *   reserved on the ring storage.\n+ * @param free_space\n+ *   If non-NULL, returns the amount of space in the ring after the\n+ *   reservation operation has finished.\n+ * @return\n+ *   The number of objects that can be enqueued, either 0 or n\n+ */\n+__rte_experimental\n+static __rte_always_inline unsigned int\n+rte_ring_enqueue_zc_bulk_elem_start(struct rte_ring *r, unsigned int esize,\n+\tunsigned int n, struct rte_ring_zc_data *zcd, unsigned int *free_space)\n+{\n+\treturn __rte_ring_do_enqueue_zc_elem_start(r, esize, n,\n+\t\t\tRTE_RING_QUEUE_FIXED, zcd, free_space);\n+}\n+\n+/**\n+ * Start to enqueue several pointers to objects on the ring.\n+ * Note that no actual pointers are put in the queue by this function,\n+ * it just reserves space for the user on the ring.\n+ * User has to copy pointers to objects into the queue using the\n+ * returned pointers.\n+ * User should call rte_ring_enqueue_zc_finish to complete the\n+ * enqueue operation.\n+ *\n+ * @param r\n+ *   A pointer to the ring structure.\n+ * @param n\n+ *   The number of objects to add in the ring.\n+ * @param zcd\n+ *   Structure containing the pointers and length of the space\n+ *   reserved on the ring storage.\n+ * @param free_space\n+ *   If non-NULL, returns the amount of space in the ring after the\n+ *   reservation operation has finished.\n+ * @return\n+ *   The number of objects that can be enqueued, either 0 or n\n+ */\n+__rte_experimental\n+static __rte_always_inline unsigned int\n+rte_ring_enqueue_zc_bulk_start(struct rte_ring *r, unsigned int n,\n+\tstruct rte_ring_zc_data *zcd, unsigned int *free_space)\n+{\n+\treturn rte_ring_enqueue_zc_bulk_elem_start(r, sizeof(uintptr_t), n,\n+\t\t\t\t\t\t\tzcd, free_space);\n+}\n+/**\n+ * Start to enqueue several objects on the ring.\n+ * Note that no actual objects are put in the queue by this function,\n+ * it just reserves space for the user on the ring.\n+ * User has to copy objects into the queue using the returned pointers.\n+ * User should call rte_ring_enqueue_zc_elem_finish to complete the\n+ * enqueue operation.\n+ *\n+ * @param r\n+ *   A pointer to the ring structure.\n+ * @param esize\n+ *   The size of ring element, in bytes. It must be a multiple of 4.\n+ * @param n\n+ *   The number of objects to add in the ring.\n+ * @param zcd\n+ *   Structure containing the pointers and length of the space\n+ *   reserved on the ring storage.\n+ * @param free_space\n+ *   If non-NULL, returns the amount of space in the ring after the\n+ *   reservation operation has finished.\n+ * @return\n+ *   The number of objects that can be enqueued, either 0 or n\n+ */\n+__rte_experimental\n+static __rte_always_inline unsigned int\n+rte_ring_enqueue_zc_burst_elem_start(struct rte_ring *r, unsigned int esize,\n+\tunsigned int n, struct rte_ring_zc_data *zcd, unsigned int *free_space)\n+{\n+\treturn __rte_ring_do_enqueue_zc_elem_start(r, esize, n,\n+\t\t\tRTE_RING_QUEUE_VARIABLE, zcd, free_space);\n+}\n+\n+/**\n+ * Start to enqueue several pointers to objects on the ring.\n+ * Note that no actual pointers are put in the queue by this function,\n+ * it just reserves space for the user on the ring.\n+ * User has to copy pointers to objects into the queue using the\n+ * returned pointers.\n+ * User should call rte_ring_enqueue_zc_finish to complete the\n+ * enqueue operation.\n+ *\n+ * @param r\n+ *   A pointer to the ring structure.\n+ * @param n\n+ *   The number of objects to add in the ring.\n+ * @param zcd\n+ *   Structure containing the pointers and length of the space\n+ *   reserved on the ring storage.\n+ * @param free_space\n+ *   If non-NULL, returns the amount of space in the ring after the\n+ *   reservation operation has finished.\n+ * @return\n+ *   The number of objects that can be enqueued, either 0 or n\n+ */\n+__rte_experimental\n+static __rte_always_inline unsigned int\n+rte_ring_enqueue_zc_burst_start(struct rte_ring *r, unsigned int n,\n+\tstruct rte_ring_zc_data *zcd, unsigned int *free_space)\n+{\n+\treturn rte_ring_enqueue_zc_burst_elem_start(r, sizeof(uintptr_t), n,\n+\t\t\t\t\t\t\tzcd, free_space);\n+}\n+\n+/**\n+ * Complete enqueuing several objects on the ring.\n+ * Note that number of objects to enqueue should not exceed previous\n+ * enqueue_start return value.\n+ *\n+ * @param r\n+ *   A pointer to the ring structure.\n+ * @param n\n+ *   The number of objects to add to the ring.\n+ */\n+__rte_experimental\n+static __rte_always_inline void\n+rte_ring_enqueue_zc_elem_finish(struct rte_ring *r, unsigned int n)\n+{\n+\tuint32_t tail;\n+\n+\tswitch (r->prod.sync_type) {\n+\tcase RTE_RING_SYNC_ST:\n+\t\tn = __rte_ring_st_get_tail(&r->prod, &tail, n);\n+\t\t__rte_ring_st_set_head_tail(&r->prod, tail, n, 1);\n+\t\tbreak;\n+\tcase RTE_RING_SYNC_MT_HTS:\n+\t\tn = __rte_ring_hts_get_tail(&r->hts_prod, &tail, n);\n+\t\t__rte_ring_hts_set_head_tail(&r->hts_prod, tail, n, 1);\n+\t\tbreak;\n+\tcase RTE_RING_SYNC_MT:\n+\tcase RTE_RING_SYNC_MT_RTS:\n+\tdefault:\n+\t\t/* unsupported mode, shouldn't be here */\n+\t\tRTE_ASSERT(0);\n+\t}\n+}\n+\n+/**\n+ * Complete enqueuing several pointers to objects on the ring.\n+ * Note that number of objects to enqueue should not exceed previous\n+ * enqueue_start return value.\n+ *\n+ * @param r\n+ *   A pointer to the ring structure.\n+ * @param n\n+ *   The number of pointers to objects to add to the ring.\n+ */\n+__rte_experimental\n+static __rte_always_inline void\n+rte_ring_enqueue_zc_finish(struct rte_ring *r, unsigned int n)\n+{\n+\trte_ring_enqueue_zc_elem_finish(r, n);\n+}\n+\n+/**\n+ * @internal This function moves cons head value and copies up to *n*\n+ * objects from the ring to the user provided obj_table.\n+ */\n+static __rte_always_inline unsigned int\n+__rte_ring_do_dequeue_zc_elem_start(struct rte_ring *r,\n+\tuint32_t esize, uint32_t n, enum rte_ring_queue_behavior behavior,\n+\tstruct rte_ring_zc_data *zcd, unsigned int *available)\n+{\n+\tuint32_t avail, head, next;\n+\n+\tswitch (r->cons.sync_type) {\n+\tcase RTE_RING_SYNC_ST:\n+\t\tn = __rte_ring_move_cons_head(r, RTE_RING_SYNC_ST, n,\n+\t\t\tbehavior, &head, &next, &avail);\n+\t\t__rte_ring_get_elem_addr(r, head, esize, n, (void **)&zcd->ptr1,\n+\t\t\t&zcd->n1, (void **)&zcd->ptr2);\n+\t\tbreak;\n+\tcase RTE_RING_SYNC_MT_HTS:\n+\t\tn = __rte_ring_hts_move_cons_head(r, n, behavior,\n+\t\t\t&head, &avail);\n+\t\t__rte_ring_get_elem_addr(r, head, esize, n, (void **)&zcd->ptr1,\n+\t\t\t&zcd->n1, (void **)&zcd->ptr2);\n+\t\tbreak;\n+\tcase RTE_RING_SYNC_MT:\n+\tcase RTE_RING_SYNC_MT_RTS:\n+\tdefault:\n+\t\t/* unsupported mode, shouldn't be here */\n+\t\tRTE_ASSERT(0);\n+\t\tn = 0;\n+\t\tavail = 0;\n+\t}\n+\n+\tif (available != NULL)\n+\t\t*available = avail - n;\n+\treturn n;\n+}\n+\n+/**\n+ * Start to dequeue several objects from the ring.\n+ * Note that no actual objects are copied from the queue by this function.\n+ * User has to copy objects from the queue using the returned pointers.\n+ * User should call rte_ring_dequeue_zc_elem_finish to complete the\n+ * dequeue operation.\n+ *\n+ * @param r\n+ *   A pointer to the ring structure.\n+ * @param esize\n+ *   The size of ring element, in bytes. It must be a multiple of 4.\n+ * @param n\n+ *   The number of objects to remove from the ring.\n+ * @param zcd\n+ *   Structure containing the pointers and length of the space\n+ *   reserved on the ring storage.\n+ * @param available\n+ *   If non-NULL, returns the number of remaining ring entries after the\n+ *   dequeue has finished.\n+ * @return\n+ *   The number of objects that can be dequeued, either 0 or n\n+ */\n+__rte_experimental\n+static __rte_always_inline unsigned int\n+rte_ring_dequeue_zc_bulk_elem_start(struct rte_ring *r, unsigned int esize,\n+\tunsigned int n, struct rte_ring_zc_data *zcd, unsigned int *available)\n+{\n+\treturn __rte_ring_do_dequeue_zc_elem_start(r, esize, n,\n+\t\t\tRTE_RING_QUEUE_FIXED, zcd, available);\n+}\n+\n+/**\n+ * Start to dequeue several pointers to objects from the ring.\n+ * Note that no actual pointers are removed from the queue by this function.\n+ * User has to copy pointers to objects from the queue using the\n+ * returned pointers.\n+ * User should call rte_ring_dequeue_zc_finish to complete the\n+ * dequeue operation.\n+ *\n+ * @param r\n+ *   A pointer to the ring structure.\n+ * @param n\n+ *   The number of objects to remove from the ring.\n+ * @param zcd\n+ *   Structure containing the pointers and length of the space\n+ *   reserved on the ring storage.\n+ * @param available\n+ *   If non-NULL, returns the number of remaining ring entries after the\n+ *   dequeue has finished.\n+ * @return\n+ *   The number of objects that can be dequeued, either 0 or n\n+ */\n+__rte_experimental\n+static __rte_always_inline unsigned int\n+rte_ring_dequeue_zc_bulk_start(struct rte_ring *r, unsigned int n,\n+\tstruct rte_ring_zc_data *zcd, unsigned int *available)\n+{\n+\treturn rte_ring_dequeue_zc_bulk_elem_start(r, sizeof(uintptr_t),\n+\t\tn, zcd, available);\n+}\n+\n+/**\n+ * Start to dequeue several objects from the ring.\n+ * Note that no actual objects are copied from the queue by this function.\n+ * User has to copy objects from the queue using the returned pointers.\n+ * User should call rte_ring_dequeue_zc_elem_finish to complete the\n+ * dequeue operation.\n+ *\n+ * @param r\n+ *   A pointer to the ring structure.\n+ * @param esize\n+ *   The size of ring element, in bytes. It must be a multiple of 4.\n+ *   This must be the same value used while creating the ring. Otherwise\n+ *   the results are undefined.\n+ * @param n\n+ *   The number of objects to dequeue from the ring.\n+ * @param zcd\n+ *   Structure containing the pointers and length of the space\n+ *   reserved on the ring storage.\n+ * @param available\n+ *   If non-NULL, returns the number of remaining ring entries after the\n+ *   dequeue has finished.\n+ * @return\n+ *   The number of objects that can be dequeued, either 0 or n\n+ */\n+__rte_experimental\n+static __rte_always_inline unsigned int\n+rte_ring_dequeue_zc_burst_elem_start(struct rte_ring *r, unsigned int esize,\n+\tunsigned int n, struct rte_ring_zc_data *zcd, unsigned int *available)\n+{\n+\treturn __rte_ring_do_dequeue_zc_elem_start(r, esize, n,\n+\t\t\tRTE_RING_QUEUE_VARIABLE, zcd, available);\n+}\n+\n+/**\n+ * Start to dequeue several pointers to objects from the ring.\n+ * Note that no actual pointers are removed from the queue by this function.\n+ * User has to copy pointers to objects from the queue using the\n+ * returned pointers.\n+ * User should call rte_ring_dequeue_zc_finish to complete the\n+ * dequeue operation.\n+ *\n+ * @param r\n+ *   A pointer to the ring structure.\n+ * @param n\n+ *   The number of objects to remove from the ring.\n+ * @param zcd\n+ *   Structure containing the pointers and length of the space\n+ *   reserved on the ring storage.\n+ * @param available\n+ *   If non-NULL, returns the number of remaining ring entries after the\n+ *   dequeue has finished.\n+ * @return\n+ *   The number of objects that can be dequeued, either 0 or n\n+ */\n+__rte_experimental\n+static __rte_always_inline unsigned int\n+rte_ring_dequeue_zc_burst_start(struct rte_ring *r, unsigned int n,\n+\t\tstruct rte_ring_zc_data *zcd, unsigned int *available)\n+{\n+\treturn rte_ring_dequeue_zc_burst_elem_start(r, sizeof(uintptr_t), n,\n+\t\t\tzcd, available);\n+}\n+\n+/**\n+ * Complete dequeuing several objects from the ring.\n+ * Note that number of objects to dequeued should not exceed previous\n+ * dequeue_start return value.\n+ *\n+ * @param r\n+ *   A pointer to the ring structure.\n+ * @param n\n+ *   The number of objects to remove from the ring.\n+ */\n+__rte_experimental\n+static __rte_always_inline void\n+rte_ring_dequeue_zc_elem_finish(struct rte_ring *r, unsigned int n)\n+{\n+\tuint32_t tail;\n+\n+\tswitch (r->cons.sync_type) {\n+\tcase RTE_RING_SYNC_ST:\n+\t\tn = __rte_ring_st_get_tail(&r->cons, &tail, n);\n+\t\t__rte_ring_st_set_head_tail(&r->cons, tail, n, 0);\n+\t\tbreak;\n+\tcase RTE_RING_SYNC_MT_HTS:\n+\t\tn = __rte_ring_hts_get_tail(&r->hts_cons, &tail, n);\n+\t\t__rte_ring_hts_set_head_tail(&r->hts_cons, tail, n, 0);\n+\t\tbreak;\n+\tcase RTE_RING_SYNC_MT:\n+\tcase RTE_RING_SYNC_MT_RTS:\n+\tdefault:\n+\t\t/* unsupported mode, shouldn't be here */\n+\t\tRTE_ASSERT(0);\n+\t}\n+}\n+\n+/**\n+ * Complete dequeuing several objects from the ring.\n+ * Note that number of objects to dequeued should not exceed previous\n+ * dequeue_start return value.\n+ *\n+ * @param r\n+ *   A pointer to the ring structure.\n+ * @param n\n+ *   The number of objects to remove from the ring.\n+ */\n+__rte_experimental\n+static __rte_always_inline void\n+rte_ring_dequeue_zc_finish(struct rte_ring *r, unsigned int n)\n+{\n+\trte_ring_dequeue_elem_finish(r, n);\n+}\n+\n+#ifdef __cplusplus\n+}\n+#endif\n+\n+#endif /* _RTE_RING_PEEK_ZC_H_ */\n",
    "prefixes": [
        "v3",
        "2/5"
    ]
}