From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 56DDA42814 for ; Wed, 29 Mar 2023 03:05:00 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 5190F40F18; Wed, 29 Mar 2023 03:05:00 +0200 (CEST) Received: from mail-wr1-f50.google.com (mail-wr1-f50.google.com [209.85.221.50]) by mails.dpdk.org (Postfix) with ESMTP id C6A1840EE7 for ; Wed, 29 Mar 2023 03:04:59 +0200 (CEST) Received: by mail-wr1-f50.google.com with SMTP id r11so13996550wrr.12 for ; Tue, 28 Mar 2023 18:04:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1680051899; x=1682643899; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=wZIQPC4WYNyv2G+V1gJUhm03MCo5X0RV3PKV6MPCEGU=; b=Z/wPM2JLWLH3AK0zbv7Itkanar1GKkUkKmFAqK75e/qJrSideMA8NrH2A+1ITppCfn 9x/ceqPDgzWXpchj8pDpl22CxyeGTnMeVPVf8qCI5ThUK10HNkMe8SIN7I65Rw55NjUd xeK4kcn1CQgEMWyF0Epu12wApfZ0Ei5u97ZLRZ5+d3DCrcbXcR+PPQ+oE1HGB5JGL0J8 Bo1qLipH4AmKYmY3xVZfvqIwxO1DFA2B2sxz6kaQdILDVBo/6bp5atN0CydhbVezUXoo 8Pzb8BX0T6+y8dBlVfeU2Owd5gQ4GRAuDkHl53AzRcwkBYtzP8hDDRTpM1R96/IiCAY9 5BFA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680051899; x=1682643899; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=wZIQPC4WYNyv2G+V1gJUhm03MCo5X0RV3PKV6MPCEGU=; b=C6IcRbX4v9iqi/MslsQcz3BMCKYURVRBHua4kZHqDONtZ/ViIQg4T8cR4cx8/8RQiY mfR9Psa+Rsd1RJBNZyQreZFJh6KSz/LAeItcS67iS5c9VEB8JLCboVP4DC8K7bCT/but 8w7k3M+voeKGjp+nEjdbmEZbe3R2efJtlWBSeLt/PQhbphUmjTpJ+xPDgPg7NiP/rYE5 7EOCyS7wv3rMMVeULh+ZqsWtFirofAnQsQghc/VuXkQf2NNy1mlTsX6pszYsUg9G9fxC L17L1cNT4O9912Eha83jpoYEBx7/z9ZQHMdTlxLJZC3cd1I1nTTwqT0ZWKSuRwdpQxF+ VP4Q== X-Gm-Message-State: AAQBX9dglbkFCLFLKZU4x9hYWBTXn2wt469kudhO9nSSeL/fNMHPvFir MZeoTTQT6hNHHwjkPJNmV8rvmOwsSBA= X-Google-Smtp-Source: AKy350bgxCJ2aTMr7libjes5FokN7Hq+pgLhlK2pgArqCwny6LzgC9fd6mskinWNljNELkZPgCNi+g== X-Received: by 2002:a5d:414c:0:b0:2d6:4e98:5f32 with SMTP id c12-20020a5d414c000000b002d64e985f32mr12923123wrq.23.1680051899272; Tue, 28 Mar 2023 18:04:59 -0700 (PDT) Received: from localhost ([2a01:4b00:d307:1000:f1d3:eb5e:11f4:a7d9]) by smtp.gmail.com with ESMTPSA id n12-20020adfe34c000000b002da75c5e143sm16405763wrj.29.2023.03.28.18.04.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Mar 2023 18:04:57 -0700 (PDT) From: luca.boccassi@gmail.com To: Akhil Goyal Cc: David Marchand , Ciara Power , Hemant Agrawal , dpdk stable Subject: patch 'doc: fix code blocks in cryptodev guide' has been queued to stable release 20.11.8 Date: Wed, 29 Mar 2023 02:04:41 +0100 Message-Id: <20230329010446.563852-5-luca.boccassi@gmail.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230329010446.563852-1-luca.boccassi@gmail.com> References: <20230322004155.2333903-19-luca.boccassi@gmail.com> <20230329010446.563852-1-luca.boccassi@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Hi, FYI, your patch has been queued to stable release 20.11.8 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 03/31/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://github.com/bluca/dpdk-stable This queued commit can be viewed at: https://github.com/bluca/dpdk-stable/commit/6500e9e4d8d556a3d29c26b5fe2c9d5f2c6acd1a Thanks. Luca Boccassi --- >From 6500e9e4d8d556a3d29c26b5fe2c9d5f2c6acd1a Mon Sep 17 00:00:00 2001 From: Akhil Goyal Date: Tue, 21 Mar 2023 18:35:27 +0530 Subject: [PATCH] doc: fix code blocks in cryptodev guide [ 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 Signed-off-by: Akhil Goyal Acked-by: Ciara Power Acked-by: Hemant Agrawal --- doc/guides/prog_guide/cryptodev_lib.rst | 123 ++++-------------------- lib/librte_cryptodev/rte_crypto_sym.h | 4 + lib/librte_cryptodev/rte_cryptodev.h | 6 ++ 3 files changed, 31 insertions(+), 102 deletions(-) diff --git a/doc/guides/prog_guide/cryptodev_lib.rst b/doc/guides/prog_guide/cryptodev_lib.rst index 2faa7f11bd..bb655c3606 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/librte_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,13 +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 */ - struct rte_mempool *mp_session_private; - /**< The mempool for creating sess private data in sessionless mode */ - }; + +.. literalinclude:: ../../../lib/librte_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 fields ``mp_session`` and ``mp_session_private`` are used for creating @@ -273,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/librte_cryptodev/rte_cryptodev.h + :language: c + :start-after: Structure rte_cryptodev_info 8< + :end-before: >8 End of structure rte_cryptodev_info. Operation Processing @@ -506,22 +487,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/librte_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 @@ -544,61 +513,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/librte_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 { - struct rte_cryptodev_sym_session *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/librte_cryptodev/rte_crypto_sym.h b/lib/librte_cryptodev/rte_crypto_sym.h index 406c5c7a5c..dc02b0c6d8 100644 --- a/lib/librte_cryptodev/rte_crypto_sym.h +++ b/lib/librte_cryptodev/rte_crypto_sym.h @@ -540,6 +540,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 */ @@ -555,6 +556,7 @@ struct rte_crypto_sym_xform { /**< AEAD xform */ }; }; +/* >8 End of structure rte_crypto_sym_xform. */ struct rte_cryptodev_sym_session; @@ -588,6 +590,7 @@ struct rte_cryptodev_sym_session; * 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 */ @@ -850,6 +853,7 @@ struct rte_crypto_sym_op { }; }; }; +/* >8 End of structure rte_crypto_sym_op. */ /** diff --git a/lib/librte_cryptodev/rte_cryptodev.h b/lib/librte_cryptodev/rte_cryptodev.h index 0935fd5875..d79996860a 100644 --- a/lib/librte_cryptodev/rte_cryptodev.h +++ b/lib/librte_cryptodev/rte_cryptodev.h @@ -474,6 +474,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 */ @@ -502,6 +503,7 @@ struct rte_cryptodev_info { */ } sym; }; +/* >8 End of structure rte_cryptodev_info. */ #define RTE_CRYPTODEV_DETACHED (0) #define RTE_CRYPTODEV_ATTACHED (1) @@ -514,6 +516,7 @@ 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; @@ -521,6 +524,7 @@ struct rte_cryptodev_qp_conf { struct rte_mempool *mp_session_private; /**< The mempool for creating sess private data in sessionless mode */ }; +/* >8 End of structure rte_cryptodev_qp_conf. */ /** * Typedef for application callback function to be registered by application @@ -625,6 +629,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; @@ -637,6 +642,7 @@ struct rte_cryptodev_config { * - RTE_CRYTPODEV_FF_SECURITY */ }; +/* >8 End of structure rte_cryptodev_config. */ /** * Configure a device. -- 2.39.2 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2023-03-29 01:31:22.777543983 +0100 +++ 0005-doc-fix-code-blocks-in-cryptodev-guide.patch 2023-03-29 01:31:22.486039568 +0100 @@ -1 +1 @@ -From d2d7f0190bce57b2a07942e7c11a1e77a9c029ca Mon Sep 17 00:00:00 2001 +From 6500e9e4d8d556a3d29c26b5fe2c9d5f2c6acd1a Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit d2d7f0190bce57b2a07942e7c11a1e77a9c029ca ] + @@ -12 +13,0 @@ -Cc: stable@dpdk.org @@ -19,4 +20,4 @@ - 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(-) + doc/guides/prog_guide/cryptodev_lib.rst | 123 ++++-------------------- + lib/librte_cryptodev/rte_crypto_sym.h | 4 + + lib/librte_cryptodev/rte_cryptodev.h | 6 ++ + 3 files changed, 31 insertions(+), 102 deletions(-) @@ -25 +26 @@ -index 0d9f7059ea..2b513bbf82 100644 +index 2faa7f11bd..bb655c3606 100644 @@ -40 +41 @@ -+.. literalinclude:: ../../../lib/cryptodev/rte_cryptodev.h ++.. literalinclude:: ../../../lib/librte_cryptodev/rte_cryptodev.h @@ -47 +48 @@ -@@ -121,11 +117,11 @@ Each queue pairs resources may be allocated on a specified socket. +@@ -121,13 +117,11 @@ Each queue pairs resources may be allocated on a specified socket. @@ -54,0 +56,2 @@ +- struct rte_mempool *mp_session_private; +- /**< The mempool for creating sess private data in sessionless mode */ @@ -57 +60 @@ -+.. literalinclude:: ../../../lib/cryptodev/rte_cryptodev.h ++.. literalinclude:: ../../../lib/librte_cryptodev/rte_cryptodev.h @@ -63,2 +66,2 @@ - 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 + The fields ``mp_session`` and ``mp_session_private`` are used for creating +@@ -273,23 +267,10 @@ This allows the user to query a specific Crypto PMD and get all the device @@ -85 +88 @@ -+.. literalinclude:: ../../../lib/cryptodev/rte_cryptodev.h ++.. literalinclude:: ../../../lib/librte_cryptodev/rte_cryptodev.h @@ -92 +95 @@ -@@ -540,22 +523,10 @@ Currently there are three transforms types cipher, authentication and AEAD. +@@ -506,22 +487,10 @@ Currently there are three transforms types cipher, authentication and AEAD. @@ -112 +115 @@ -+.. literalinclude:: ../../../lib/cryptodev/rte_crypto_sym.h ++.. literalinclude:: ../../../lib/librte_cryptodev/rte_crypto_sym.h @@ -119 +122 @@ -@@ -578,61 +549,11 @@ authentication/ cipher/ AEAD parameters required depending on the type of operat +@@ -544,61 +513,11 @@ authentication/ cipher/ AEAD parameters required depending on the type of operat @@ -124 +127 @@ -+.. literalinclude:: ../../../lib/cryptodev/rte_crypto_sym.h ++.. literalinclude:: ../../../lib/librte_cryptodev/rte_crypto_sym.h @@ -134 +137 @@ -- void *session; +- struct rte_cryptodev_sym_session *session; @@ -185,5 +188,5 @@ -diff --git a/lib/cryptodev/rte_crypto_sym.h b/lib/cryptodev/rte_crypto_sym.h -index 2cfe66530c..b43174dbec 100644 ---- a/lib/cryptodev/rte_crypto_sym.h -+++ b/lib/cryptodev/rte_crypto_sym.h -@@ -582,6 +582,7 @@ enum rte_crypto_sym_xform_type { +diff --git a/lib/librte_cryptodev/rte_crypto_sym.h b/lib/librte_cryptodev/rte_crypto_sym.h +index 406c5c7a5c..dc02b0c6d8 100644 +--- a/lib/librte_cryptodev/rte_crypto_sym.h ++++ b/lib/librte_cryptodev/rte_crypto_sym.h +@@ -540,6 +540,7 @@ enum rte_crypto_sym_xform_type { @@ -197 +200 @@ -@@ -597,6 +598,7 @@ struct rte_crypto_sym_xform { +@@ -555,6 +556,7 @@ struct rte_crypto_sym_xform { @@ -203,3 +206,3 @@ - /** - * Symmetric Cryptographic Operation. -@@ -628,6 +630,7 @@ struct rte_crypto_sym_xform { + struct rte_cryptodev_sym_session; + +@@ -588,6 +590,7 @@ struct rte_cryptodev_sym_session; @@ -213 +216 @@ -@@ -889,6 +892,7 @@ struct rte_crypto_sym_op { +@@ -850,6 +853,7 @@ struct rte_crypto_sym_op { @@ -221,5 +224,5 @@ -diff --git a/lib/cryptodev/rte_cryptodev.h b/lib/cryptodev/rte_cryptodev.h -index 27cdec8495..3a9ad13660 100644 ---- a/lib/cryptodev/rte_cryptodev.h -+++ b/lib/cryptodev/rte_cryptodev.h -@@ -553,6 +553,7 @@ extern const char * +diff --git a/lib/librte_cryptodev/rte_cryptodev.h b/lib/librte_cryptodev/rte_cryptodev.h +index 0935fd5875..d79996860a 100644 +--- a/lib/librte_cryptodev/rte_cryptodev.h ++++ b/lib/librte_cryptodev/rte_cryptodev.h +@@ -474,6 +474,7 @@ extern const char * @@ -233 +236 @@ -@@ -581,6 +582,7 @@ struct rte_cryptodev_info { +@@ -502,6 +503,7 @@ struct rte_cryptodev_info { @@ -241 +244 @@ -@@ -593,11 +595,13 @@ enum rte_cryptodev_event_type { +@@ -514,6 +516,7 @@ enum rte_cryptodev_event_type { @@ -249 +252,3 @@ - /**< The mempool for creating session in sessionless mode */ +@@ -521,6 +524,7 @@ struct rte_cryptodev_qp_conf { + struct rte_mempool *mp_session_private; + /**< The mempool for creating sess private data in sessionless mode */ @@ -254,2 +259,2 @@ - * Function type used for processing crypto ops when enqueue/dequeue burst is -@@ -726,6 +730,7 @@ extern int + * Typedef for application callback function to be registered by application +@@ -625,6 +629,7 @@ extern int @@ -263 +268 @@ -@@ -738,6 +743,7 @@ struct rte_cryptodev_config { +@@ -637,6 +642,7 @@ struct rte_cryptodev_config {