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

Akhil Goyal akhil.goyal at nxp.com
Sat Oct 21 17:22:15 CEST 2017


Hi Pablo,
On 10/10/2017 7:13 PM, De Lara Guarch, Pablo wrote:
> 
> 
>> -----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.
> 

The API is replaced with another one in v4 which returns a pointer.

Thanks,
Akhil


More information about the dev mailing list