patch 'doc: fix code blocks in cryptodev guide' has been queued to stable release 22.11.2

Xueming Li xuemingl at nvidia.com
Sun Apr 9 17:25:22 CEST 2023


Hi,

FYI, your patch has been queued to stable release 22.11.2

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 04/11/23. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=22.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/log/?h=22.11-staging/commit/95c2df95d259bd8c8429fc196a6cba508cbc2be7

Thanks.

Xueming Li <xuemingl at nvidia.com>

---
>From 95c2df95d259bd8c8429fc196a6cba508cbc2be7 Mon Sep 17 00:00:00 2001
From: Akhil Goyal <gakhil at marvell.com>
Date: Tue, 21 Mar 2023 18:35:27 +0530
Subject: [PATCH] doc: fix code blocks in cryptodev guide
Cc: Xueming Li <xuemingl at nvidia.com>

[ upstream commit d2d7f0190bce57b2a07942e7c11a1e77a9c029ca ]

Certain structures were replicated in programmer's guide,
which resulted in mismatch when that structure is changed
in future releases.
Added literal includes to copy code block while compiling.

Fixes: 0318c02b57cf ("doc: add cryptodev chapter in prog guide")

Reported-by: David Marchand <david.marchand at redhat.com>
Signed-off-by: Akhil Goyal <gakhil at marvell.com>
Acked-by: Ciara Power <ciara.power at intel.com>
Acked-by: Hemant Agrawal <hemant.agrawal at nxp.com>
---
 doc/guides/prog_guide/cryptodev_lib.rst | 121 ++++--------------------
 lib/cryptodev/rte_crypto_sym.h          |   4 +
 lib/cryptodev/rte_cryptodev.h           |   6 ++
 3 files changed, 31 insertions(+), 100 deletions(-)

diff --git a/doc/guides/prog_guide/cryptodev_lib.rst b/doc/guides/prog_guide/cryptodev_lib.rst
index 0d9f7059ea..2b513bbf82 100644
--- a/doc/guides/prog_guide/cryptodev_lib.rst
+++ b/doc/guides/prog_guide/cryptodev_lib.rst
@@ -98,14 +98,10 @@ The rte_cryptodev_configure API is used to configure a Crypto device.
 The ``rte_cryptodev_config`` structure is used to pass the configuration
 parameters for socket selection and number of queue pairs.
 
-.. code-block:: c
-
-    struct rte_cryptodev_config {
-        int socket_id;
-        /**< Socket to allocate resources on */
-        uint16_t nb_queue_pairs;
-        /**< Number of queue pairs to configure on device */
-    };
+.. literalinclude:: ../../../lib/cryptodev/rte_cryptodev.h
+   :language: c
+   :start-after: Structure rte_cryptodev_config 8<
+   :end-before: >8 End of structure rte_cryptodev_config.
 
 
 Configuration of Queue Pairs
@@ -121,11 +117,11 @@ Each queue pairs resources may be allocated on a specified socket.
                 const struct rte_cryptodev_qp_conf *qp_conf,
                 int socket_id)
 
-   struct rte_cryptodev_qp_conf {
-        uint32_t nb_descriptors; /**< Number of descriptors per queue pair */
-        struct rte_mempool *mp_session;
-        /**< The mempool for creating session in sessionless mode */
-    };
+
+.. literalinclude:: ../../../lib/cryptodev/rte_cryptodev.h
+   :language: c
+   :start-after: Structure rte_cryptodev_qp_conf 8<
+   :end-before: >8 End of structure rte_cryptodev_qp_conf.
 
 
 The field ``mp_session`` is used for creating temporary session to process
@@ -271,23 +267,10 @@ This allows the user to query a specific Crypto PMD and get all the device
 features and capabilities. The ``rte_cryptodev_info`` structure contains all the
 relevant information for the device.
 
-.. code-block:: c
-
-    struct rte_cryptodev_info {
-        const char *driver_name;
-        uint8_t driver_id;
-        struct rte_device *device;
-
-        uint64_t feature_flags;
-
-        const struct rte_cryptodev_capabilities *capabilities;
-
-        unsigned max_nb_queue_pairs;
-
-        struct {
-            unsigned max_nb_sessions;
-        } sym;
-    };
+.. literalinclude:: ../../../lib/cryptodev/rte_cryptodev.h
+   :language: c
+   :start-after: Structure rte_cryptodev_info 8<
+   :end-before: >8 End of structure rte_cryptodev_info.
 
 
 Operation Processing
@@ -540,22 +523,10 @@ Currently there are three transforms types cipher, authentication and AEAD.
 Also it is important to note that the order in which the
 transforms are passed indicates the order of the chaining.
 
-.. code-block:: c
-
-    struct rte_crypto_sym_xform {
-        struct rte_crypto_sym_xform *next;
-        /**< next xform in chain */
-        enum rte_crypto_sym_xform_type type;
-        /**< xform type */
-        union {
-            struct rte_crypto_auth_xform auth;
-            /**< Authentication / hash xform */
-            struct rte_crypto_cipher_xform cipher;
-            /**< Cipher xform */
-            struct rte_crypto_aead_xform aead;
-            /**< AEAD xform */
-        };
-    };
+.. literalinclude:: ../../../lib/cryptodev/rte_crypto_sym.h
+   :language: c
+   :start-after: Structure rte_crypto_sym_xform 8<
+   :end-before: >8 End of structure rte_crypto_sym_xform.
 
 The API does not place a limit on the number of transforms that can be chained
 together but this will be limited by the underlying Crypto device poll mode
@@ -578,61 +549,11 @@ authentication/ cipher/ AEAD parameters required depending on the type of operat
 specified in the session or the transform
 chain.
 
-.. code-block:: c
+.. literalinclude:: ../../../lib/cryptodev/rte_crypto_sym.h
+   :language: c
+   :start-after: Structure rte_crypto_sym_op 8<
+   :end-before: >8 End of structure rte_crypto_sym_op.
 
-    struct rte_crypto_sym_op {
-        struct rte_mbuf *m_src;
-        struct rte_mbuf *m_dst;
-
-        union {
-            void *session;
-            /**< Handle for the initialised session context */
-            struct rte_crypto_sym_xform *xform;
-            /**< Session-less API Crypto operation parameters */
-        };
-
-        union {
-            struct {
-                struct {
-                    uint32_t offset;
-                    uint32_t length;
-                } data; /**< Data offsets and length for AEAD */
-
-                struct {
-                    uint8_t *data;
-                    rte_iova_t phys_addr;
-                } digest; /**< Digest parameters */
-
-                struct {
-                    uint8_t *data;
-                    rte_iova_t phys_addr;
-                } aad;
-                /**< Additional authentication parameters */
-            } aead;
-
-            struct {
-                struct {
-                    struct {
-                        uint32_t offset;
-                        uint32_t length;
-                    } data; /**< Data offsets and length for ciphering */
-                } cipher;
-
-                struct {
-                    struct {
-                        uint32_t offset;
-                        uint32_t length;
-                    } data;
-                    /**< Data offsets and length for authentication */
-
-                    struct {
-                        uint8_t *data;
-                        rte_iova_t phys_addr;
-                    } digest; /**< Digest parameters */
-                } auth;
-            };
-        };
-    };
 
 Synchronous mode
 ----------------
diff --git a/lib/cryptodev/rte_crypto_sym.h b/lib/cryptodev/rte_crypto_sym.h
index 33b4966e16..0d625ec103 100644
--- a/lib/cryptodev/rte_crypto_sym.h
+++ b/lib/cryptodev/rte_crypto_sym.h
@@ -574,6 +574,7 @@ enum rte_crypto_sym_xform_type {
  * hold a single transform, the type field is used to specify which transform
  * is contained within the union
  */
+/* Structure rte_crypto_sym_xform 8< */
 struct rte_crypto_sym_xform {
 	struct rte_crypto_sym_xform *next;
 	/**< next xform in chain */
@@ -589,6 +590,7 @@ struct rte_crypto_sym_xform {
 		/**< AEAD xform */
 	};
 };
+/* >8 End of structure rte_crypto_sym_xform. */
 
 /**
  * Symmetric Cryptographic Operation.
@@ -620,6 +622,7 @@ struct rte_crypto_sym_xform {
  * destination buffer being at a different alignment, relative to buffer start,
  * to the data in the source buffer.
  */
+/* Structure rte_crypto_sym_op 8< */
 struct rte_crypto_sym_op {
 	struct rte_mbuf *m_src;	/**< source mbuf */
 	struct rte_mbuf *m_dst;	/**< destination mbuf */
@@ -881,6 +884,7 @@ struct rte_crypto_sym_op {
 		};
 	};
 };
+/* >8 End of structure rte_crypto_sym_op. */
 
 
 /**
diff --git a/lib/cryptodev/rte_cryptodev.h b/lib/cryptodev/rte_cryptodev.h
index ed4112c625..c678a88d7c 100644
--- a/lib/cryptodev/rte_cryptodev.h
+++ b/lib/cryptodev/rte_cryptodev.h
@@ -501,6 +501,7 @@ extern const char *
 rte_cryptodev_get_feature_name(uint64_t flag);
 
 /**  Crypto device information */
+/* Structure rte_cryptodev_info 8< */
 struct rte_cryptodev_info {
 	const char *driver_name;	/**< Driver name. */
 	uint8_t driver_id;		/**< Driver identifier */
@@ -529,6 +530,7 @@ struct rte_cryptodev_info {
 		 */
 	} sym;
 };
+/* >8 End of structure rte_cryptodev_info. */
 
 #define RTE_CRYPTODEV_DETACHED  (0)
 #define RTE_CRYPTODEV_ATTACHED  (1)
@@ -541,11 +543,13 @@ enum rte_cryptodev_event_type {
 };
 
 /** Crypto device queue pair configuration structure. */
+/* Structure rte_cryptodev_qp_conf 8<*/
 struct rte_cryptodev_qp_conf {
 	uint32_t nb_descriptors; /**< Number of descriptors per queue pair */
 	struct rte_mempool *mp_session;
 	/**< The mempool for creating session in sessionless mode */
 };
+/* >8 End of structure rte_cryptodev_qp_conf. */
 
 /**
  * Function type used for processing crypto ops when enqueue/dequeue burst is
@@ -674,6 +678,7 @@ extern int
 rte_cryptodev_socket_id(uint8_t dev_id);
 
 /** Crypto device configuration structure */
+/* Structure rte_cryptodev_config 8< */
 struct rte_cryptodev_config {
 	int socket_id;			/**< Socket to allocate resources on */
 	uint16_t nb_queue_pairs;
@@ -686,6 +691,7 @@ struct rte_cryptodev_config {
 	 *  - RTE_CRYTPODEV_FF_SECURITY
 	 */
 };
+/* >8 End of structure rte_cryptodev_config. */
 
 /**
  * Configure a device.
-- 
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-04-09 21:45:42.197660400 +0800
+++ 0134-doc-fix-code-blocks-in-cryptodev-guide.patch	2023-04-09 21:45:38.809042200 +0800
@@ -1 +1 @@
-From d2d7f0190bce57b2a07942e7c11a1e77a9c029ca Mon Sep 17 00:00:00 2001
+From 95c2df95d259bd8c8429fc196a6cba508cbc2be7 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl at nvidia.com>
+
+[ upstream commit d2d7f0190bce57b2a07942e7c11a1e77a9c029ca ]
@@ -12 +14,0 @@
-Cc: stable at dpdk.org
@@ -186 +188 @@
-index 2cfe66530c..b43174dbec 100644
+index 33b4966e16..0d625ec103 100644
@@ -189 +191 @@
-@@ -582,6 +582,7 @@ enum rte_crypto_sym_xform_type {
+@@ -574,6 +574,7 @@ enum rte_crypto_sym_xform_type {
@@ -197 +199 @@
-@@ -597,6 +598,7 @@ struct rte_crypto_sym_xform {
+@@ -589,6 +590,7 @@ struct rte_crypto_sym_xform {
@@ -205 +207 @@
-@@ -628,6 +630,7 @@ struct rte_crypto_sym_xform {
+@@ -620,6 +622,7 @@ struct rte_crypto_sym_xform {
@@ -213 +215 @@
-@@ -889,6 +892,7 @@ struct rte_crypto_sym_op {
+@@ -881,6 +884,7 @@ struct rte_crypto_sym_op {
@@ -222 +224 @@
-index 27cdec8495..3a9ad13660 100644
+index ed4112c625..c678a88d7c 100644
@@ -225 +227 @@
-@@ -553,6 +553,7 @@ extern const char *
+@@ -501,6 +501,7 @@ extern const char *
@@ -233 +235 @@
-@@ -581,6 +582,7 @@ struct rte_cryptodev_info {
+@@ -529,6 +530,7 @@ struct rte_cryptodev_info {
@@ -241 +243 @@
-@@ -593,11 +595,13 @@ enum rte_cryptodev_event_type {
+@@ -541,11 +543,13 @@ enum rte_cryptodev_event_type {
@@ -255 +257 @@
-@@ -726,6 +730,7 @@ extern int
+@@ -674,6 +678,7 @@ extern int
@@ -263 +265 @@
-@@ -738,6 +743,7 @@ struct rte_cryptodev_config {
+@@ -686,6 +691,7 @@ struct rte_cryptodev_config {


More information about the stable mailing list