DPDK patches and discussions
 help / color / mirror / Atom feed
From: Akhil Goyal <akhil.goyal@nxp.com>
To: Fan Zhang <roy.fan.zhang@intel.com>, "dev@dpdk.org" <dev@dpdk.org>
Cc: Piotr Bronowski <piotrx.bronowski@intel.com>,
	Adam Dybkowski <adamx.dybkowski@intel.com>,
	"Ananyev, Konstantin" <konstantin.ananyev@intel.com>
Subject: Re: [dpdk-dev] [dpdk-dev v11 2/4] cryptodev: add raw crypto data-path APIs
Date: Sat, 10 Oct 2020 19:38:39 +0000	[thread overview]
Message-ID: <AM5PR04MB31535F0F6F3FB63C96B426C7E6090@AM5PR04MB3153.eurprd04.prod.outlook.com> (raw)
In-Reply-To: <20201009211141.14435-3-roy.fan.zhang@intel.com>

Hi Fan,
> 
> This patch adds raw data-path APIs for enqueue and dequeue
> operations to cryptodev. The APIs support flexible user-define
> enqueue and dequeue behaviors.
> 
> Signed-off-by: Fan Zhang <roy.fan.zhang@intel.com>
> Signed-off-by: Piotr Bronowski <piotrx.bronowski@intel.com>
> Acked-by: Adam Dybkowski <adamx.dybkowski@intel.com>
> ---
>  doc/guides/cryptodevs/features/default.ini    |   1 +
>  doc/guides/cryptodevs/features/qat.ini        |   1 +
>  doc/guides/prog_guide/cryptodev_lib.rst       |  97 +++++
>  doc/guides/rel_notes/release_20_11.rst        |   7 +
>  lib/librte_cryptodev/rte_cryptodev.c          |  80 ++++
>  lib/librte_cryptodev/rte_cryptodev.h          | 367 +++++++++++++++++-
>  lib/librte_cryptodev/rte_cryptodev_pmd.h      |  51 ++-
>  .../rte_cryptodev_version.map                 |  10 +
>  8 files changed, 611 insertions(+), 3 deletions(-)
> 

The release notes should be updated just above aesni_mb crypto PMD updates

+* **Added raw data-path APIs for cryptodev library.**
+
+  Cryptodev is added with raw data-path APIs to accelerate external
+  libraries or applications which need to avail fast cryptodev
+  enqueue/dequeue operations but does not necessarily depends on
+  mbufs and cryptodev operation mempools.
+

I have following diff which should be incorporated in this patch.
Qat.ini file should be updated in the 3/4 patch.
Release notes update is also missing for QAT.

diff --git a/doc/guides/cryptodevs/features/qat.ini b/doc/guides/cryptodevs/features/qat.ini
index 9e82f2886..6cc09cde7 100644
--- a/doc/guides/cryptodevs/features/qat.ini
+++ b/doc/guides/cryptodevs/features/qat.ini
@@ -17,6 +17,7 @@ Digest encrypted       = Y
 Asymmetric sessionless = Y
 RSA PRIV OP KEY EXP    = Y
 RSA PRIV OP KEY QT     = Y
-Sym raw data path API  = Y

 ;
 ; Supported crypto algorithms of the 'qat' crypto driver.
diff --git a/doc/guides/prog_guide/cryptodev_lib.rst b/doc/guides/prog_guide/cryptodev_lib.rst
index 8ba800122..7fb3022bd 100644
--- a/doc/guides/prog_guide/cryptodev_lib.rst
+++ b/doc/guides/prog_guide/cryptodev_lib.rst
@@ -696,9 +696,9 @@ the status buffer provided by the user):
   are stored. The crypto device will then start enqueuing all of them at
   once.

-Calling ``rte_cryptodev_configure_raw_dp_context`` with the parameter
+Calling ``rte_cryptodev_configure_raw_dp_ctx`` with the parameter
 ``is_update`` set as 0 twice without the enqueue function returning status 1 or
-``rte_cryptodev_dp_enqueue_done`` function call in between will invalidate any
+``rte_cryptodev_raw_enqueue_done`` function call in between will invalidate any
 descriptors stored in the device queue but not enqueued. This feature is useful
 when the user wants to abandon partially enqueued data for a failed enqueue
 burst operation and try enqueuing in a whole later.
diff --git a/lib/librte_cryptodev/rte_cryptodev.c b/lib/librte_cryptodev/rte_cryptodev.c
index 7a143c4b9..3d95ac6ea 100644
--- a/lib/librte_cryptodev/rte_cryptodev.c
+++ b/lib/librte_cryptodev/rte_cryptodev.c
@@ -1833,13 +1833,6 @@ rte_cryptodev_raw_enqueue_done(struct rte_crypto_raw_dp_ctx *ctx,
        return (*ctx->enqueue_done)(ctx->qp_data, ctx->drv_ctx_data, n);
 }

-int
-rte_cryptodev_raw_dequeue_done(struct rte_crypto_raw_dp_ctx *ctx,
-               uint32_t n)
-{
-       return (*ctx->dequeue_done)(ctx->qp_data, ctx->drv_ctx_data, n);
-}
-
 uint32_t
 rte_cryptodev_raw_dequeue_burst(struct rte_crypto_raw_dp_ctx *ctx,
        rte_cryptodev_raw_get_dequeue_count_t get_dequeue_count,
@@ -1852,6 +1845,13 @@ rte_cryptodev_raw_dequeue_burst(struct rte_crypto_raw_dp_ctx *ctx,
                is_user_data_array, n_success_jobs, status);
 }

+int
+rte_cryptodev_raw_dequeue_done(struct rte_crypto_raw_dp_ctx *ctx,
+               uint32_t n)
+{
+       return (*ctx->dequeue_done)(ctx->qp_data, ctx->drv_ctx_data, n);
+}
+
 /** Initialise rte_crypto_op mempool element */
 static void
 rte_crypto_op_init(struct rte_mempool *mempool,
diff --git a/lib/librte_cryptodev/rte_cryptodev.h b/lib/librte_cryptodev/rte_cryptodev.h
index 840a1c54c..79cfa46c8 100644
--- a/lib/librte_cryptodev/rte_cryptodev.h
+++ b/lib/librte_cryptodev/rte_cryptodev.h
@@ -459,7 +459,7 @@ rte_cryptodev_asym_get_xform_enum(enum rte_crypto_asym_xform_type *xform_enum,
 #define RTE_CRYPTODEV_FF_NON_BYTE_ALIGNED_DATA         (1ULL << 23)
 /**< Support operations on data which is not byte aligned */
 #define RTE_CRYPTODEV_FF_SYM_RAW_DP                    (1ULL << 24)
-/**< Support accelerated specific raw data-path APIs */
+/**< Support accelerator specific symmetric raw data-path APIs */

 /**
  * Get the name of a crypto device feature flag
@@ -1344,7 +1344,7 @@ union rte_cryptodev_session_ctx {
 };

 /**
- * Enqueue a data vector into device queue but the driver will not start
+ * Enqueue a data vector into device queue but the driver may or may not start
  * processing until rte_cryptodev_raw_enqueue_done() is called.
  *
  * @param      qp              Driver specific queue pair data.
@@ -1357,7 +1357,7 @@ union rte_cryptodev_session_ctx {
  * @return
  *   - The number of descriptors successfully enqueued.
  *   - Possible enqueue status written by the driver:
- *     - 1: The descriptors are enqueued successfully.
+ *     - positive integer: number of descriptors enqueued successfully.
  *     - 0: The descriptors are stored into device queue but are not processed
  *          until rte_cryptodev_raw_enqueue_done() is called.
  *     - negative integer: failure.
@@ -1451,7 +1451,7 @@ typedef void (*rte_cryptodev_raw_post_dequeue_t)(void *user_data,
  * @return
  *   - The number of descriptors successfully dequeued.
  *   - Possible dequeue status written by the driver:
- *     - 1: The descriptors are dequeued successfully.
+ *     - positive integer: Number of descriptors dequeued successfully.
  *     - 0: The descriptors are fetched from queue pair but are not freed
  *          until rte_cryptodev_raw_dequeue_done() is called.
  *     - negative integer: Error occurred when dequeuing.
@@ -1475,8 +1475,8 @@ typedef uint32_t (*cryptodev_sym_raw_dequeue_burst_t)(void *qp,
  *   - The user data pointer retrieved from device queue or NULL if no
  *     descriptor is ready for dequeue.
  *   - Possible dequeue status written by the driver:
- *     - 1: The descriptors are dequeued successfully.
- *     - 0: The descriptors are fetched from queue pair but are not freed
+ *     - 1: The descriptor is dequeued successfully.
+ *     - 0: The descriptor is fetched from queue pair but is not freed
  *          until rte_cryptodev_raw_dequeue_done() is called.
  *     - negative integer: Error occurred when dequeuing.
  */
@@ -1487,7 +1487,7 @@ typedef void * (*cryptodev_sym_raw_dequeue_t)(
 /**
  * Context data for raw data-path API crypto process. The buffer of this
  * structure is to be allocated by the user application with the size equal
- * or bigger than rte_cryptodev_raw_get_dp_context_size() returned value.
+ * or bigger than rte_cryptodev_get_raw_dp_ctx_size() returned value.
  *
  * NOTE: the buffer is to be used and maintained by the cryptodev driver, the
  * user should NOT alter the buffer content to avoid application or system
@@ -1510,11 +1510,6 @@ struct rte_crypto_raw_dp_ctx {
 /**
  * Configure raw data-path context data.
  *
- * NOTE:
- * After the context data is configured, the user should call
- * rte_cryptodev_raw_attach_session() before using it in
- * rte_cryptodev_raw_enqueue/dequeue function call.
- *
  * @param      dev_id          The device identifier.
  * @param      qp_id           The index of the queue pair from which to
  *                             retrieve processed packets. The value must be
@@ -1596,7 +1591,7 @@ rte_cryptodev_raw_enqueue_burst(struct rte_crypto_raw_dp_ctx *ctx,

 /**
  * Start processing all enqueued descriptors from last
- * rte_cryptodev_raw_configure_dp_context() call.
+ * rte_cryptodev_configure_raw_dp_ctx() call.
  *
  * @param      ctx     The initialized raw data-path context data.
  * @param      n       The total number of submitted descriptors.
@@ -1656,8 +1651,8 @@ rte_cryptodev_raw_dequeue_burst(struct rte_crypto_raw_dp_ctx *ctx,
  *   - The user data pointer retrieved from device queue or NULL if no
  *     descriptor is ready for dequeue.
  *   - Possible dequeue status written by the driver:
- *     - 1: The descriptors are dequeued successfully.
- *     - 0: The descriptors are fetched from queue pair but are not freed
+ *     - 1: The descriptor is dequeued successfully.
+ *     - 0: The descriptor is fetched from queue pair but is not freed
  *          until rte_cryptodev_raw_dequeue_done() is called.
  *     - negative integer: Error occurred when dequeuing.
  */
diff --git a/lib/librte_cryptodev/rte_cryptodev_pmd.h b/lib/librte_cryptodev/rte_cryptodev_pmd.h
index d6be69903..ea8694ca5 100644
--- a/lib/librte_cryptodev/rte_cryptodev_pmd.h
+++ b/lib/librte_cryptodev/rte_cryptodev_pmd.h
@@ -329,7 +329,7 @@ typedef uint32_t (*cryptodev_sym_cpu_crypto_process_t)
 typedef int (*cryptodev_sym_get_raw_dp_ctx_size_t)(struct rte_cryptodev *dev);

 /**
- * Typedef that the driver provided to configure data-path context.
+ * Typedef that the driver provided to configure raw data-path context.
  *
  * @param      dev             Crypto device pointer.
  * @param      qp_id           Crypto device queue pair index.
@@ -392,10 +392,10 @@ struct rte_cryptodev_ops {
                struct {
                        cryptodev_sym_get_raw_dp_ctx_size_t
                                sym_get_raw_dp_ctx_size;
-                       /**< Get data path service context data size. */
+                       /**< Get raw data path context data size. */
                        cryptodev_sym_configure_raw_dp_ctx_t
                                sym_configure_raw_dp_ctx;
-                       /**< Initialize crypto service ctx data. */
+                       /**< Configure raw data path ctx data. */
                };
        };
 };

  reply	other threads:[~2020-10-10 19:38 UTC|newest]

Thread overview: 84+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-18 16:28 [dpdk-dev] [dpdk-dev v6 0/4] cryptodev: add data-path service APIs Fan Zhang
2020-08-18 16:28 ` [dpdk-dev] [dpdk-dev v6 1/4] cryptodev: add crypto " Fan Zhang
2020-08-18 16:28 ` [dpdk-dev] [dpdk-dev v6 2/4] crypto/qat: add crypto data-path service API support Fan Zhang
2020-08-18 16:28 ` [dpdk-dev] [dpdk-dev v6 3/4] test/crypto: add unit-test for cryptodev direct APIs Fan Zhang
2020-08-18 16:28 ` [dpdk-dev] [dpdk-dev v6 4/4] doc: add cryptodev service APIs guide Fan Zhang
2020-08-28 12:58 ` [dpdk-dev] [dpdk-dev v7 0/4] cryptodev: add data-path service APIs Fan Zhang
2020-08-28 12:58   ` [dpdk-dev] [dpdk-dev v7 1/4] cryptodev: add crypto " Fan Zhang
2020-08-31  6:23     ` Kusztal, ArkadiuszX
2020-08-31 12:21       ` Zhang, Roy Fan
2020-08-31 15:15       ` Zhang, Roy Fan
2020-08-28 12:58   ` [dpdk-dev] [dpdk-dev v7 2/4] crypto/qat: add crypto data-path service API support Fan Zhang
2020-08-28 12:58   ` [dpdk-dev] [dpdk-dev v7 3/4] test/crypto: add unit-test for cryptodev direct APIs Fan Zhang
2020-08-28 12:58   ` [dpdk-dev] [dpdk-dev v7 4/4] doc: add cryptodev service APIs guide Fan Zhang
2020-09-04 15:25   ` [dpdk-dev] [dpdk-dev v8 0/4] cryptodev: add data-path service APIs Fan Zhang
2020-09-04 15:25     ` [dpdk-dev] [dpdk-dev v8 1/4] cryptodev: add crypto " Fan Zhang
2020-09-07 12:36       ` Dybkowski, AdamX
2020-09-04 15:25     ` [dpdk-dev] [dpdk-dev v8 2/4] crypto/qat: add crypto data-path service API support Fan Zhang
2020-09-04 15:25     ` [dpdk-dev] [dpdk-dev v8 3/4] test/crypto: add unit-test for cryptodev direct APIs Fan Zhang
2020-09-04 15:25     ` [dpdk-dev] [dpdk-dev v8 4/4] doc: add cryptodev service APIs guide Fan Zhang
2020-09-08  8:42     ` [dpdk-dev] [dpdk-dev v9 0/4] cryptodev: add data-path service APIs Fan Zhang
2020-09-08  8:42       ` [dpdk-dev] [dpdk-dev v9 1/4] cryptodev: add crypto " Fan Zhang
2020-09-18 21:50         ` Akhil Goyal
2020-09-21 10:40           ` Zhang, Roy Fan
2020-09-21 11:59             ` Akhil Goyal
2020-09-21 15:26               ` Zhang, Roy Fan
2020-09-21 15:41               ` Zhang, Roy Fan
2020-09-21 15:49                 ` Akhil Goyal
2020-09-22  8:08                   ` Zhang, Roy Fan
2020-09-22  8:21                   ` Zhang, Roy Fan
2020-09-22  8:48                     ` Ananyev, Konstantin
2020-09-22  9:05                       ` Akhil Goyal
2020-09-22  9:28                         ` Zhang, Roy Fan
2020-09-22 10:18                           ` Ananyev, Konstantin
2020-09-22 12:15                             ` Zhang, Roy Fan
2020-09-22 12:50                             ` Zhang, Roy Fan
2020-09-22 12:52                               ` Akhil Goyal
2020-09-08  8:42       ` [dpdk-dev] [dpdk-dev v9 2/4] crypto/qat: add crypto data-path service API support Fan Zhang
2020-09-08  8:42       ` [dpdk-dev] [dpdk-dev v9 3/4] test/crypto: add unit-test for cryptodev direct APIs Fan Zhang
2020-09-18 20:03         ` Akhil Goyal
2020-09-21 12:41           ` Zhang, Roy Fan
2020-09-08  8:42       ` [dpdk-dev] [dpdk-dev v9 4/4] doc: add cryptodev service APIs guide Fan Zhang
2020-09-18 20:39         ` Akhil Goyal
2020-09-21 12:28           ` Zhang, Roy Fan
2020-09-23 13:37           ` Zhang, Roy Fan
2020-09-24 16:34       ` [dpdk-dev] [dpdk-dev v10 0/4] cryptodev: add raw data-path APIs Fan Zhang
2020-09-24 16:34         ` [dpdk-dev] [dpdk-dev v10 1/4] cryptodev: change crypto symmetric vector structure Fan Zhang
2020-09-25  8:03           ` Dybkowski, AdamX
2020-09-28 17:01           ` Ananyev, Konstantin
2020-09-24 16:34         ` [dpdk-dev] [dpdk-dev v10 2/4] cryptodev: add raw crypto data-path APIs Fan Zhang
2020-09-25  8:04           ` Dybkowski, AdamX
2020-10-08 14:26           ` Akhil Goyal
2020-10-08 15:29             ` Zhang, Roy Fan
2020-10-08 16:07               ` Akhil Goyal
2020-10-08 16:24                 ` Zhang, Roy Fan
2020-10-09  8:32                 ` Zhang, Roy Fan
2020-10-08 14:37           ` Akhil Goyal
2020-09-24 16:34         ` [dpdk-dev] [dpdk-dev v10 3/4] crypto/qat: add raw crypto data-path API support Fan Zhang
2020-09-25  8:04           ` Dybkowski, AdamX
2020-09-24 16:34         ` [dpdk-dev] [dpdk-dev v10 4/4] test/crypto: add unit-test for cryptodev raw API test Fan Zhang
2020-09-25  8:05           ` Dybkowski, AdamX
2020-10-08 15:01           ` Akhil Goyal
2020-10-08 15:04         ` [dpdk-dev] [dpdk-dev v10 0/4] cryptodev: add raw data-path APIs Akhil Goyal
2020-10-08 15:30           ` Zhang, Roy Fan
2020-10-09 21:11         ` [dpdk-dev] [dpdk-dev v11 " Fan Zhang
2020-10-09 21:11           ` [dpdk-dev] [dpdk-dev v11 1/4] cryptodev: change crypto symmetric vector structure Fan Zhang
2020-10-09 21:11           ` [dpdk-dev] [dpdk-dev v11 2/4] cryptodev: add raw crypto data-path APIs Fan Zhang
2020-10-10 19:38             ` Akhil Goyal [this message]
2020-10-10 20:40               ` Zhang, Roy Fan
2020-10-09 21:11           ` [dpdk-dev] [dpdk-dev v11 3/4] crypto/qat: add raw crypto data-path API support Fan Zhang
2020-10-09 21:11           ` [dpdk-dev] [dpdk-dev v11 4/4] test/crypto: add unit-test for cryptodev raw API test Fan Zhang
2020-10-10 19:55             ` Akhil Goyal
2020-10-10 20:50               ` Zhang, Roy Fan
2020-10-10 21:03                 ` Akhil Goyal
2020-10-11  0:32           ` [dpdk-dev] [dpdk-dev v12 0/4] cryptodev: add raw data-path APIs Fan Zhang
2020-10-11  0:32             ` [dpdk-dev] [dpdk-dev v12 1/4] cryptodev: change crypto symmetric vector structure Fan Zhang
2020-10-11  0:32             ` [dpdk-dev] [dpdk-dev v12 2/4] cryptodev: add raw crypto data-path APIs Fan Zhang
2020-10-11  0:32             ` [dpdk-dev] [dpdk-dev v12 3/4] crypto/qat: add raw crypto data-path API support Fan Zhang
2020-10-11  0:32             ` [dpdk-dev] [dpdk-dev v12 4/4] test/crypto: add unit-test for cryptodev raw API test Fan Zhang
2020-10-11  0:38             ` [dpdk-dev] [dpdk-dev v13 0/4] cryptodev: add raw data-path APIs Fan Zhang
2020-10-11  0:38               ` [dpdk-dev] [dpdk-dev v13 1/4] cryptodev: change crypto symmetric vector structure Fan Zhang
2020-10-11  0:38               ` [dpdk-dev] [dpdk-dev v13 2/4] cryptodev: add raw crypto data-path APIs Fan Zhang
2020-10-11  0:38               ` [dpdk-dev] [dpdk-dev v13 3/4] crypto/qat: add raw crypto data-path API support Fan Zhang
2020-10-11  0:38               ` [dpdk-dev] [dpdk-dev v13 4/4] test/crypto: add unit-test for cryptodev raw API test Fan Zhang
2020-10-12 16:15               ` [dpdk-dev] [dpdk-dev v13 0/4] cryptodev: add raw data-path APIs Akhil Goyal

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=AM5PR04MB31535F0F6F3FB63C96B426C7E6090@AM5PR04MB3153.eurprd04.prod.outlook.com \
    --to=akhil.goyal@nxp.com \
    --cc=adamx.dybkowski@intel.com \
    --cc=dev@dpdk.org \
    --cc=konstantin.ananyev@intel.com \
    --cc=piotrx.bronowski@intel.com \
    --cc=roy.fan.zhang@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).