get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 98859,
    "url": "https://patches.dpdk.org/api/patches/98859/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/20210914151434.29922-3-ndabilpuram@marvell.com/",
    "project": {
        "id": 1,
        "url": "https://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": "<20210914151434.29922-3-ndabilpuram@marvell.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20210914151434.29922-3-ndabilpuram@marvell.com",
    "date": "2021-09-14T15:14:33",
    "name": "[v5,2/3] security: add option for faster udata or mdata access",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "088872da4fc2533ed682c4d767850351f0073e54",
    "submitter": {
        "id": 1202,
        "url": "https://patches.dpdk.org/api/people/1202/?format=api",
        "name": "Nithin Dabilpuram",
        "email": "ndabilpuram@marvell.com"
    },
    "delegate": {
        "id": 6690,
        "url": "https://patches.dpdk.org/api/users/6690/?format=api",
        "username": "akhil",
        "first_name": "akhil",
        "last_name": "goyal",
        "email": "gakhil@marvell.com"
    },
    "mbox": "https://patches.dpdk.org/project/dpdk/patch/20210914151434.29922-3-ndabilpuram@marvell.com/mbox/",
    "series": [
        {
            "id": 18902,
            "url": "https://patches.dpdk.org/api/series/18902/?format=api",
            "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=18902",
            "date": "2021-09-14T15:14:31",
            "name": "security: Improve inline fast path routines",
            "version": 5,
            "mbox": "https://patches.dpdk.org/series/18902/mbox/"
        }
    ],
    "comments": "https://patches.dpdk.org/api/patches/98859/comments/",
    "check": "warning",
    "checks": "https://patches.dpdk.org/api/patches/98859/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 DDC6CA0C43;\n\tTue, 14 Sep 2021 17:15:00 +0200 (CEST)",
            "from [217.70.189.124] (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 41F0A410EF;\n\tTue, 14 Sep 2021 17:14:56 +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 C6BC0410ED\n for <dev@dpdk.org>; Tue, 14 Sep 2021 17:14:54 +0200 (CEST)",
            "from pps.filterd (m0045849.ppops.net [127.0.0.1])\n by mx0a-0016f401.pphosted.com (8.16.1.2/8.16.1.2) with SMTP id\n 18E9q4xa024044;\n Tue, 14 Sep 2021 08:14:52 -0700",
            "from dc5-exch02.marvell.com ([199.233.59.182])\n by mx0a-0016f401.pphosted.com with ESMTP id 3b2sfshejr-1\n (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT);\n Tue, 14 Sep 2021 08:14:52 -0700",
            "from DC5-EXCH02.marvell.com (10.69.176.39) by DC5-EXCH02.marvell.com\n (10.69.176.39) with Microsoft SMTP Server (TLS) id 15.0.1497.18;\n Tue, 14 Sep 2021 08:14:50 -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; Tue, 14 Sep 2021 08:14:50 -0700",
            "from hyd1588t430.marvell.com (unknown [10.29.52.204])\n by maili.marvell.com (Postfix) with ESMTP id B2D803F7066;\n Tue, 14 Sep 2021 08:14:46 -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-type; s=pfpt0220; bh=5vZe3PU4ZqiWxDC9MWAD8q33nhLYL4AjVVClibgMZgs=;\n b=P2biPwrP6XNEtZyLBO6mkEZxFd5zZF6nqF2FhxCO6aVaRLuRsfUDfITGddPFqvuZKi/l\n c8up9T7YLLAjyAidofsZldDJOc5s1lYTIzdqCMO1j7WkupipN+MesNmfPkkruvWLjsI7\n TyBwCFzHxGD9N9SGmk5WEB9uNPKAxdAMuP+BEOqdjAnr5VNEmdVGb/iJg/hOyygejk/0\n tN0nD5tcik6+YOL3Nd5SGgCLjwS/pc7rN5aIja1s3BR6rtR451aHI9fu1SOC3pnVhJYI\n gPrWgmFNGEh0VCMDkHEHvNMXl/t38djpVgDW+YQM5kd+BQpSFVq4MOtNlWohDegrLHtk fQ==",
        "From": "Nithin Dabilpuram <ndabilpuram@marvell.com>",
        "To": "<konstantin.ananyev@intel.com>, <jerinj@marvell.com>,\n <gakhil@marvell.com>,\n <roy.fan.zhang@intel.com>, <hemant.agrawal@nxp.com>, <matan@nvidia.com>",
        "CC": "<ndabilpuram@marvell.com>, <dev@dpdk.org>, <ferruh.yigit@intel.com>,\n <radu.nicolau@intel.com>, <olivier.matz@6wind.com>, <g.singh@nxp.com>,\n <declan.doherty@intel.com>, <jiawenwu@trustnetic.com>",
        "Date": "Tue, 14 Sep 2021 20:44:33 +0530",
        "Message-ID": "<20210914151434.29922-3-ndabilpuram@marvell.com>",
        "X-Mailer": "git-send-email 2.8.4",
        "In-Reply-To": "<20210914151434.29922-1-ndabilpuram@marvell.com>",
        "References": "<20210624102848.3878788-1-gakhil@marvell.com>\n <20210914151434.29922-1-ndabilpuram@marvell.com>",
        "MIME-Version": "1.0",
        "Content-Type": "text/plain",
        "X-Proofpoint-GUID": "7CBIhG4w-73CUUbX_8AJ6D7AGDELTxVr",
        "X-Proofpoint-ORIG-GUID": "7CBIhG4w-73CUUbX_8AJ6D7AGDELTxVr",
        "X-Proofpoint-Virus-Version": "vendor=baseguard\n engine=ICAP:2.0.182.1,Aquarius:18.0.790,Hydra:6.0.391,FMLib:17.0.607.475\n definitions=2021-09-14_06,2021-09-14_01,2020-04-07_01",
        "Subject": "[dpdk-dev] [PATCH v5 2/3] security: add option for faster udata or\n mdata access",
        "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": "Currently rte_security_set_pkt_metadata() and rte_security_get_userdata()\nmethods to set pkt metadata on Inline outbound and get userdata\nafter Inline inbound processing is always driver specific callbacks.\n\nFor drivers that do not have much to do in the callbacks but just\nto update metadata in rte_security dynamic field and get userdata\nfrom rte_security dynamic field, having to just to PMD specific\ncallback is costly per packet operation. This patch provides\na mechanism to do the same in inline function and avoid function\npointer jump if a driver supports the same.\n\nSigned-off-by: Nithin Dabilpuram <ndabilpuram@marvell.com>\nAcked-by: Akhil Goyal <gakhil@marvell.com>\n---\n doc/guides/rel_notes/deprecation.rst   |  4 ---\n doc/guides/rel_notes/release_21_08.rst |  6 +++++\n lib/security/rte_security.c            |  8 +++---\n lib/security/rte_security.h            | 48 +++++++++++++++++++++++++++++++---\n lib/security/version.map               |  2 ++\n 5 files changed, 56 insertions(+), 12 deletions(-)",
    "diff": "diff --git a/doc/guides/rel_notes/deprecation.rst b/doc/guides/rel_notes/deprecation.rst\nindex 59445a6..70ef45e 100644\n--- a/doc/guides/rel_notes/deprecation.rst\n+++ b/doc/guides/rel_notes/deprecation.rst\n@@ -276,10 +276,6 @@ Deprecation Notices\n   content. On Linux and FreeBSD, supported prior to DPDK 20.11,\n   original structure will be kept until DPDK 21.11.\n \n-* security: The functions ``rte_security_set_pkt_metadata`` and\n-  ``rte_security_get_userdata`` will be made inline functions and additional\n-  flags will be added in structure ``rte_security_ctx`` in DPDK 21.11.\n-\n * cryptodev: The structure ``rte_crypto_op`` would be updated to reduce\n   reserved bytes to 2 (from 3), and use 1 byte to indicate warnings and other\n   information from the crypto/security operation. This field will be used to\ndiff --git a/doc/guides/rel_notes/release_21_08.rst b/doc/guides/rel_notes/release_21_08.rst\nindex b4cbf2d..59ff15a 100644\n--- a/doc/guides/rel_notes/release_21_08.rst\n+++ b/doc/guides/rel_notes/release_21_08.rst\n@@ -223,6 +223,12 @@ ABI Changes\n \n * No ABI change that would break compatibility with 20.11.\n \n+* security: ``rte_security_set_pkt_metadata`` and ``rte_security_get_userdata``\n+  routines used by Inline outbound and Inline inbound security processing are\n+  made inline and enhanced to do simple 64-bit set/get for PMD's that donot\n+  have much processing in PMD specific callbacks but just 64-bit set/get.\n+  This avoids a per-pkt function pointer jump overhead for such PMD's.\n+\n \n Known Issues\n ------------\ndiff --git a/lib/security/rte_security.c b/lib/security/rte_security.c\nindex e8116d5..fe81ed3 100644\n--- a/lib/security/rte_security.c\n+++ b/lib/security/rte_security.c\n@@ -122,9 +122,9 @@ rte_security_session_destroy(struct rte_security_ctx *instance,\n }\n \n int\n-rte_security_set_pkt_metadata(struct rte_security_ctx *instance,\n-\t\t\t      struct rte_security_session *sess,\n-\t\t\t      struct rte_mbuf *m, void *params)\n+__rte_security_set_pkt_metadata(struct rte_security_ctx *instance,\n+\t\t\t\tstruct rte_security_session *sess,\n+\t\t\t\tstruct rte_mbuf *m, void *params)\n {\n #ifdef RTE_DEBUG\n \tRTE_PTR_OR_ERR_RET(sess, -EINVAL);\n@@ -137,7 +137,7 @@ rte_security_set_pkt_metadata(struct rte_security_ctx *instance,\n }\n \n void *\n-rte_security_get_userdata(struct rte_security_ctx *instance, uint64_t md)\n+__rte_security_get_userdata(struct rte_security_ctx *instance, uint64_t md)\n {\n \tvoid *userdata = NULL;\n \ndiff --git a/lib/security/rte_security.h b/lib/security/rte_security.h\nindex 2e136d7..3124134 100644\n--- a/lib/security/rte_security.h\n+++ b/lib/security/rte_security.h\n@@ -71,8 +71,18 @@ struct rte_security_ctx {\n \t/**< Pointer to security ops for the device */\n \tuint16_t sess_cnt;\n \t/**< Number of sessions attached to this context */\n+\tuint32_t flags;\n+\t/**< Flags for security context */\n };\n \n+#define RTE_SEC_CTX_F_FAST_SET_MDATA 0x00000001\n+/**< Driver uses fast metadata update without using driver specific callback */\n+\n+#define RTE_SEC_CTX_F_FAST_GET_UDATA 0x00000002\n+/**< Driver provides udata using fast method without using driver specific\n+ * callback.\n+ */\n+\n /**\n  * IPSEC tunnel parameters\n  *\n@@ -494,6 +504,12 @@ static inline bool rte_security_dynfield_is_registered(void)\n \treturn rte_security_dynfield_offset >= 0;\n }\n \n+/** Function to call PMD specific function pointer set_pkt_metadata() */\n+__rte_experimental\n+extern int __rte_security_set_pkt_metadata(struct rte_security_ctx *instance,\n+\t\t\t\t\t   struct rte_security_session *sess,\n+\t\t\t\t\t   struct rte_mbuf *m, void *params);\n+\n /**\n  *  Updates the buffer with device-specific defined metadata\n  *\n@@ -507,10 +523,26 @@ static inline bool rte_security_dynfield_is_registered(void)\n  *  - On success, zero.\n  *  - On failure, a negative value.\n  */\n-int\n+static inline int\n rte_security_set_pkt_metadata(struct rte_security_ctx *instance,\n \t\t\t      struct rte_security_session *sess,\n-\t\t\t      struct rte_mbuf *mb, void *params);\n+\t\t\t      struct rte_mbuf *mb, void *params)\n+{\n+\t/* Fast Path */\n+\tif (instance->flags & RTE_SEC_CTX_F_FAST_SET_MDATA) {\n+\t\t*rte_security_dynfield(mb) =\n+\t\t\t(rte_security_dynfield_t)(sess->sess_private_data);\n+\t\treturn 0;\n+\t}\n+\n+\t/* Jump to PMD specific function pointer */\n+\treturn __rte_security_set_pkt_metadata(instance, sess, mb, params);\n+}\n+\n+/** Function to call PMD specific function pointer get_userdata() */\n+__rte_experimental\n+extern void *__rte_security_get_userdata(struct rte_security_ctx *instance,\n+\t\t\t\t\t uint64_t md);\n \n /**\n  * Get userdata associated with the security session. Device specific metadata\n@@ -530,8 +562,16 @@ rte_security_set_pkt_metadata(struct rte_security_ctx *instance,\n  *  - On failure, NULL\n  */\n __rte_experimental\n-void *\n-rte_security_get_userdata(struct rte_security_ctx *instance, uint64_t md);\n+static inline void *\n+rte_security_get_userdata(struct rte_security_ctx *instance, uint64_t md)\n+{\n+\t/* Fast Path */\n+\tif (instance->flags & RTE_SEC_CTX_F_FAST_GET_UDATA)\n+\t\treturn (void *)(uintptr_t)md;\n+\n+\t/* Jump to PMD specific function pointer */\n+\treturn __rte_security_get_userdata(instance, md);\n+}\n \n /**\n  * Attach a session to a symmetric crypto operation\ndiff --git a/lib/security/version.map b/lib/security/version.map\nindex c44c7f5..45ace9c 100644\n--- a/lib/security/version.map\n+++ b/lib/security/version.map\n@@ -20,4 +20,6 @@ EXPERIMENTAL {\n \trte_security_get_userdata;\n \trte_security_session_stats_get;\n \trte_security_session_update;\n+\t__rte_security_set_pkt_metadata;\n+\t__rte_security_get_userdata;\n };\n",
    "prefixes": [
        "v5",
        "2/3"
    ]
}