get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 102058,
    "url": "http://patches.dpdk.org/api/patches/102058/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20211018144201.2028022-4-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": "<20211018144201.2028022-4-gakhil@marvell.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20211018144201.2028022-4-gakhil@marvell.com",
    "date": "2021-10-18T14:41:57",
    "name": "[v3,3/7] cryptodev: move inline APIs into separate structure",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "f1d560d8763ae5d23d0e73af3ad1c4f4ce9882f3",
    "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/20211018144201.2028022-4-gakhil@marvell.com/mbox/",
    "series": [
        {
            "id": 19749,
            "url": "http://patches.dpdk.org/api/series/19749/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=19749",
            "date": "2021-10-18T14:41:54",
            "name": "cryptodev: hide internal structures",
            "version": 3,
            "mbox": "http://patches.dpdk.org/series/19749/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/102058/comments/",
    "check": "warning",
    "checks": "http://patches.dpdk.org/api/patches/102058/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 3A4FCA0C43;\n\tMon, 18 Oct 2021 16:42:46 +0200 (CEST)",
            "from [217.70.189.124] (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 1FE6540DF5;\n\tMon, 18 Oct 2021 16:42:46 +0200 (CEST)",
            "from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com\n [67.231.156.173])\n by mails.dpdk.org (Postfix) with ESMTP id 2098C40141\n for <dev@dpdk.org>; Mon, 18 Oct 2021 16:42:44 +0200 (CEST)",
            "from pps.filterd (m0045851.ppops.net [127.0.0.1])\n by mx0b-0016f401.pphosted.com (8.16.1.2/8.16.1.2) with SMTP id\n 19ICWLLU009556;\n Mon, 18 Oct 2021 07:42:38 -0700",
            "from dc5-exch01.marvell.com ([199.233.59.181])\n by mx0b-0016f401.pphosted.com with ESMTP id 3brt1s34qt-1\n (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT);\n Mon, 18 Oct 2021 07:42:38 -0700",
            "from DC5-EXCH02.marvell.com (10.69.176.39) by DC5-EXCH01.marvell.com\n (10.69.176.38) with Microsoft SMTP Server (TLS) id 15.0.1497.18;\n Mon, 18 Oct 2021 07:42:36 -0700",
            "from maili.marvell.com (10.69.176.80) by DC5-EXCH02.marvell.com\n (10.69.176.39) with Microsoft SMTP Server id 15.0.1497.18 via Frontend\n Transport; Mon, 18 Oct 2021 07:42:36 -0700",
            "from localhost.localdomain (unknown [10.28.36.185])\n by maili.marvell.com (Postfix) with ESMTP id DCCA53F7041;\n Mon, 18 Oct 2021 07:42:28 -0700 (PDT)"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com;\n h=from : to : cc :\n subject : date : message-id : in-reply-to : references : mime-version :\n content-transfer-encoding : content-type; s=pfpt0220;\n bh=FOAg/k8hvEZNTvV2Y013Lym8nHdLMZgIFoncsBxlFDU=;\n b=I0syAvQm2DXVikZeZdXj0CDAd2pgXTKhoFFUC53O+7IimJIEx+eIWJV0pVVR+RsAnS40\n KwLxNDy2B+EJYHuqr6x1ARoHJv8XdnYgJTtScco6bfaH1EOfQIRxXeTmPekuEdPhpJNd\n +7GlaxCv2eUYXxyaqgGyFCKOXvi083yzd7vGXbAAwf6VcpYE1KDRs9JRa9U2UfyoG3PE\n GkzZxkRW+kPlQIektAhPYh92L3w8NOlaT/3vZlO0Te2yIKkI6P+rwft0bl+0A/rs5L0c\n 6x6FQ6z/c+S8zxlPueuuogkyJ7AzfuGRE0ZRMXMGTRiYeRvt1l7HvKRgQYO9zT0PIed9 IA==",
        "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 <roy.fan.zhang@intel.com>, <jianjay.zhou@huawei.com>,\n <asomalap@amd.com>, <ruifeng.wang@arm.com>,\n <konstantin.ananyev@intel.com>, <radu.nicolau@intel.com>,\n <ajit.khaparde@broadcom.com>, <rnagadheeraj@marvell.com>,\n <adwivedi@marvell.com>, <ciara.power@intel.com>,\n Akhil Goyal <gakhil@marvell.com>, Rebecca Troy <rebecca.troy@intel.com>",
        "Date": "Mon, 18 Oct 2021 20:11:57 +0530",
        "Message-ID": "<20211018144201.2028022-4-gakhil@marvell.com>",
        "X-Mailer": "git-send-email 2.25.1",
        "In-Reply-To": "<20211018144201.2028022-1-gakhil@marvell.com>",
        "References": "<20211011124309.4066491-1-gakhil@marvell.com>\n <20211018144201.2028022-1-gakhil@marvell.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Content-Type": "text/plain",
        "X-Proofpoint-ORIG-GUID": "53L_Ht3y2WDn3et3l47SCdHUhq5QrhkW",
        "X-Proofpoint-GUID": "53L_Ht3y2WDn3et3l47SCdHUhq5QrhkW",
        "X-Proofpoint-Virus-Version": "vendor=baseguard\n engine=ICAP:2.0.182.1,Aquarius:18.0.790,Hydra:6.0.425,FMLib:17.0.607.475\n definitions=2021-10-18_06,2021-10-18_01,2020-04-07_01",
        "Subject": "[dpdk-dev] [PATCH v3 3/7] cryptodev: move inline APIs into separate\n structure",
        "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",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>"
    },
    "content": "Move fastpath inline function pointers from rte_cryptodev into a\nseparate structure accessed via a flat array.\nThe intension is to make rte_cryptodev and related structures private\nto avoid future API/ABI breakages.\n\nSigned-off-by: Akhil Goyal <gakhil@marvell.com>\nTested-by: Rebecca Troy <rebecca.troy@intel.com>\nAcked-by: Fan Zhang <roy.fan.zhang@intel.com>\n---\n lib/cryptodev/cryptodev_pmd.c      | 53 +++++++++++++++++++++++++++++-\n lib/cryptodev/cryptodev_pmd.h      | 11 +++++++\n lib/cryptodev/rte_cryptodev.c      | 19 +++++++++++\n lib/cryptodev/rte_cryptodev_core.h | 29 ++++++++++++++++\n lib/cryptodev/version.map          |  5 +++\n 5 files changed, 116 insertions(+), 1 deletion(-)",
    "diff": "diff --git a/lib/cryptodev/cryptodev_pmd.c b/lib/cryptodev/cryptodev_pmd.c\nindex 44a70ecb35..fd74543682 100644\n--- a/lib/cryptodev/cryptodev_pmd.c\n+++ b/lib/cryptodev/cryptodev_pmd.c\n@@ -3,7 +3,7 @@\n  */\n \n #include <sys/queue.h>\n-\n+#include <rte_errno.h>\n #include <rte_string_fns.h>\n #include <rte_malloc.h>\n \n@@ -160,3 +160,54 @@ rte_cryptodev_pmd_destroy(struct rte_cryptodev *cryptodev)\n \n \treturn 0;\n }\n+\n+static uint16_t\n+dummy_crypto_enqueue_burst(__rte_unused void *qp,\n+\t\t\t   __rte_unused struct rte_crypto_op **ops,\n+\t\t\t   __rte_unused uint16_t nb_ops)\n+{\n+\tCDEV_LOG_ERR(\n+\t\t\"crypto enqueue burst requested for unconfigured device\");\n+\trte_errno = ENOTSUP;\n+\treturn 0;\n+}\n+\n+static uint16_t\n+dummy_crypto_dequeue_burst(__rte_unused void *qp,\n+\t\t\t   __rte_unused struct rte_crypto_op **ops,\n+\t\t\t   __rte_unused uint16_t nb_ops)\n+{\n+\tCDEV_LOG_ERR(\n+\t\t\"crypto dequeue burst requested for unconfigured device\");\n+\trte_errno = ENOTSUP;\n+\treturn 0;\n+}\n+\n+void\n+cryptodev_fp_ops_reset(struct rte_crypto_fp_ops *fp_ops)\n+{\n+\tstatic struct rte_cryptodev_cb_rcu dummy_cb[RTE_MAX_QUEUES_PER_PORT];\n+\tstatic void *dummy_data[RTE_MAX_QUEUES_PER_PORT];\n+\tstatic const struct rte_crypto_fp_ops dummy = {\n+\t\t.enqueue_burst = dummy_crypto_enqueue_burst,\n+\t\t.dequeue_burst = dummy_crypto_dequeue_burst,\n+\t\t.qp = {\n+\t\t\t.data = dummy_data,\n+\t\t\t.enq_cb = dummy_cb,\n+\t\t\t.deq_cb = dummy_cb,\n+\t\t},\n+\t};\n+\n+\t*fp_ops = dummy;\n+}\n+\n+void\n+cryptodev_fp_ops_set(struct rte_crypto_fp_ops *fp_ops,\n+\t\t     const struct rte_cryptodev *dev)\n+{\n+\tfp_ops->enqueue_burst = dev->enqueue_burst;\n+\tfp_ops->dequeue_burst = dev->dequeue_burst;\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+}\ndiff --git a/lib/cryptodev/cryptodev_pmd.h b/lib/cryptodev/cryptodev_pmd.h\nindex 36606dd10b..a71edbb991 100644\n--- a/lib/cryptodev/cryptodev_pmd.h\n+++ b/lib/cryptodev/cryptodev_pmd.h\n@@ -516,6 +516,17 @@ RTE_INIT(init_ ##driver_id)\\\n \tdriver_id = rte_cryptodev_allocate_driver(&crypto_drv, &(drv));\\\n }\n \n+/* Reset crypto device fastpath APIs to dummy values. */\n+__rte_internal\n+void\n+cryptodev_fp_ops_reset(struct rte_crypto_fp_ops *fp_ops);\n+\n+/* Setup crypto device fastpath APIs. */\n+__rte_internal\n+void\n+cryptodev_fp_ops_set(struct rte_crypto_fp_ops *fp_ops,\n+\t\t     const struct rte_cryptodev *dev);\n+\n static inline void *\n get_sym_session_private_data(const struct rte_cryptodev_sym_session *sess,\n \t\tuint8_t driver_id) {\ndiff --git a/lib/cryptodev/rte_cryptodev.c b/lib/cryptodev/rte_cryptodev.c\nindex eb86e629aa..305e013ebb 100644\n--- a/lib/cryptodev/rte_cryptodev.c\n+++ b/lib/cryptodev/rte_cryptodev.c\n@@ -53,6 +53,9 @@ static struct rte_cryptodev_global cryptodev_globals = {\n \t\t.nb_devs\t\t= 0\n };\n \n+/* Public fastpath APIs. */\n+struct rte_crypto_fp_ops rte_crypto_fp_ops[RTE_CRYPTO_MAX_DEVS];\n+\n /* spinlock for crypto device callbacks */\n static rte_spinlock_t rte_cryptodev_cb_lock = RTE_SPINLOCK_INITIALIZER;\n \n@@ -917,6 +920,8 @@ rte_cryptodev_pmd_release_device(struct rte_cryptodev *cryptodev)\n \n \tdev_id = cryptodev->data->dev_id;\n \n+\tcryptodev_fp_ops_reset(rte_crypto_fp_ops + dev_id);\n+\n \t/* Close device only if device operations have been set */\n \tif (cryptodev->dev_ops) {\n \t\tret = rte_cryptodev_close(dev_id);\n@@ -1080,6 +1085,9 @@ rte_cryptodev_start(uint8_t dev_id)\n \t}\n \n \tdiag = (*dev->dev_ops->dev_start)(dev);\n+\t/* expose selection of PMD fast-path functions */\n+\tcryptodev_fp_ops_set(rte_crypto_fp_ops + dev_id, dev);\n+\n \trte_cryptodev_trace_start(dev_id, diag);\n \tif (diag == 0)\n \t\tdev->data->dev_started = 1;\n@@ -1109,6 +1117,9 @@ rte_cryptodev_stop(uint8_t dev_id)\n \t\treturn;\n \t}\n \n+\t/* point fast-path functions to dummy ones */\n+\tcryptodev_fp_ops_reset(rte_crypto_fp_ops + dev_id);\n+\n \t(*dev->dev_ops->dev_stop)(dev);\n \trte_cryptodev_trace_stop(dev_id);\n \tdev->data->dev_started = 0;\n@@ -2411,3 +2422,11 @@ rte_cryptodev_allocate_driver(struct cryptodev_driver *crypto_drv,\n \n \treturn nb_drivers++;\n }\n+\n+RTE_INIT(cryptodev_init_fp_ops)\n+{\n+\tuint32_t i;\n+\n+\tfor (i = 0; i != RTE_DIM(rte_crypto_fp_ops); i++)\n+\t\tcryptodev_fp_ops_reset(rte_crypto_fp_ops + i);\n+}\ndiff --git a/lib/cryptodev/rte_cryptodev_core.h b/lib/cryptodev/rte_cryptodev_core.h\nindex 1633e55889..e9e9a44b3c 100644\n--- a/lib/cryptodev/rte_cryptodev_core.h\n+++ b/lib/cryptodev/rte_cryptodev_core.h\n@@ -25,6 +25,35 @@ 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+/**\n+ * @internal\n+ * Structure used to hold opaque pointers to internal ethdev Rx/Tx\n+ * queues data.\n+ * The main purpose to expose these pointers at all - allow compiler\n+ * to fetch this data for fast-path cryptodev inline functions in advance.\n+ */\n+struct rte_cryptodev_qpdata {\n+\t/** points to array of internal queue pair data pointers. */\n+\tvoid **data;\n+\t/** points to array of enqueue callback data pointers */\n+\tstruct rte_cryptodev_cb_rcu *enq_cb;\n+\t/** points to array of dequeue callback data pointers */\n+\tstruct rte_cryptodev_cb_rcu *deq_cb;\n+};\n+\n+struct rte_crypto_fp_ops {\n+\t/** PMD enqueue burst function. */\n+\tenqueue_pkt_burst_t enqueue_burst;\n+\t/** PMD dequeue burst function. */\n+\tdequeue_pkt_burst_t dequeue_burst;\n+\t/** Internal queue pair data pointers. */\n+\tstruct rte_cryptodev_qpdata qp;\n+\t/** Reserved for future ops. */\n+\tuintptr_t reserved[4];\n+} __rte_cache_aligned;\n+\n+extern struct rte_crypto_fp_ops rte_crypto_fp_ops[RTE_CRYPTO_MAX_DEVS];\n+\n /**\n  * @internal\n  * The data part, with no function pointers, associated with each device.\ndiff --git a/lib/cryptodev/version.map b/lib/cryptodev/version.map\nindex 43cf937e40..ed62ced221 100644\n--- a/lib/cryptodev/version.map\n+++ b/lib/cryptodev/version.map\n@@ -45,6 +45,9 @@ DPDK_22 {\n \trte_cryptodev_sym_session_init;\n \trte_cryptodevs;\n \n+\t#added in 21.11\n+\trte_crypto_fp_ops;\n+\n \tlocal: *;\n };\n \n@@ -109,6 +112,8 @@ EXPERIMENTAL {\n INTERNAL {\n \tglobal:\n \n+\tcryptodev_fp_ops_reset;\n+\tcryptodev_fp_ops_set;\n \trte_cryptodev_allocate_driver;\n \trte_cryptodev_pmd_allocate;\n \trte_cryptodev_pmd_callback_process;\n",
    "prefixes": [
        "v3",
        "3/7"
    ]
}