[dpdk-dev] [PATCH v2 03/12] cryptodev: rename device retrieval argument
Pablo de Lara
pablo.de.lara.guarch at intel.com
Wed Jun 21 08:28:20 CEST 2017
rte_cryptodev_devices_get() function was parsing a crypto
device name as an argument, but the function actually
returns device identifiers of devices that share the
same crypto driver, so the argument should be driver name, instead.
Fixes: 38227c0e3ad2 ("cryptodev: retrieve device info")
CC: stable at dpdk.org
Signed-off-by: Pablo de Lara <pablo.de.lara.guarch at intel.com>
---
lib/librte_cryptodev/rte_cryptodev.c | 6 +++---
lib/librte_cryptodev/rte_cryptodev.h | 7 ++++---
2 files changed, 7 insertions(+), 6 deletions(-)
diff --git a/lib/librte_cryptodev/rte_cryptodev.c b/lib/librte_cryptodev/rte_cryptodev.c
index cb3e236..8875304 100644
--- a/lib/librte_cryptodev/rte_cryptodev.c
+++ b/lib/librte_cryptodev/rte_cryptodev.c
@@ -501,7 +501,7 @@ rte_cryptodev_count_devtype(enum rte_cryptodev_type type)
}
uint8_t
-rte_cryptodev_devices_get(const char *dev_name, uint8_t *devices,
+rte_cryptodev_devices_get(const char *driver_name, uint8_t *devices,
uint8_t nb_devices)
{
uint8_t i, count = 0;
@@ -516,10 +516,10 @@ rte_cryptodev_devices_get(const char *dev_name, uint8_t *devices,
if (drv)
cmp = strncmp(drv->pci_drv.driver.name,
- dev_name, strlen(dev_name));
+ driver_name, strlen(driver_name));
else
cmp = strncmp(devs[i].data->name,
- dev_name, strlen(dev_name));
+ driver_name, strlen(driver_name));
if (cmp == 0)
devices[count++] = devs[i].data->dev_id;
diff --git a/lib/librte_cryptodev/rte_cryptodev.h b/lib/librte_cryptodev/rte_cryptodev.h
index f307b3b..89093f6 100644
--- a/lib/librte_cryptodev/rte_cryptodev.h
+++ b/lib/librte_cryptodev/rte_cryptodev.h
@@ -464,9 +464,10 @@ extern uint8_t
rte_cryptodev_count_devtype(enum rte_cryptodev_type type);
/**
- * Get number and identifiers of attached crypto device.
+ * Get number and identifiers of attached crypto devices that
+ * use the same crypto driver.
*
- * @param dev_name device name.
+ * @param driver_name driver name.
* @param devices output devices identifiers.
* @param nb_devices maximal number of devices.
*
@@ -474,7 +475,7 @@ rte_cryptodev_count_devtype(enum rte_cryptodev_type type);
* Returns number of attached crypto device.
*/
uint8_t
-rte_cryptodev_devices_get(const char *dev_name, uint8_t *devices,
+rte_cryptodev_devices_get(const char *driver_name, uint8_t *devices,
uint8_t nb_devices);
/*
* Return the NUMA socket to which a device is connected
--
2.9.4
More information about the dev
mailing list