[dpdk-dev] [PATCH 2/3] cryptodev: add security operation to crypto operation

Ananyev, Konstantin konstantin.ananyev at intel.com
Tue Jun 9 15:23:07 CEST 2020


> 
> Add a new security operation structure to the crypto operation to allow
> protocol specific parameters defined in rte_security be defined for a
> crypto operation.
> 
> Please note this is API changes only. Implementation will follow in
> next version.
> 
> Signed-off-by: David Coyle <david.coyle at intel.com>
> Signed-off-by: Mairtin o Loingsigh <mairtin.oloingsigh at intel.com>
> ---
>  lib/librte_cryptodev/rte_crypto.h | 11 ++++++++++-
>  1 file changed, 10 insertions(+), 1 deletion(-)
> 
> diff --git a/lib/librte_cryptodev/rte_crypto.h b/lib/librte_cryptodev/rte_crypto.h
> index fd5ef3a87..fbc1df791 100644
> --- a/lib/librte_cryptodev/rte_crypto.h
> +++ b/lib/librte_cryptodev/rte_crypto.h
> @@ -31,8 +31,10 @@ enum rte_crypto_op_type {
>  	/**< Undefined operation type */
>  	RTE_CRYPTO_OP_TYPE_SYMMETRIC,
>  	/**< Symmetric operation */
> -	RTE_CRYPTO_OP_TYPE_ASYMMETRIC
> +	RTE_CRYPTO_OP_TYPE_ASYMMETRIC,
>  	/**< Asymmetric operation */
> +	RTE_CRYPTO_OP_TYPE_SECURITY
> +	/**< Security operation */
>  };
> 
>  /** Status of crypto operation */
> @@ -121,6 +123,13 @@ struct rte_crypto_op {
>  		struct rte_crypto_asym_op asym[0];
>  		/**< Asymmetric operation parameters */
> 
> +#ifdef RTE_LIBRTE_SECURITY
> +		uint8_t security[0];
> +		/**< Security operation parameters
> +		 * - Must be accessed through a rte_security_op pointer
> +		 */
> +#endif
> +
>  	}; /**< operation specific parameters */
>  };

Is there any point to have this extra level of indirection?
Might be simply:

enum rte_crypto_op_type {
	....
+	RTE_CRYPTO_OP_TYPE_SEC_DOCSIS,
};
...
struct rte_crypto_op {
	....
	__extension__
        union {
                struct rte_crypto_sym_op sym[0];
                /**< Symmetric operation parameters */

                struct rte_crypto_asym_op asym[0];
                /**< Asymmetric operation parameters */

+	struct rte_security_docsis_op docsis[0];

        }; /**< operation specific parameters */
 
?



More information about the dev mailing list