[dpdk-dev] [PATCH v3 03/12] cryptodev: support security APIs

De Lara Guarch, Pablo pablo.de.lara.guarch at intel.com
Tue Oct 10 15:43:33 CEST 2017



> -----Original Message-----
> From: Akhil Goyal [mailto:akhil.goyal at nxp.com]
> Sent: Friday, October 6, 2017 7:12 PM
> To: dev at dpdk.org
> Cc: Doherty, Declan <declan.doherty at intel.com>; De Lara Guarch, Pablo
> <pablo.de.lara.guarch at intel.com>; hemant.agrawal at nxp.com; Nicolau,
> Radu <radu.nicolau at intel.com>; borisp at mellanox.com;
> aviadye at mellanox.com; thomas at monjalon.net; sandeep.malik at nxp.com;
> jerin.jacob at caviumnetworks.com; Mcnamara, John
> <john.mcnamara at intel.com>; Ananyev, Konstantin
> <konstantin.ananyev at intel.com>; shahafs at mellanox.com;
> olivier.matz at 6wind.com
> Subject: [PATCH v3 03/12] cryptodev: support security APIs
> 

...

> diff --git a/lib/librte_cryptodev/rte_cryptodev.c
> b/lib/librte_cryptodev/rte_cryptodev.c
> index 327d7e8..7a7c936 100644
> --- a/lib/librte_cryptodev/rte_cryptodev.c
> +++ b/lib/librte_cryptodev/rte_cryptodev.c
> @@ -488,6 +488,16 @@ rte_cryptodev_devices_get(const char
> *driver_name, uint8_t *devices,
>  	return count;
>  }
> 
> +uint16_t
> +rte_cryptodev_get_sec_id(uint8_t dev_id) {
> +	if (rte_crypto_devices[dev_id].feature_flags &
> +			RTE_CRYPTODEV_FF_SECURITY)
> +		return rte_crypto_devices[dev_id].data->sec_id;
> +
> +	return INVALID_SEC_ID;

Is this better than returning an integer?
>From a user point of view, I see better to check for negative,
and other similar functions, such as rte_cryptodev_get_dev_id, return an integer.

Thanks,
Pablo



More information about the dev mailing list