From 0964a95120fa024888fbc0ea5e34d1abef1b93dc Mon Sep 17 00:00:00 2001 From: Hemant Agrawal Date: Thu, 29 Aug 2019 15:57:08 +0530 Subject: [PATCH] bus/dpaa: fix dpaa_sec blacklist The black list of dpaa_sec devices fails. EAL: failed to parse device "dpaa:dpaa_sec-1" This patch address following issues: - bus usages dpaa-sec while the driver usage dpaa_sec - bus usages numbers from 0 to MAX_SEC - while driver probe usages sec number form max-fman_device +1 Fixes: 6e0752205bb2 ("bus/dpaa: support device blacklisting") Cc: stable@dpdk.org Signed-off-by: Hemant Agrawal Reviewed-by: Sachin Saxena --- doc/guides/cryptodevs/dpaa_sec.rst | 6 +++--- drivers/bus/dpaa/dpaa_bus.c | 6 +++--- drivers/crypto/dpaa_sec/dpaa_sec.c | 3 +-- 3 files changed, 7 insertions(+), 8 deletions(-) diff --git a/doc/guides/cryptodevs/dpaa_sec.rst b/doc/guides/cryptodevs/dpaa_sec.rst index 0a26006342..3a3e30aaf3 100644 --- a/doc/guides/cryptodevs/dpaa_sec.rst +++ b/doc/guides/cryptodevs/dpaa_sec.rst @@ -85,11 +85,11 @@ For blacklisting a DPAA device, following commands can be used. .. code-block:: console - -b "dpaa_bus:dpaa-secX" -- ... - e.g. "dpaa_bus:dpaa-sec0" + -b "dpaa:dpaa_sec-X" -- ... + e.g. "dpaa:dpaa_sec-1" or to disable all 4 SEC devices - -b "dpaa_sec:dpaa-sec0" -b "dpaa_sec:dpaa-sec1" -b "dpaa_sec:dpaa-sec2" -b "dpaa_sec:dpaa-sec3" + -b "dpaa:dpaa_sec-1" -b "dpaa:dpaa_sec-2" -b "dpaa:dpaa_sec-3" -b "dpaa:dpaa_sec-4" Limitations ----------- diff --git a/drivers/bus/dpaa/dpaa_bus.c b/drivers/bus/dpaa/dpaa_bus.c index 07cc5c6676..f7d1a5b63b 100644 --- a/drivers/bus/dpaa/dpaa_bus.c +++ b/drivers/bus/dpaa/dpaa_bus.c @@ -218,7 +218,7 @@ dpaa_create_device_list(void) * allocated for dev->name/ */ memset(dev->name, 0, RTE_ETH_NAME_MAX_LEN); - sprintf(dev->name, "dpaa-sec%d", i); + sprintf(dev->name, "dpaa_sec-%d", i+1); DPAA_BUS_LOG(INFO, "%s cryptodev added", dev->name); dev->device.name = dev->name; dev->device.devargs = dpaa_devargs_lookup(dev); @@ -397,7 +397,7 @@ rte_dpaa_bus_parse(const char *name, void *out_name) * without separator. Both need to be handled. * It is also possible that "name=fm1-mac3" is passed along. */ - DPAA_BUS_DEBUG("Parse device name (%s)\n", name); + DPAA_BUS_DEBUG("Parse device name (%s)", name); /* Check for dpaa_bus:fm1-mac3 style */ dup_name = strdup(name); @@ -428,7 +428,7 @@ rte_dpaa_bus_parse(const char *name, void *out_name) for (i = 0; i < RTE_LIBRTE_DPAA_MAX_CRYPTODEV; i++) { char sec_name[16]; - snprintf(sec_name, 16, "dpaa-sec%d", i); + snprintf(sec_name, 16, "dpaa_sec-%d", i+1); if (strcmp(sec_name, sep) == 0) { if (out_name) strcpy(out_name, sep); diff --git a/drivers/crypto/dpaa_sec/dpaa_sec.c b/drivers/crypto/dpaa_sec/dpaa_sec.c index 38cfdd378e..17c1756044 100644 --- a/drivers/crypto/dpaa_sec/dpaa_sec.c +++ b/drivers/crypto/dpaa_sec/dpaa_sec.c @@ -3010,8 +3010,7 @@ cryptodev_dpaa_sec_probe(struct rte_dpaa_driver *dpaa_drv __rte_unused, int retval; - snprintf(cryptodev_name, sizeof(cryptodev_name), "dpaa_sec-%d", - dpaa_dev->id.dev_id); + snprintf(cryptodev_name, sizeof(cryptodev_name), "%s", dpaa_dev->name); cryptodev = rte_cryptodev_pmd_allocate(cryptodev_name, rte_socket_id()); if (cryptodev == NULL) -- 2.20.1