Hi Pablo,
On 10/10/2017 7:13 PM, De Lara Guarch, Pablo wrote:
-----Original Message-----
From: Akhil Goyal [mailto:[email protected]]
Sent: Friday, October 6, 2017 7:12 PM
To: [email protected]
Cc: Doherty, Declan <[email protected]>; De Lara Guarch, Pablo
<[email protected]>; [email protected]; Nicolau,
Radu <[email protected]>; [email protected];
[email protected]; [email protected]; [email protected];
[email protected]; Mcnamara, John
<[email protected]>; Ananyev, Konstantin
<[email protected]>; [email protected];
[email protected]
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