The EAL now requires the bus to be prepended to the device declaration string.
Signed-off-by: Gaetan Rivet <gaetan.ri...@6wind.com> --- lib/librte_eal/common/eal_common_devargs.c | 28 +++++++++------------------- 1 file changed, 9 insertions(+), 19 deletions(-) diff --git a/lib/librte_eal/common/eal_common_devargs.c b/lib/librte_eal/common/eal_common_devargs.c index a21cc1a..49cc3b8 100644 --- a/lib/librte_eal/common/eal_common_devargs.c +++ b/lib/librte_eal/common/eal_common_devargs.c @@ -107,18 +107,17 @@ rte_eal_devargs_parse(struct rte_devargs *da, const char *format, ...) va_start(ap, format); vsnprintf(dev, sizeof(dev), format, ap); va_end(ap); - /* Retrieve eventual bus info */ - do { - devname = dev; - bus = rte_bus_find(bus, bus_name_cmp, dev); - if (bus == NULL) - break; - devname = dev + strlen(bus->name) + 1; - if (rte_bus_find_by_device_name(devname) == bus) - break; - } while (1); + /* Retrieve bus info */ + bus = rte_bus_find(bus, bus_name_cmp, dev); + if (bus == NULL) { + fprintf(stderr, "ERROR: failed to parse bus from \"%s\"\n", + dev); + return -EFAULT; + } + da->bus = bus; /* Store device name */ i = 0; + devname = dev + strlen(bus->name) + 1; while (devname[i] != '\0' && devname[i] != ',') { da->name[i] = devname[i]; i++; @@ -130,15 +129,6 @@ rte_eal_devargs_parse(struct rte_devargs *da, const char *format, ...) } } da->name[i] = '\0'; - if (bus == NULL) { - bus = rte_bus_find_by_device_name(da->name); - if (bus == NULL) { - fprintf(stderr, "ERROR: failed to parse device \"%s\"\n", - da->name); - return -EFAULT; - } - } - da->bus = bus; /* Parse eventual device arguments */ if (devname[i] == ',') da->args = strdup(&devname[i + 1]); -- 2.1.4