get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 75640,
    "url": "http://patches.dpdk.org/api/patches/75640/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20200818162833.20219-2-roy.fan.zhang@intel.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": "<20200818162833.20219-2-roy.fan.zhang@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20200818162833.20219-2-roy.fan.zhang@intel.com",
    "date": "2020-08-18T16:28:30",
    "name": "[v6,1/4] cryptodev: add crypto data-path service APIs",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "f09b918cf15e93e50dad02b714dee2146b15c344",
    "submitter": {
        "id": 304,
        "url": "http://patches.dpdk.org/api/people/304/?format=api",
        "name": "Fan Zhang",
        "email": "roy.fan.zhang@intel.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/20200818162833.20219-2-roy.fan.zhang@intel.com/mbox/",
    "series": [
        {
            "id": 11694,
            "url": "http://patches.dpdk.org/api/series/11694/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=11694",
            "date": "2020-08-18T16:28:29",
            "name": "cryptodev: add data-path service APIs",
            "version": 6,
            "mbox": "http://patches.dpdk.org/series/11694/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/75640/comments/",
    "check": "warning",
    "checks": "http://patches.dpdk.org/api/patches/75640/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 8F53BA0353;\n\tTue, 18 Aug 2020 18:29:01 +0200 (CEST)",
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id BF60514581;\n\tTue, 18 Aug 2020 18:28:52 +0200 (CEST)",
            "from mga17.intel.com (mga17.intel.com [192.55.52.151])\n by dpdk.org (Postfix) with ESMTP id 9D04F2BAA\n for <dev@dpdk.org>; Tue, 18 Aug 2020 18:28:49 +0200 (CEST)",
            "from fmsmga004.fm.intel.com ([10.253.24.48])\n by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 18 Aug 2020 09:28:39 -0700",
            "from silpixa00398673.ir.intel.com (HELO\n silpixa00398673.ger.corp.intel.com) ([10.237.223.136])\n by fmsmga004.fm.intel.com with ESMTP; 18 Aug 2020 09:28:37 -0700"
        ],
        "IronPort-SDR": [
            "\n CgHnmrtZO7QPSKu+jD4IgcO7UCsBehsQFepRs8Po8/rHA/0pFGBkzdMlxel+4zjI4GmQ3P6ujq\n jGq/HKzF79DA==",
            "\n Ocd+FWnZLLGMtJ8UxJcnM16uBD6rVLrB5WRJa8cCZ5uPbXGb4pw/dSQKXAjInuNkXM6iS0+WrB\n hH52/6u+qKjQ=="
        ],
        "X-IronPort-AV": [
            "E=McAfee;i=\"6000,8403,9716\"; a=\"135011812\"",
            "E=Sophos;i=\"5.76,328,1592895600\"; d=\"scan'208\";a=\"135011812\"",
            "E=Sophos;i=\"5.76,328,1592895600\"; d=\"scan'208\";a=\"320148776\""
        ],
        "X-Amp-Result": "SKIPPED(no attachment in message)",
        "X-Amp-File-Uploaded": "False",
        "X-ExtLoop1": "1",
        "From": "Fan Zhang <roy.fan.zhang@intel.com>",
        "To": "dev@dpdk.org",
        "Cc": "akhil.goyal@nxp.com, fiona.trahe@intel.com, ArkadiuszX.Kusztal@intel.com,\n AdamX.Dybkowski@intel.com, Fan Zhang <roy.fan.zhang@intel.com>,\n Piotr Bronowski <piotrx.bronowski@intel.com>",
        "Date": "Tue, 18 Aug 2020 17:28:30 +0100",
        "Message-Id": "<20200818162833.20219-2-roy.fan.zhang@intel.com>",
        "X-Mailer": "git-send-email 2.20.1",
        "In-Reply-To": "<20200818162833.20219-1-roy.fan.zhang@intel.com>",
        "References": "<20200818162833.20219-1-roy.fan.zhang@intel.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Subject": "[dpdk-dev] [dpdk-dev v6 1/4] cryptodev: add crypto data-path\n\tservice 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": "This patch adds data-path service APIs for enqueue and dequeue\noperations to cryptodev. The APIs support flexible user-define\nenqueue and dequeue behaviors and operation mode.\n\nSigned-off-by: Fan Zhang <roy.fan.zhang@intel.com>\nSigned-off-by: Piotr Bronowski <piotrx.bronowski@intel.com>\n---\n lib/librte_cryptodev/rte_crypto.h             |   9 +\n lib/librte_cryptodev/rte_crypto_sym.h         |  44 ++-\n lib/librte_cryptodev/rte_cryptodev.c          |  45 +++\n lib/librte_cryptodev/rte_cryptodev.h          | 335 +++++++++++++++++-\n lib/librte_cryptodev/rte_cryptodev_pmd.h      |  47 ++-\n .../rte_cryptodev_version.map                 |  10 +\n 6 files changed, 481 insertions(+), 9 deletions(-)",
    "diff": "diff --git a/lib/librte_cryptodev/rte_crypto.h b/lib/librte_cryptodev/rte_crypto.h\nindex fd5ef3a87..f009be9af 100644\n--- a/lib/librte_cryptodev/rte_crypto.h\n+++ b/lib/librte_cryptodev/rte_crypto.h\n@@ -438,6 +438,15 @@ rte_crypto_op_attach_asym_session(struct rte_crypto_op *op,\n \treturn 0;\n }\n \n+/** Crypto data-path service types */\n+enum rte_crypto_dp_service {\n+\tRTE_CRYPTO_DP_SYM_CIPHER_ONLY = 0,\n+\tRTE_CRYPTO_DP_SYM_AUTH_ONLY,\n+\tRTE_CRYPTO_DP_SYM_CHAIN,\n+\tRTE_CRYPTO_DP_SYM_AEAD,\n+\tRTE_CRYPTO_DP_N_SERVICE\n+};\n+\n #ifdef __cplusplus\n }\n #endif\ndiff --git a/lib/librte_cryptodev/rte_crypto_sym.h b/lib/librte_cryptodev/rte_crypto_sym.h\nindex f29c98051..518e4111b 100644\n--- a/lib/librte_cryptodev/rte_crypto_sym.h\n+++ b/lib/librte_cryptodev/rte_crypto_sym.h\n@@ -50,6 +50,18 @@ struct rte_crypto_sgl {\n \tuint32_t num;\n };\n \n+/**\n+ * Crypto IO Data without length info.\n+ * Supposed to be used to pass input/output data buffers with lengths\n+ * defined when creating crypto session.\n+ */\n+struct rte_crypto_data {\n+\t/** virtual address of the data buffer */\n+\tvoid *base;\n+\t/** IOVA of the data buffer */\n+\trte_iova_t iova;\n+};\n+\n /**\n  * Synchronous operation descriptor.\n  * Supposed to be used with CPU crypto API call.\n@@ -57,12 +69,32 @@ struct rte_crypto_sgl {\n struct rte_crypto_sym_vec {\n \t/** array of SGL vectors */\n \tstruct rte_crypto_sgl *sgl;\n-\t/** array of pointers to IV */\n-\tvoid **iv;\n-\t/** array of pointers to AAD */\n-\tvoid **aad;\n-\t/** array of pointers to digest */\n-\tvoid **digest;\n+\n+\tunion {\n+\n+\t\t/* Supposed to be used with CPU crypto API call. */\n+\t\tstruct {\n+\t\t\t/** array of pointers to IV */\n+\t\t\tvoid **iv;\n+\t\t\t/** array of pointers to AAD */\n+\t\t\tvoid **aad;\n+\t\t\t/** array of pointers to digest */\n+\t\t\tvoid **digest;\n+\t\t};\n+\n+\t\t/* Supposed to be used with rte_cryptodev_dp_sym_submit_vec()\n+\t\t * call.\n+\t\t */\n+\t\tstruct {\n+\t\t\t/** vector to IV */\n+\t\t\tstruct rte_crypto_data *iv_vec;\n+\t\t\t/** vecor to AAD */\n+\t\t\tstruct rte_crypto_data *aad_vec;\n+\t\t\t/** vector to Digest */\n+\t\t\tstruct rte_crypto_data *digest_vec;\n+\t\t};\n+\t};\n+\n \t/**\n \t * array of statuses for each operation:\n \t *  - 0 on success\ndiff --git a/lib/librte_cryptodev/rte_cryptodev.c b/lib/librte_cryptodev/rte_cryptodev.c\nindex 1dd795bcb..8a28511f9 100644\n--- a/lib/librte_cryptodev/rte_cryptodev.c\n+++ b/lib/librte_cryptodev/rte_cryptodev.c\n@@ -1914,6 +1914,51 @@ rte_cryptodev_sym_cpu_crypto_process(uint8_t dev_id,\n \treturn dev->dev_ops->sym_cpu_process(dev, sess, ofs, vec);\n }\n \n+int\n+rte_cryptodev_get_dp_service_ctx_data_size(uint8_t dev_id)\n+{\n+\tstruct rte_cryptodev *dev;\n+\tint32_t size = sizeof(struct rte_crypto_dp_service_ctx);\n+\tint32_t priv_size;\n+\n+\tif (!rte_cryptodev_pmd_is_valid_dev(dev_id))\n+\t\treturn -1;\n+\n+\tdev = rte_cryptodev_pmd_get_dev(dev_id);\n+\n+\tif (*dev->dev_ops->get_drv_ctx_size == NULL ||\n+\t\t!(dev->feature_flags & RTE_CRYPTODEV_FF_DATA_PLANE_SERVICE)) {\n+\t\treturn -1;\n+\t}\n+\n+\tpriv_size = (*dev->dev_ops->get_drv_ctx_size)(dev);\n+\tif (priv_size < 0)\n+\t\treturn -1;\n+\n+\treturn RTE_ALIGN_CEIL((size + priv_size), 8);\n+}\n+\n+int\n+rte_cryptodev_dp_configure_service(uint8_t dev_id, uint16_t qp_id,\n+\tenum rte_crypto_dp_service service_type,\n+\tenum rte_crypto_op_sess_type sess_type,\n+\tunion rte_cryptodev_session_ctx session_ctx,\n+\tstruct rte_crypto_dp_service_ctx *ctx, uint8_t is_update)\n+{\n+\tstruct rte_cryptodev *dev;\n+\n+\tif (!rte_cryptodev_get_qp_status(dev_id, qp_id))\n+\t\treturn -1;\n+\n+\tdev = rte_cryptodev_pmd_get_dev(dev_id);\n+\tif (!(dev->feature_flags & RTE_CRYPTODEV_FF_DATA_PLANE_SERVICE)\n+\t\t\t|| dev->dev_ops->configure_service == NULL)\n+\t\treturn -1;\n+\n+\treturn (*dev->dev_ops->configure_service)(dev, qp_id, ctx,\n+\t\tservice_type, sess_type, session_ctx, is_update);\n+}\n+\n /** Initialise rte_crypto_op mempool element */\n static void\n rte_crypto_op_init(struct rte_mempool *mempool,\ndiff --git a/lib/librte_cryptodev/rte_cryptodev.h b/lib/librte_cryptodev/rte_cryptodev.h\nindex 7b3ebc20f..fdcfcbe14 100644\n--- a/lib/librte_cryptodev/rte_cryptodev.h\n+++ b/lib/librte_cryptodev/rte_cryptodev.h\n@@ -466,7 +466,8 @@ rte_cryptodev_asym_get_xform_enum(enum rte_crypto_asym_xform_type *xform_enum,\n /**< Support symmetric session-less operations */\n #define RTE_CRYPTODEV_FF_NON_BYTE_ALIGNED_DATA\t\t(1ULL << 23)\n /**< Support operations on data which is not byte aligned */\n-\n+#define RTE_CRYPTODEV_FF_DATA_PLANE_SERVICE\t\t(1ULL << 24)\n+/**< Support accelerated specific raw data as input */\n \n /**\n  * Get the name of a crypto device feature flag\n@@ -1351,6 +1352,338 @@ rte_cryptodev_sym_cpu_crypto_process(uint8_t dev_id,\n \tstruct rte_cryptodev_sym_session *sess, union rte_crypto_sym_ofs ofs,\n \tstruct rte_crypto_sym_vec *vec);\n \n+/**\n+ * Get the size of the data-path service context for all registered drivers.\n+ *\n+ * @param\tdev_id\t\tThe device identifier.\n+ *\n+ * @return\n+ *   - If the device supports data-path service, return the context size.\n+ *   - If the device does not support the data-plane service, return -1.\n+ */\n+__rte_experimental\n+int\n+rte_cryptodev_get_dp_service_ctx_data_size(uint8_t dev_id);\n+\n+/**\n+ * Union of different crypto session types, including session-less xform\n+ * pointer.\n+ */\n+union rte_cryptodev_session_ctx {\n+\tstruct rte_cryptodev_sym_session *crypto_sess;\n+\tstruct rte_crypto_sym_xform *xform;\n+\tstruct rte_security_session *sec_sess;\n+};\n+\n+/**\n+ * Submit a data vector into device queue but the driver will not start\n+ * processing until rte_cryptodev_dp_sym_submit_vec() is called.\n+ *\n+ * @param\tqp\t\tDriver specific queue pair data.\n+ * @param\tservice_data\tDriver specific service data.\n+ * @param\tvec\t\tThe array of job vectors.\n+ * @param\tofs\t\tStart and stop offsets for auth and cipher\n+ *\t\t\t\toperations.\n+ * @param\topaque\t\tThe array of opaque data for dequeue.\n+ * @return\n+ *   - The number of jobs successfully submitted.\n+ */\n+typedef uint32_t (*cryptodev_dp_sym_submit_vec_t)(\n+\tvoid *qp, uint8_t *service_data, struct rte_crypto_sym_vec *vec,\n+\tunion rte_crypto_sym_ofs ofs, void **opaque);\n+\n+/**\n+ * Submit single job into device queue but the driver will not start\n+ * processing until rte_cryptodev_dp_sym_submit_vec() is called.\n+ *\n+ * @param\tqp\t\tDriver specific queue pair data.\n+ * @param\tservice_data\tDriver specific service data.\n+ * @param\tdata\t\tThe buffer vector.\n+ * @param\tn_data_vecs\tNumber of buffer vectors.\n+ * @param\tofs\t\tStart and stop offsets for auth and cipher\n+ *\t\t\t\toperations.\n+ * @param\tiv\t\tIV data.\n+ * @param\tdigest\t\tDigest data.\n+ * @param\taad\t\tAAD data.\n+ * @param\topaque\t\tThe opaque data for dequeue.\n+ * @return\n+ *   - On success return 0.\n+ *   - On failure return negative integer.\n+ */\n+typedef int (*cryptodev_dp_submit_single_job_t)(\n+\tvoid *qp, uint8_t *service_data, struct rte_crypto_vec *data,\n+\tuint16_t n_data_vecs, union rte_crypto_sym_ofs ofs,\n+\tstruct rte_crypto_data *iv, struct rte_crypto_data *digest,\n+\tstruct rte_crypto_data *aad, void *opaque);\n+\n+/**\n+ * Inform the queue pair to start processing or finish dequeuing all\n+ * submitted/dequeued jobs.\n+ *\n+ * @param\tqp\t\tDriver specific queue pair data.\n+ * @param\tservice_data\tDriver specific service data.\n+ * @param\tn\t\tThe total number of submitted jobs.\n+ */\n+typedef void (*cryptodev_dp_sym_opeartion_done_t)(void *qp,\n+\t\tuint8_t *service_data, uint32_t n);\n+\n+/**\n+ * Typedef that the user provided for the driver to get the dequeue count.\n+ * The function may return a fixed number or the number parsed from the opaque\n+ * data stored in the first processed job.\n+ *\n+ * @param\topaque\t\tDequeued opaque data.\n+ **/\n+typedef uint32_t (*rte_cryptodev_get_dequeue_count_t)(void *opaque);\n+\n+/**\n+ * Typedef that the user provided to deal with post dequeue operation, such\n+ * as filling status.\n+ *\n+ * @param\topaque\t\tDequeued opaque data. In case\n+ *\t\t\t\tRTE_CRYPTO_HW_DP_FF_GET_OPAQUE_ARRAY bit is\n+ *\t\t\t\tset, this value will be the opaque data stored\n+ *\t\t\t\tin the specific processed jobs referenced by\n+ *\t\t\t\tindex, otherwise it will be the opaque data\n+ *\t\t\t\tstored in the first processed job in the burst.\n+ * @param\tindex\t\tIndex number of the processed job.\n+ * @param\tis_op_success\tDriver filled operation status.\n+ **/\n+typedef void (*rte_cryptodev_post_dequeue_t)(void *opaque, uint32_t index,\n+\t\tuint8_t is_op_success);\n+\n+/**\n+ * Dequeue symmetric crypto processing of user provided data.\n+ *\n+ * @param\tqp\t\t\tDriver specific queue pair data.\n+ * @param\tservice_data\t\tDriver specific service data.\n+ * @param\tget_dequeue_count\tUser provided callback function to\n+ *\t\t\t\t\tobtain dequeue count.\n+ * @param\tpost_dequeue\t\tUser provided callback function to\n+ *\t\t\t\t\tpost-process a dequeued operation.\n+ * @param\tout_opaque\t\tOpaque pointer array to be retrieve from\n+ *\t\t\t\t\tdevice queue. In case of\n+ *\t\t\t\t\t*is_opaque_array* is set there should\n+ *\t\t\t\t\tbe enough room to store all opaque data.\n+ * @param\tis_opaque_array\t\tSet 1 if every dequeued job will be\n+ *\t\t\t\t\twritten the opaque data into\n+ *\t\t\t\t\t*out_opaque* array.\n+ * @param\tn_success_jobs\t\tDriver written value to specific the\n+ *\t\t\t\t\ttotal successful operations count.\n+ *\n+ * @return\n+ *  - Returns number of dequeued packets.\n+ */\n+typedef uint32_t (*cryptodev_dp_sym_dequeue_t)(void *qp, uint8_t *service_data,\n+\trte_cryptodev_get_dequeue_count_t get_dequeue_count,\n+\trte_cryptodev_post_dequeue_t post_dequeue,\n+\tvoid **out_opaque, uint8_t is_opaque_array,\n+\tuint32_t *n_success_jobs);\n+\n+/**\n+ * Dequeue symmetric crypto processing of user provided data.\n+ *\n+ * @param\tqp\t\t\tDriver specific queue pair data.\n+ * @param\tservice_data\t\tDriver specific service data.\n+ * @param\tout_opaque\t\tOpaque pointer to be retrieve from\n+ *\t\t\t\t\tdevice queue.\n+ *\n+ * @return\n+ *   - 1 if the job is dequeued and the operation is a success.\n+ *   - 0 if the job is dequeued but the operation is failed.\n+ *   - -1 if no job is dequeued.\n+ */\n+typedef int (*cryptodev_dp_sym_dequeue_single_job_t)(\n+\t\tvoid *qp, uint8_t *service_data, void **out_opaque);\n+\n+/**\n+ * Context data for asynchronous crypto process.\n+ */\n+struct rte_crypto_dp_service_ctx {\n+\tvoid *qp_data;\n+\n+\tunion {\n+\t\t/* Supposed to be used for symmetric crypto service */\n+\t\tstruct {\n+\t\t\tcryptodev_dp_submit_single_job_t submit_single_job;\n+\t\t\tcryptodev_dp_sym_submit_vec_t submit_vec;\n+\t\t\tcryptodev_dp_sym_opeartion_done_t submit_done;\n+\t\t\tcryptodev_dp_sym_dequeue_t dequeue_opaque;\n+\t\t\tcryptodev_dp_sym_dequeue_single_job_t dequeue_single;\n+\t\t\tcryptodev_dp_sym_opeartion_done_t dequeue_done;\n+\t\t};\n+\t};\n+\n+\t/* Driver specific service data */\n+\tuint8_t drv_service_data[];\n+};\n+\n+/**\n+ * Configure one DP service context data. Calling this function for the first\n+ * time the user should unset the *is_update* parameter and the driver will\n+ * fill necessary operation data into ctx buffer. Only when\n+ * rte_cryptodev_dp_submit_done() is called the data stored in the ctx buffer\n+ * will not be effective.\n+ *\n+ * @param\tdev_id\t\tThe device identifier.\n+ * @param\tqp_id\t\tThe index of the queue pair from which to\n+ *\t\t\t\tretrieve processed packets. The value must be\n+ *\t\t\t\tin the range [0, nb_queue_pair - 1] previously\n+ *\t\t\t\tsupplied to rte_cryptodev_configure().\n+ * @param\tservice_type\tType of the service requested.\n+ * @param\tsess_type\tsession type.\n+ * @param\tsession_ctx\tSession context data.\n+ * @param\tctx\t\tThe data-path service context data.\n+ * @param\tis_update\tSet 1 if ctx is pre-initialized but need\n+ *\t\t\t\tupdate to different service type or session,\n+ *\t\t\t\tbut the rest driver data remains the same.\n+ * @return\n+ *   - On success return 0.\n+ *   - On failure return negative integer.\n+ */\n+__rte_experimental\n+int\n+rte_cryptodev_dp_configure_service(uint8_t dev_id, uint16_t qp_id,\n+\tenum rte_crypto_dp_service service_type,\n+\tenum rte_crypto_op_sess_type sess_type,\n+\tunion rte_cryptodev_session_ctx session_ctx,\n+\tstruct rte_crypto_dp_service_ctx *ctx, uint8_t is_update);\n+\n+/**\n+ * Submit single job into device queue but the driver will not start\n+ * processing until rte_cryptodev_dp_sym_submit_vec() is called.\n+ *\n+ * @param\tctx\t\tThe initialized data-path service context data.\n+ * @param\tdata\t\tThe buffer vector.\n+ * @param\tn_data_vecs\tNumber of buffer vectors.\n+ * @param\tofs\t\tStart and stop offsets for auth and cipher\n+ *\t\t\t\toperations.\n+ * @param\tiv\t\tIV data.\n+ * @param\tdigest\t\tDigest data.\n+ * @param\taad\t\tAAD data.\n+ * @param\topaque\t\tThe array of opaque data for dequeue.\n+ * @return\n+ *   - On success return 0.\n+ *   - On failure return negative integer.\n+ */\n+__rte_experimental\n+static __rte_always_inline int\n+rte_cryptodev_dp_submit_single_job(struct rte_crypto_dp_service_ctx *ctx,\n+\t\tstruct rte_crypto_vec *data, uint16_t n_data_vecs,\n+\t\tunion rte_crypto_sym_ofs ofs,\n+\t\tstruct rte_crypto_data *iv, struct rte_crypto_data *digest,\n+\t\tstruct rte_crypto_data *aad, void *opaque)\n+{\n+\treturn (*ctx->submit_single_job)(ctx->qp_data, ctx->drv_service_data,\n+\t\tdata, n_data_vecs, ofs, iv, digest, aad, opaque);\n+}\n+\n+/**\n+ * Submit a data vector into device queue but the driver will not start\n+ * processing until rte_cryptodev_dp_sym_submit_vec() is called.\n+ *\n+ * @param\tctx\tThe initialized data-path service context data.\n+ * @param\tvec\tThe array of job vectors.\n+ * @param\tofs\tStart and stop offsets for auth and cipher operations.\n+ * @param\topaque\tThe array of opaque data for dequeue.\n+ * @return\n+ *   - The number of jobs successfully submitted.\n+ */\n+__rte_experimental\n+static __rte_always_inline uint32_t\n+rte_cryptodev_dp_sym_submit_vec(struct rte_crypto_dp_service_ctx *ctx,\n+\tstruct rte_crypto_sym_vec *vec, union rte_crypto_sym_ofs ofs,\n+\tvoid **opaque)\n+{\n+\treturn (*ctx->submit_vec)(ctx->qp_data, ctx->drv_service_data, vec,\n+\t\t\tofs, opaque);\n+}\n+\n+/**\n+ * Command the queue pair to start processing all submitted jobs from last\n+ * rte_cryptodev_init_dp_service() call.\n+ *\n+ * @param\tctx\tThe initialized data-path service context data.\n+ * @param\tn\t\tThe total number of submitted jobs.\n+ */\n+__rte_experimental\n+static __rte_always_inline void\n+rte_cryptodev_dp_submit_done(struct rte_crypto_dp_service_ctx *ctx, uint32_t n)\n+{\n+\t(*ctx->submit_done)(ctx->qp_data, ctx->drv_service_data, n);\n+}\n+\n+/**\n+ * Dequeue symmetric crypto processing of user provided data.\n+ *\n+ * @param\tctx\t\t\tThe initialized data-path service\n+ *\t\t\t\t\tcontext data.\n+ * @param\tget_dequeue_count\tUser provided callback function to\n+ *\t\t\t\t\tobtain dequeue count.\n+ * @param\tpost_dequeue\t\tUser provided callback function to\n+ *\t\t\t\t\tpost-process a dequeued operation.\n+ * @param\tout_opaque\t\tOpaque pointer array to be retrieve from\n+ *\t\t\t\t\tdevice queue. In case of\n+ *\t\t\t\t\t*is_opaque_array* is set there should\n+ *\t\t\t\t\tbe enough room to store all opaque data.\n+ * @param\tis_opaque_array\t\tSet 1 if every dequeued job will be\n+ *\t\t\t\t\twritten the opaque data into\n+ *\t\t\t\t\t*out_opaque* array.\n+ * @param\tn_success_jobs\t\tDriver written value to specific the\n+ *\t\t\t\t\ttotal successful operations count.\n+ *\n+ * @return\n+ *   - Returns number of dequeued packets.\n+ */\n+__rte_experimental\n+static __rte_always_inline uint32_t\n+rte_cryptodev_dp_sym_dequeue(struct rte_crypto_dp_service_ctx *ctx,\n+\trte_cryptodev_get_dequeue_count_t get_dequeue_count,\n+\trte_cryptodev_post_dequeue_t post_dequeue,\n+\tvoid **out_opaque, uint8_t is_opaque_array,\n+\tuint32_t *n_success_jobs)\n+{\n+\treturn (*ctx->dequeue_opaque)(ctx->qp_data, ctx->drv_service_data,\n+\t\tget_dequeue_count, post_dequeue, out_opaque, is_opaque_array,\n+\t\tn_success_jobs);\n+}\n+\n+/**\n+ * Dequeue Single symmetric crypto processing of user provided data.\n+ *\n+ * @param\tctx\t\t\tThe initialized data-path service\n+ *\t\t\t\t\tcontext data.\n+ * @param\tout_opaque\t\tOpaque pointer to be retrieve from\n+ *\t\t\t\t\tdevice queue. The driver shall support\n+ *\t\t\t\t\tNULL input of this parameter.\n+ *\n+ * @return\n+ *   - 1 if the job is dequeued and the operation is a success.\n+ *   - 0 if the job is dequeued but the operation is failed.\n+ *   - -1 if no job is dequeued.\n+ */\n+__rte_experimental\n+static __rte_always_inline int\n+rte_cryptodev_dp_sym_dequeue_single_job(struct rte_crypto_dp_service_ctx *ctx,\n+\t\tvoid **out_opaque)\n+{\n+\treturn (*ctx->dequeue_single)(ctx->qp_data, ctx->drv_service_data,\n+\t\tout_opaque);\n+}\n+\n+/**\n+ * Inform the queue pair dequeue jobs finished.\n+ *\n+ * @param\tctx\tThe initialized data-path service context data.\n+ * @param\tn\tThe total number of jobs already dequeued.\n+ */\n+__rte_experimental\n+static __rte_always_inline void\n+rte_cryptodev_dp_dequeue_done(struct rte_crypto_dp_service_ctx *ctx, uint32_t n)\n+{\n+\t(*ctx->dequeue_done)(ctx->qp_data, ctx->drv_service_data, n);\n+}\n+\n #ifdef __cplusplus\n }\n #endif\ndiff --git a/lib/librte_cryptodev/rte_cryptodev_pmd.h b/lib/librte_cryptodev/rte_cryptodev_pmd.h\nindex 81975d72b..bf0260c87 100644\n--- a/lib/librte_cryptodev/rte_cryptodev_pmd.h\n+++ b/lib/librte_cryptodev/rte_cryptodev_pmd.h\n@@ -316,6 +316,41 @@ typedef uint32_t (*cryptodev_sym_cpu_crypto_process_t)\n \t(struct rte_cryptodev *dev, struct rte_cryptodev_sym_session *sess,\n \tunion rte_crypto_sym_ofs ofs, struct rte_crypto_sym_vec *vec);\n \n+/**\n+ * Typedef that the driver provided to get service context private date size.\n+ *\n+ * @param\tdev\tCrypto device pointer.\n+ *\n+ * @return\n+ *   - On success return the size of the device's service context private data.\n+ *   - On failure return negative integer.\n+ */\n+typedef int (*cryptodev_dp_get_service_ctx_size_t)(\n+\tstruct rte_cryptodev *dev);\n+\n+/**\n+ * Typedef that the driver provided to configure data-path service.\n+ *\n+ * @param\tdev\t\tCrypto device pointer.\n+ * @param\tqp_id\t\tCrypto device queue pair index.\n+ * @param\tctx\t\tThe data-path service context data.\n+ * @param\tservice_type\tType of the service requested.\n+ * @param\tsess_type\tsession type.\n+ * @param\tsession_ctx\tSession context data.\n+ * @param\tis_update\tSet 1 if ctx is pre-initialized but need\n+ *\t\t\t\tupdate to different service type or session,\n+ *\t\t\t\tbut the rest driver data remains the same.\n+ *\t\t\t\tbuffer will always be one.\n+ * @return\n+ *   - On success return 0.\n+ *   - On failure return negative integer.\n+ */\n+typedef int (*cryptodev_dp_configure_service_t)(\n+\tstruct rte_cryptodev *dev, uint16_t qp_id,\n+\tstruct rte_crypto_dp_service_ctx *ctx,\n+\tenum rte_crypto_dp_service service_type,\n+\tenum rte_crypto_op_sess_type sess_type,\n+\tunion rte_cryptodev_session_ctx session_ctx, uint8_t is_update);\n \n /** Crypto device operations function pointer table */\n struct rte_cryptodev_ops {\n@@ -348,8 +383,16 @@ struct rte_cryptodev_ops {\n \t/**< Clear a Crypto sessions private data. */\n \tcryptodev_asym_free_session_t asym_session_clear;\n \t/**< Clear a Crypto sessions private data. */\n-\tcryptodev_sym_cpu_crypto_process_t sym_cpu_process;\n-\t/**< process input data synchronously (cpu-crypto). */\n+\tunion {\n+\t\tcryptodev_sym_cpu_crypto_process_t sym_cpu_process;\n+\t\t/**< process input data synchronously (cpu-crypto). */\n+\t\tstruct {\n+\t\t\tcryptodev_dp_get_service_ctx_size_t get_drv_ctx_size;\n+\t\t\t/**< Get data path service context data size. */\n+\t\t\tcryptodev_dp_configure_service_t configure_service;\n+\t\t\t/**< Initialize crypto service ctx data. */\n+\t\t};\n+\t};\n };\n \n \ndiff --git a/lib/librte_cryptodev/rte_cryptodev_version.map b/lib/librte_cryptodev/rte_cryptodev_version.map\nindex 02f6dcf72..d384382d3 100644\n--- a/lib/librte_cryptodev/rte_cryptodev_version.map\n+++ b/lib/librte_cryptodev/rte_cryptodev_version.map\n@@ -105,4 +105,14 @@ EXPERIMENTAL {\n \n \t# added in 20.08\n \trte_cryptodev_get_qp_status;\n+\n+\t# added in 20.11\n+\trte_cryptodev_dp_configure_service;\n+\trte_cryptodev_get_dp_service_ctx_data_size;\n+\trte_cryptodev_dp_submit_single_job;\n+\trte_cryptodev_dp_sym_submit_vec;\n+\trte_cryptodev_dp_submit_done;\n+\trte_cryptodev_dp_sym_dequeue;\n+\trte_cryptodev_dp_sym_dequeue_single_job;\n+\trte_cryptodev_dp_dequeue_done;\n };\n",
    "prefixes": [
        "v6",
        "1/4"
    ]
}