[dpdk-dev] [EXT] [PATCH v4] cryptodev: support multiple cipher data-units

Akhil Goyal gakhil at marvell.com
Wed Apr 14 20:37:18 CEST 2021


Hi Thomas,

> +	RTE_STD_C11
> +	union { /* temporary anonymous union for ABI compatibility */
> +
>  	struct {
>  		const uint8_t *data;	/**< pointer to key data */
>  		uint16_t length;	/**< key length in bytes */
> @@ -222,6 +225,27 @@ struct rte_crypto_cipher_xform {
>  	 *  - Each key can be either 128 bits (16 bytes) or 256 bits (32 bytes).
>  	 *  - Both keys must have the same size.
>  	 **/
> +
> +	RTE_STD_C11
> +	struct { /* temporary anonymous struct for ABI compatibility */
> +		const uint8_t *_key_data; /* reserved for key.data union */
> +		uint16_t _key_length;     /* reserved for key.length union */
> +		/* next field can fill the padding hole */
> +
> +	uint16_t dataunit_len;
> +	/**< When RTE_CRYPTODEV_FF_CIPHER_MULTIPLE_DATA_UNITS is
> enabled,
> +	 * this is the data-unit length of the algorithm,
> +	 * otherwise or when the value is 0, use the operation length.
> +	 * The value should be in the range defined by the dataunit_set field
> +	 * in the cipher capability.
> +	 *
> +	 * - For AES-XTS it is the size of data-unit, from IEEE Std 1619-2007.
> +	 * For-each data-unit in the operation, the tweak (IV) value is
> +	 * assigned consecutively starting from the operation assigned IV.
> +	 */
> +
> +	}; }; /* temporary struct nested in union for ABI compatibility */
> +
Can we add a deprecation notice also in this patch to remove these temporary
Struct and union, so that we remember to remove them in 21.11

> +/**
> + * Data-unit supported lengths of cipher algorithms.
> + * A bit can represent any set of data-unit sizes
> + * (single size, multiple size, range, etc).
> + */
> +#define RTE_CRYPTO_CIPHER_DATA_UNIT_LEN_512_BYTES	(1 << 0)
> +#define RTE_CRYPTO_CIPHER_DATA_UNIT_LEN_4096_BYTES	(1 << 1)
> +
>  /**
>   * Symmetric Crypto Capability
>   */
> @@ -127,6 +135,11 @@ struct rte_cryptodev_symmetric_capability {
>  			/**< cipher key size range */
>  			struct rte_crypto_param_range iv_size;
>  			/**< Initialisation vector data size range */
> +			uint32_t dataunit_set;
> +			/**<
> +			 * A bitmap for a set of the supported data-unit
> lengths.

Add reference to the newly created macros here

> +			 * 0 for any length defined in the algorithm standard.
> +			 */



More information about the dev mailing list