get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 139223,
    "url": "http://patches.dpdk.org/api/patches/139223/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20240411082232.3495883-2-gakhil@marvell.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": "<20240411082232.3495883-2-gakhil@marvell.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20240411082232.3495883-2-gakhil@marvell.com",
    "date": "2024-04-11T08:22:30",
    "name": "[1/3] cryptodev: add API to get used queue pair depth",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": false,
    "hash": "79e8a3df906ab463337dfa414ac1caf57d76262a",
    "submitter": {
        "id": 2094,
        "url": "http://patches.dpdk.org/api/people/2094/?format=api",
        "name": "Akhil Goyal",
        "email": "gakhil@marvell.com"
    },
    "delegate": {
        "id": 6690,
        "url": "http://patches.dpdk.org/api/users/6690/?format=api",
        "username": "akhil",
        "first_name": "akhil",
        "last_name": "goyal",
        "email": "gakhil@marvell.com"
    },
    "mbox": "http://patches.dpdk.org/project/dpdk/patch/20240411082232.3495883-2-gakhil@marvell.com/mbox/",
    "series": [
        {
            "id": 31719,
            "url": "http://patches.dpdk.org/api/series/31719/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=31719",
            "date": "2024-04-11T08:22:29",
            "name": "cryptodev: add API to get used queue pair depth",
            "version": 1,
            "mbox": "http://patches.dpdk.org/series/31719/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/139223/comments/",
    "check": "success",
    "checks": "http://patches.dpdk.org/api/patches/139223/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 mails.dpdk.org (mails.dpdk.org [217.70.189.124])\n\tby inbox.dpdk.org (Postfix) with ESMTP id 26BDB43E42;\n\tThu, 11 Apr 2024 10:22:58 +0200 (CEST)",
            "from mails.dpdk.org (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 11EF3402ED;\n\tThu, 11 Apr 2024 10:22:58 +0200 (CEST)",
            "from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com\n [67.231.148.174])\n by mails.dpdk.org (Postfix) with ESMTP id 26312402EB\n for <dev@dpdk.org>; Thu, 11 Apr 2024 10:22:55 +0200 (CEST)",
            "from pps.filterd (m0045849.ppops.net [127.0.0.1])\n by mx0a-0016f401.pphosted.com (8.17.1.24/8.17.1.24) with ESMTP id\n 43B5v2PU000545; Thu, 11 Apr 2024 01:22:48 -0700",
            "from dc5-exch05.marvell.com ([199.233.59.128])\n by mx0a-0016f401.pphosted.com (PPS) with ESMTPS id 3xea5f1fxm-1\n (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT);\n Thu, 11 Apr 2024 01:22:48 -0700 (PDT)",
            "from DC5-EXCH05.marvell.com (10.69.176.209) by\n DC5-EXCH05.marvell.com (10.69.176.209) with Microsoft SMTP Server\n (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id\n 15.2.1544.4; Thu, 11 Apr 2024 01:22:47 -0700",
            "from maili.marvell.com (10.69.176.80) by DC5-EXCH05.marvell.com\n (10.69.176.209) with Microsoft SMTP Server id 15.2.1544.4 via Frontend\n Transport; Thu, 11 Apr 2024 01:22:47 -0700",
            "from localhost.localdomain (unknown [10.28.36.102])\n by maili.marvell.com (Postfix) with ESMTP id 992DA3F706A;\n Thu, 11 Apr 2024 01:22:41 -0700 (PDT)"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=\n from:to:cc:subject:date:message-id:in-reply-to:references\n :mime-version:content-transfer-encoding:content-type; s=\n pfpt0220; bh=aY+WOQPgWV8H7RXFpbm2wvD7xZZJG9cvNlvXdLaHjSw=; b=Pee\n 4ei76IS1P+TPYzVDUD8xlWZjvYqq9mlBsZC6AffvTXQnuIS2YKpBcfSja141N2+3\n YDBPDACiAMUMOIgYhwBpk1yQZ8aQQYki4UbP8HTeUcUlgjpiFtV4fwhgt4J55daP\n IpTCbABTzbvyhsYxYseIPllezKOwRe9jtnwsM7bE0/2F0oVSwaWOqYGrTQwe/wpH\n lC8Tb7LrW2i1OyuKpgDBvw183cqrirjMxAttJ9jSoPNhpJGD+RwHUft/NxcD/lir\n o0XSKKsH1k9sD+d9xxt6Fjnx6f2qdF1h5e9FPFe4uxlVPmMCt5bIjAb3rY0O8s2T\n ihwnZq5N2Tvsftl2rIA==",
        "From": "Akhil Goyal <gakhil@marvell.com>",
        "To": "<dev@dpdk.org>",
        "CC": "<thomas@monjalon.net>, <david.marchand@redhat.com>,\n <hemant.agrawal@nxp.com>, <anoobj@marvell.com>,\n <pablo.de.lara.guarch@intel.com>, <fiona.trahe@intel.com>,\n <declan.doherty@intel.com>, <matan@nvidia.com>, <g.singh@nxp.com>,\n <fanzhang.oss@gmail.com>, <jianjay.zhou@huawei.com>,\n <asomalap@amd.com>, <ruifeng.wang@arm.com>,\n <konstantin.v.ananyev@yandex.ru>, <radu.nicolau@intel.com>,\n <ajit.khaparde@broadcom.com>, <rnagadheeraj@marvell.com>,\n <ciara.power@intel.com>, Akhil Goyal <gakhil@marvell.com>",
        "Subject": "[PATCH 1/3] cryptodev: add API to get used queue pair depth",
        "Date": "Thu, 11 Apr 2024 13:52:30 +0530",
        "Message-ID": "<20240411082232.3495883-2-gakhil@marvell.com>",
        "X-Mailer": "git-send-email 2.25.1",
        "In-Reply-To": "<20240411082232.3495883-1-gakhil@marvell.com>",
        "References": "<20240411082232.3495883-1-gakhil@marvell.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Content-Type": "text/plain",
        "X-Proofpoint-GUID": "fuQFYDEd0SwQgnxkY1KJZ2OCU3W2iRFV",
        "X-Proofpoint-ORIG-GUID": "fuQFYDEd0SwQgnxkY1KJZ2OCU3W2iRFV",
        "X-Proofpoint-Virus-Version": "vendor=baseguard\n engine=ICAP:2.0.272,Aquarius:18.0.1011,Hydra:6.0.619,FMLib:17.11.176.26\n definitions=2024-04-11_02,2024-04-09_01,2023-05-22_02",
        "X-BeenThere": "dev@dpdk.org",
        "X-Mailman-Version": "2.1.29",
        "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"
    },
    "content": "Added a new fast path API to get used queue pair\ndescriptors of a specific queue pair of a device.\nApplications may monitor the depth used and enqueue\ncrypto ops accordingly.\n\nSigned-off-by: Akhil Goyal <gakhil@marvell.com>\n---\n devtools/libabigail.abignore           |  3 ++\n lib/cryptodev/cryptodev_pmd.c          |  1 +\n lib/cryptodev/cryptodev_pmd.h          |  2 ++\n lib/cryptodev/cryptodev_trace_points.c |  3 ++\n lib/cryptodev/rte_cryptodev.h          | 45 ++++++++++++++++++++++++++\n lib/cryptodev/rte_cryptodev_core.h     |  7 +++-\n lib/cryptodev/rte_cryptodev_trace_fp.h |  7 ++++\n 7 files changed, 67 insertions(+), 1 deletion(-)",
    "diff": "diff --git a/devtools/libabigail.abignore b/devtools/libabigail.abignore\nindex 645d289a77..bd63f42008 100644\n--- a/devtools/libabigail.abignore\n+++ b/devtools/libabigail.abignore\n@@ -37,3 +37,6 @@\n [suppress_type]\n \tname = rte_eth_fp_ops\n \thas_data_member_inserted_between = {offset_of(reserved2), end}\n+[suppress_type]\n+\tname = rte_crypto_fp_ops\n+\thas_data_member_inserted_between = {offset_of(reserved), end}\ndiff --git a/lib/cryptodev/cryptodev_pmd.c b/lib/cryptodev/cryptodev_pmd.c\nindex d8073a601d..87ced122b4 100644\n--- a/lib/cryptodev/cryptodev_pmd.c\n+++ b/lib/cryptodev/cryptodev_pmd.c\n@@ -236,6 +236,7 @@ cryptodev_fp_ops_set(struct rte_crypto_fp_ops *fp_ops,\n \tfp_ops->qp.data = dev->data->queue_pairs;\n \tfp_ops->qp.enq_cb = dev->enq_cbs;\n \tfp_ops->qp.deq_cb = dev->deq_cbs;\n+\tfp_ops->qp_depth_used = dev->qp_depth_used;\n }\n \n void *\ndiff --git a/lib/cryptodev/cryptodev_pmd.h b/lib/cryptodev/cryptodev_pmd.h\nindex d195b81771..c22cc0908d 100644\n--- a/lib/cryptodev/cryptodev_pmd.h\n+++ b/lib/cryptodev/cryptodev_pmd.h\n@@ -117,6 +117,8 @@ struct __rte_cache_aligned rte_cryptodev {\n \tstruct rte_cryptodev_cb_rcu *enq_cbs;\n \t/** User application callback for post dequeue processing */\n \tstruct rte_cryptodev_cb_rcu *deq_cbs;\n+\t/** Pointer to PMD function to get used queue pair depth */\n+\tcrypto_qp_depth_used_t qp_depth_used;\n };\n \n /** Global structure used for maintaining state of allocated crypto devices */\ndiff --git a/lib/cryptodev/cryptodev_trace_points.c b/lib/cryptodev/cryptodev_trace_points.c\nindex 8c47ab1e78..7403412553 100644\n--- a/lib/cryptodev/cryptodev_trace_points.c\n+++ b/lib/cryptodev/cryptodev_trace_points.c\n@@ -194,3 +194,6 @@ RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_op_pool_create,\n \n RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_count,\n \tlib.cryptodev.count)\n+\n+RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_qp_depth_used,\n+\tlib.cryptodev.qp_depth_used)\ndiff --git a/lib/cryptodev/rte_cryptodev.h b/lib/cryptodev/rte_cryptodev.h\nindex 00ba6a234a..d6d7938f84 100644\n--- a/lib/cryptodev/rte_cryptodev.h\n+++ b/lib/cryptodev/rte_cryptodev.h\n@@ -2005,6 +2005,51 @@ rte_cryptodev_enqueue_burst(uint8_t dev_id, uint16_t qp_id,\n \treturn fp_ops->enqueue_burst(qp, ops, nb_ops);\n }\n \n+/**\n+ * @warning\n+ * @b EXPERIMENTAL: this API may change, or be removed, without prior notice\n+ *\n+ * Get the number of used descriptors or depth of a cryptodev queue pair.\n+ *\n+ * This function retrieves the number of used descriptors in a crypto queue.\n+ * Applications can use this API in the fast path to inspect QP occupancy and\n+ * take appropriate action.\n+ *\n+ * Since it is a fast-path function, no check is performed on dev_id and qp_id.\n+ * Caller must therefore ensure that the device is enabled and queue pair is setup.\n+ *\n+ * @param\tdev_id\t\tThe identifier of the device.\n+ * @param\tqp_id\t\tThe index of the queue pair for which used descriptor\n+ *\t\t\t\tcount is to be retrieved. The value\n+ *\t\t\t\tmust be in the range [0, nb_queue_pairs - 1]\n+ *\t\t\t\tpreviously supplied to *rte_cryptodev_configure*.\n+ *\n+ * @return\n+ *  The number of used descriptors on the specified queue pair, or:\n+ *   - (-ENOTSUP) if the device does not support this function.\n+ */\n+\n+__rte_experimental\n+static inline int\n+rte_cryptodev_qp_depth_used(uint8_t dev_id, uint16_t qp_id)\n+{\n+\tconst struct rte_crypto_fp_ops *fp_ops;\n+\tvoid *qp;\n+\tint rc;\n+\n+\tfp_ops = &rte_crypto_fp_ops[dev_id];\n+\tqp = fp_ops->qp.data[qp_id];\n+\n+\tif (fp_ops->qp_depth_used == NULL) {\n+\t\trc = -ENOTSUP;\n+\t\tgoto out;\n+\t}\n+\n+\trc = fp_ops->qp_depth_used(qp);\n+out:\n+\trte_cryptodev_trace_qp_depth_used(dev_id, qp_id);\n+\treturn rc;\n+}\n \n \n #ifdef __cplusplus\ndiff --git a/lib/cryptodev/rte_cryptodev_core.h b/lib/cryptodev/rte_cryptodev_core.h\nindex 8d7e58d76d..9d68a026d9 100644\n--- a/lib/cryptodev/rte_cryptodev_core.h\n+++ b/lib/cryptodev/rte_cryptodev_core.h\n@@ -24,6 +24,9 @@ typedef uint16_t (*enqueue_pkt_burst_t)(void *qp,\n \t\tstruct rte_crypto_op **ops,\tuint16_t nb_ops);\n /**< Enqueue packets for processing on queue pair of a device. */\n \n+typedef uint32_t (*crypto_qp_depth_used_t)(void *qp);\n+/**< Get used descriptor depth in a queue pair of a device. */\n+\n /**\n  * @internal\n  * Structure used to hold opaque pointers to internal ethdev Rx/Tx\n@@ -47,8 +50,10 @@ struct __rte_cache_aligned rte_crypto_fp_ops {\n \tdequeue_pkt_burst_t dequeue_burst;\n \t/** Internal queue pair data pointers. */\n \tstruct rte_cryptodev_qpdata qp;\n+\t/** Get the number of used queue pair descriptors. */\n+\tcrypto_qp_depth_used_t qp_depth_used;\n \t/** Reserved for future ops. */\n-\tuintptr_t reserved[3];\n+\tuintptr_t reserved[2];\n };\n \n extern struct rte_crypto_fp_ops rte_crypto_fp_ops[RTE_CRYPTO_MAX_DEVS];\ndiff --git a/lib/cryptodev/rte_cryptodev_trace_fp.h b/lib/cryptodev/rte_cryptodev_trace_fp.h\nindex 9218997c14..dbfbc7b2e5 100644\n--- a/lib/cryptodev/rte_cryptodev_trace_fp.h\n+++ b/lib/cryptodev/rte_cryptodev_trace_fp.h\n@@ -31,6 +31,13 @@ RTE_TRACE_POINT_FP(\n \trte_trace_point_emit_u16(nb_ops);\n )\n \n+RTE_TRACE_POINT_FP(\n+\trte_cryptodev_trace_qp_depth_used,\n+\tRTE_TRACE_POINT_ARGS(uint8_t dev_id, uint16_t qp_id),\n+\trte_trace_point_emit_u8(dev_id);\n+\trte_trace_point_emit_u16(qp_id);\n+)\n+\n #ifdef __cplusplus\n }\n #endif\n",
    "prefixes": [
        "1/3"
    ]
}