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 A7641428F8 for ; Sun, 9 Apr 2023 17:37:15 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id A17DD40EDE; Sun, 9 Apr 2023 17:37:15 +0200 (CEST) Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on2052.outbound.protection.outlook.com [40.107.223.52]) by mails.dpdk.org (Postfix) with ESMTP id 5AED440141 for ; Sun, 9 Apr 2023 17:37:13 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=XiFn9Awb0CLTNGJlzRx9yoQ3Ew15Xk89qf71lQ07krLr0f3CfEuX6rZuObyFzjrgHpF3Bdmeqm+YitUs2v0BvR8CmQ/h7WTLi2d4f5l1VZrxLMmXwapvwryXs2B7IFewsXUBDuDiBaNFj/lYgs7FeWSFLFZiIDiAy0BUlsr+BI/UOlk5VG89W1+JcGyybKYRuTOaCi6UB79nDjap8e3VG6egBe5oyJfBOfdFs+fd5+CXkExslAQJUEd8LS5pHquHxydxhPKVMhmx+tdL48sVZiRplRQiqG5IohACmoPKYyNU4goyQSHjKNNuepmnHV2sMLy9l0vfQV7CzRiqljDd/A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=X9RPnl/eYeRFm1ULJ97L78g1c1f3AUbrvgQbYJQsjNg=; b=Dkxr3quGGfBcrgdXxzKaJUI7SQKd0TdfV1UWKW0dHruhN9yGsppyrG7uz6ivZ+H70Ld+FPSPdAzyVhjMJp9D4/bdpzM30Ntwl/BvtbhQOPmzTqpJzfi5EP0y3IWnhYYxKye59lB4RrIw+u4/ZbpshPilflhDCJlsS3XW1zzb5DF7Gb8YAwClCuhsrFrqi/9BMqyo/bSHfyC7lWi2LNdef3ytEJandz8vKyqrnZEja2MJ29W9MMoRCG21CTVbjZJGcQ0dyyyRy5eLYogc59KI3EEgw37N2n5YlRD/OIOat3hr/asqbZmKQmESJ4inkLiz26SMhQTWbjao8mxzJn18eg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.161) smtp.rcpttodomain=marvell.com smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=X9RPnl/eYeRFm1ULJ97L78g1c1f3AUbrvgQbYJQsjNg=; b=ZEm7vSL2bVi1o7P+bVkk2X3JuC+mIwlzA7nyBfD2tjFYk1htW/HjJWRYP0fEQOEYDMnszrpIlOA8Jq9zU6JPHB8nFCoJhngX2ulr9txWnaA4URAL4D4fVLuQ1iJuH9fkJrp0CbFL2K+hk738w1FrFrlOTHllD7tEn9otouadKCpL7jBp5Sa6kYPKKMK8G/5A51eQu/O+r4GACVPvBxSY6Uz1GZ8If6C3INNy5adNmuCGqLhSPchNe1byW4fJ0KzFUmdj/HsODSErNzHDsl/JBovdQfCtkQdNzlXfR0f0Y8tIfFCJghJw1g3v+1c5L8Iw/5xtWTuIhTicY39/2TPSfQ== Received: from BN1PR14CA0010.namprd14.prod.outlook.com (2603:10b6:408:e3::15) by CH2PR12MB5002.namprd12.prod.outlook.com (2603:10b6:610:6d::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6277.38; Sun, 9 Apr 2023 15:37:11 +0000 Received: from BN8NAM11FT031.eop-nam11.prod.protection.outlook.com (2603:10b6:408:e3:cafe::fc) by BN1PR14CA0010.outlook.office365.com (2603:10b6:408:e3::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6277.39 via Frontend Transport; Sun, 9 Apr 2023 15:37:10 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.161) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.117.161 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.161; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.117.161) by BN8NAM11FT031.mail.protection.outlook.com (10.13.177.25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6298.20 via Frontend Transport; Sun, 9 Apr 2023 15:37:09 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by mail.nvidia.com (10.129.200.67) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.5; Sun, 9 Apr 2023 08:37:01 -0700 Received: from nvidia.com (10.126.230.37) by rnnvmail201.nvidia.com (10.129.68.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.37; Sun, 9 Apr 2023 08:36:59 -0700 From: Xueming Li 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 22.11.2 Date: Sun, 9 Apr 2023 23:25:22 +0800 Message-ID: <20230409152529.5308-135-xuemingl@nvidia.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230409152529.5308-1-xuemingl@nvidia.com> References: <20230227062349.13764-1-xuemingl@nvidia.com> <20230409152529.5308-1-xuemingl@nvidia.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.126.230.37] X-ClientProxiedBy: rnnvmail203.nvidia.com (10.129.68.9) To rnnvmail201.nvidia.com (10.129.68.8) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BN8NAM11FT031:EE_|CH2PR12MB5002:EE_ X-MS-Office365-Filtering-Correlation-Id: b8e5d428-ae90-4962-3853-08db3910487b X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 3P8rjJDaOUhr9UyRhJVpXH/J0r5CC4xczkAm8YMrYGzPQ/9nb2CuGWm4UHwYKl+bH9AvpDkM242hLwNRmSMeHB1UlFoIH7mtWV10fZSaDz57UcX/BahSEaCnIMpXSH+HMeahKXLhbzFPGS3sp5pTdVUZYspQCja/Ey8baSyxxhGh85bvfLsix4XRUAMcG+IYiDZRrICTff0J7TmG5lVK05k1DN8FDROU7q/qXhJNb9UxaGnLSpEJPXbvqoKByQHsJvB5MyGZD+J2oV4sDfwuD0kDH32QZ0aq6ADgRH3Za/o/NQ8ZmU3T0JYXcKI/Gz/bv8pklC0YhJSIMy5QYg5NKuXBD4YB45j0q017QJ+1xfX3dSqbIZTNeW9opXsGMLCFPWerGJiWjnn3k740T1OAFsDchtgf7t2xOCwk6ydVXf/asrj2fs0sqAJ998Wif6iI4iH/4S+8D1ezzZqjtpGLXOMckkimB6lovpu7rEU/lvCeDw22NjTnWMv51GuGv66vG792NCBV476W3MDFoLg8uj9LNeiTQCyj+S5EPY4nHvws0qm5GzoX3ZitwN64CbrTSW98ZighZxv3yXTdYXGkf9wkCBevufTNsIUQeSizcY3Dk+RZPKQmJpF0N49erk6YaASqJcYSW/waF2KeTG2fVeLKroNmCW6jjiN552YzOHojoeBe2KQ74Dy0OG9ZV3FgPmz9dHLGGpyN7H7nZLfSWdF3cHCb9Kdr87uLzXixry/vUv94N3rVNpFCtMHoYmgGmX3MUG31ewofEkYP52iPpCNAde6Ijh9x8nPwj4rAwkgdU98QLdIzprZidK9azr6R71qaPVQIZG/wiPu6488/3A== X-Forefront-Antispam-Report: CIP:216.228.117.161; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:dc6edge2.nvidia.com; CAT:NONE; SFS:(13230028)(4636009)(136003)(396003)(346002)(39860400002)(376002)(451199021)(46966006)(36840700001)(40470700004)(478600001)(7696005)(54906003)(316002)(53546011)(1076003)(26005)(16526019)(6286002)(186003)(966005)(6666004)(2906002)(30864003)(4326008)(70586007)(70206006)(8676002)(6916009)(41300700001)(8936002)(5660300002)(82310400005)(7636003)(356005)(82740400003)(86362001)(55016003)(40480700001)(36756003)(40460700003)(47076005)(83380400001)(2616005)(426003)(336012)(36860700001); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Apr 2023 15:37:09.9320 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: b8e5d428-ae90-4962-3853-08db3910487b X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[216.228.117.161]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: BN8NAM11FT031.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH2PR12MB5002 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 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 --- >From 95c2df95d259bd8c8429fc196a6cba508cbc2be7 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 Cc: Xueming Li [ 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 | 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 + +[ upstream commit d2d7f0190bce57b2a07942e7c11a1e77a9c029ca ] @@ -12 +14,0 @@ -Cc: stable@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 {