[dpdk-dev] [PATCH] cryptodev: support multiple cipher block sizes

Zhang, Roy Fan roy.fan.zhang at intel.com
Fri Feb 5 17:50:10 CET 2021


Hi Matan,

It is a good idea to be able to show the varied block sizes of each PMD/algo.

> -----Original Message-----
> From: Matan Azrad <matan at nvidia.com>
> Sent: Thursday, February 4, 2021 2:34 PM
> To: dev at dpdk.org
> Cc: akhil.goyal at nxp.com; Doherty, Declan <declan.doherty at intel.com>;
> Somalapuram Amaranath <asomalap at amd.com>; Ruifeng Wang
> <ruifeng.wang at arm.com>; Ajit Khaparde <ajit.khaparde at broadcom.com>;
> Anoob Joseph <anoobj at marvell.com>; Zhang, Roy Fan
> <roy.fan.zhang at intel.com>; Griffin, John <john.griffin at intel.com>; De Lara
> Guarch, Pablo <pablo.de.lara.guarch at intel.com>; Michael Shamis
> <michaelsh at marvell.com>; Nagadheeraj Rottela
> <rnagadheeraj at marvell.com>; Ankur Dwivedi <adwivedi at marvell.com>;
> Gagandeep Singh <g.singh at nxp.com>; Jay Zhou <jianjay.zhou at huawei.com>
> Subject: [PATCH] cryptodev: support multiple cipher block sizes

[SNIP] 

> +#define RTE_CRYPTO_CIPHER_BSF_ALL 0x1
> +/* All the sizes from the algorithm standard */
> +#define RTE_CRYPTO_CIPHER_BSF_512_BYTES 0x2
> +#define RTE_CRYPTO_CIPHER_BSF_520_BYTES 0x4
> +#define RTE_CRYPTO_CIPHER_BSF_4048_BYTES 0x8
> +#define RTE_CRYPTO_CIPHER_BSF_4096_BYTES 0x10
> +#define RTE_CRYPTO_CIPHER_BSF_4160_BYTES 0x20
> +#define RTE_CRYPTO_CIPHER_BSF_1M_BYTES 0x40
> +
> +/**
>   * Symmetric Crypto Capability
>   */
>  struct rte_cryptodev_symmetric_capability {
> @@ -122,11 +135,19 @@ struct rte_cryptodev_symmetric_capability {
>  			enum rte_crypto_cipher_algorithm algo;
>  			/**< cipher algorithm */
>  			uint16_t block_size;
> -			/**< algorithm block size */
> +			/**<
> +			 * algorithm block size
> +			 * For algorithms support more than single block size,
> +			 * this is the default block size supported by the
> +			 * driver, all the supported sizes are reflected in the
> +			 * bsf field.
> +			 */
>  			struct rte_crypto_param_range key_size;
>  			/**< cipher key size range */
>  			struct rte_crypto_param_range iv_size;
>  			/**< Initialisation vector data size range */
> +			uint32_t bsf;
> +			/**< Block size flags */

The doubt I have is limited block sizes 32-bit bsf can represents. Although it is good enough now for AES-XTS but it already used 1/4 of all available representation of the different block sizes. If we are to include more block sizes for different algorithms we really don't have much room left.
Also bsf seems to be a duplication to existing block_size. 

There should be a better way to describe varied block sizes in capability.

>  		} cipher;
>  		/**< Symmetric Cipher transform capabilities */
>  		struct {
> --
> 1.8.3.1

Regards,
Fan


More information about the dev mailing list