[dpdk-dev] [PATCH v4 01/12] lib/rte_security: add security library

Ananyev, Konstantin konstantin.ananyev at intel.com
Thu Oct 19 11:30:23 CEST 2017



> +
> +/**
> + * Security context for crypto/eth devices
> + *
> + * Security instance for each driver to register security operations.
> + * The application can get the security context from the crypto/eth device id
> + * using the APIs rte_cryptodev_get_sec_ctx()/rte_eth_dev_get_sec_ctx()
> + * This structure is used to identify the device(crypto/eth) for which the
> + * security operations need to be performed.
> + */
> +struct rte_security_ctx {
> +	enum {
> +		RTE_SECURITY_INSTANCE_INVALID,
> +		/**< Security context is invalid */
> +		RTE_SECURITY_INSTANCE_VALID
> +		/**< Security context is valid */
> +	} state;

As a nit - why do you need state now?
As I understand if device doesn't have its security context setup properly,
then rte_eth_dev_get_sec_ctx() would just return 0.
Konstantin 

> +	/**< Current state of security context */
> +	void *device;
> +	/**< Crypto/ethernet device attached */
> +	struct rte_security_ops *ops;
> +	/**< Pointer to security ops for the device */
> +	uint16_t sess_cnt;
> +	/**< Number of sessions attached to this context */
> +};


More information about the dev mailing list