From 8e6c3b795e4b1190d09444d99a6dd11b600d26fe Mon Sep 17 00:00:00 2001 From: Gaetan Rivet Date: Tue, 24 Apr 2018 01:54:51 +0200 Subject: [PATCH] devargs: use proper namespace prefix rte_eal_devargs is useless, rte_devargs is sufficient. Only experimental functions are changed for now. Signed-off-by: Gaetan Rivet Acked-by: Thomas Monjalon --- drivers/bus/vdev/vdev.c | 8 +++---- drivers/net/failsafe/failsafe_args.c | 2 +- drivers/net/failsafe/failsafe_eal.c | 2 +- lib/librte_eal/common/eal_common_dev.c | 8 +++---- lib/librte_eal/common/eal_common_devargs.c | 12 +++++----- lib/librte_eal/common/include/rte_devargs.h | 25 ++++++++++++--------- lib/librte_eal/rte_eal_version.map | 8 +++---- 7 files changed, 34 insertions(+), 31 deletions(-) diff --git a/drivers/bus/vdev/vdev.c b/drivers/bus/vdev/vdev.c index 45ef058945..84fa51f98a 100644 --- a/drivers/bus/vdev/vdev.c +++ b/drivers/bus/vdev/vdev.c @@ -229,7 +229,7 @@ insert_vdev(const char *name, const char *args, struct rte_vdev_device **p_dev) } TAILQ_INSERT_TAIL(&vdev_device_list, dev, next); - rte_eal_devargs_insert(devargs); + rte_devargs_insert(devargs); if (p_dev) *p_dev = dev; @@ -259,7 +259,7 @@ rte_vdev_init(const char *name, const char *args) /* If fails, remove it from vdev list */ devargs = dev->device.devargs; TAILQ_REMOVE(&vdev_device_list, dev, next); - rte_eal_devargs_remove(devargs->bus->name, devargs->name); + rte_devargs_remove(devargs->bus->name, devargs->name); free(dev); } } @@ -307,7 +307,7 @@ rte_vdev_uninit(const char *name) TAILQ_REMOVE(&vdev_device_list, dev, next); devargs = dev->device.devargs; - rte_eal_devargs_remove(devargs->bus->name, devargs->name); + rte_devargs_remove(devargs->bus->name, devargs->name); free(dev); unlock: @@ -429,7 +429,7 @@ vdev_scan(void) if (custom_scan->callback != NULL) /* * the callback should update devargs list - * by calling rte_eal_devargs_insert() with + * by calling rte_devargs_insert() with * devargs.bus = rte_bus_find_by_name("vdev"); * devargs.type = RTE_DEVTYPE_VIRTUAL; * devargs.policy = RTE_DEV_WHITELISTED; diff --git a/drivers/net/failsafe/failsafe_args.c b/drivers/net/failsafe/failsafe_args.c index 5edc061e88..2c002b1644 100644 --- a/drivers/net/failsafe/failsafe_args.c +++ b/drivers/net/failsafe/failsafe_args.c @@ -63,7 +63,7 @@ fs_parse_device(struct sub_device *sdev, char *args) d = &sdev->devargs; DEBUG("%s", args); - ret = rte_eal_devargs_parse(d, "%s", args); + ret = rte_devargs_parse(d, "%s", args); if (ret) { DEBUG("devargs parsing failed with code %d", ret); return ret; diff --git a/drivers/net/failsafe/failsafe_eal.c b/drivers/net/failsafe/failsafe_eal.c index c11621e933..ee89236f1a 100644 --- a/drivers/net/failsafe/failsafe_eal.c +++ b/drivers/net/failsafe/failsafe_eal.c @@ -69,7 +69,7 @@ fs_bus_init(struct rte_eth_dev *dev) else snprintf(devstr, sizeof(devstr), "%s", rte_eth_devices[pid].device->name); - ret = rte_eal_devargs_parse(da, "%s", devstr); + ret = rte_devargs_parse(da, "%s", devstr); if (ret) { ERROR("Probed devargs parsing failed with code" " %d", ret); diff --git a/lib/librte_eal/common/eal_common_dev.c b/lib/librte_eal/common/eal_common_dev.c index 809d6649d2..61cb3b162e 100644 --- a/lib/librte_eal/common/eal_common_dev.c +++ b/lib/librte_eal/common/eal_common_dev.c @@ -138,12 +138,12 @@ int __rte_experimental rte_eal_hotplug_add(const char *busname, const char *devn if (da == NULL) return -ENOMEM; - ret = rte_eal_devargs_parse(da, "%s:%s,%s", + ret = rte_devargs_parse(da, "%s:%s,%s", busname, devname, devargs); if (ret) goto err_devarg; - ret = rte_eal_devargs_insert(da); + ret = rte_devargs_insert(da); if (ret) goto err_devarg; @@ -168,7 +168,7 @@ int __rte_experimental rte_eal_hotplug_add(const char *busname, const char *devn return 0; err_devarg: - if (rte_eal_devargs_remove(busname, devname)) { + if (rte_devargs_remove(busname, devname)) { free(da->args); free(da); } @@ -204,7 +204,7 @@ rte_eal_hotplug_remove(const char *busname, const char *devname) if (ret) RTE_LOG(ERR, EAL, "Driver cannot detach the device (%s)\n", dev->name); - rte_eal_devargs_remove(busname, devname); + rte_devargs_remove(busname, devname); return ret; } diff --git a/lib/librte_eal/common/eal_common_devargs.c b/lib/librte_eal/common/eal_common_devargs.c index b251bb0a62..24d0f6f449 100644 --- a/lib/librte_eal/common/eal_common_devargs.c +++ b/lib/librte_eal/common/eal_common_devargs.c @@ -63,7 +63,7 @@ bus_name_cmp(const struct rte_bus *bus, const void *name) } int __rte_experimental -rte_eal_devargs_parse(struct rte_devargs *da, const char *format, ...) +rte_devargs_parse(struct rte_devargs *da, const char *format, ...) { struct rte_bus *bus = NULL; va_list ap; @@ -125,11 +125,11 @@ rte_eal_devargs_parse(struct rte_devargs *da, const char *format, ...) } int __rte_experimental -rte_eal_devargs_insert(struct rte_devargs *da) +rte_devargs_insert(struct rte_devargs *da) { int ret; - ret = rte_eal_devargs_remove(da->bus->name, da->name); + ret = rte_devargs_remove(da->bus->name, da->name); if (ret < 0) return ret; TAILQ_INSERT_TAIL(&devargs_list, da, next); @@ -149,7 +149,7 @@ rte_eal_devargs_add(enum rte_devtype devtype, const char *devargs_str) if (devargs == NULL) goto fail; - if (rte_eal_devargs_parse(devargs, "%s", dev)) + if (rte_devargs_parse(devargs, "%s", dev)) goto fail; devargs->type = devtype; bus = devargs->bus; @@ -174,7 +174,7 @@ fail: } int __rte_experimental -rte_eal_devargs_remove(const char *busname, const char *devname) +rte_devargs_remove(const char *busname, const char *devname) { struct rte_devargs *d; void *tmp; @@ -223,7 +223,7 @@ rte_eal_devargs_dump(FILE *f) /* bus-aware rte_devargs iterator. */ __rte_experimental struct rte_devargs * -rte_eal_devargs_next(const char *busname, const struct rte_devargs *start) +rte_devargs_next(const char *busname, const struct rte_devargs *start) { struct rte_devargs *da; diff --git a/lib/librte_eal/common/include/rte_devargs.h b/lib/librte_eal/common/include/rte_devargs.h index bfe4da4fda..0806f23193 100644 --- a/lib/librte_eal/common/include/rte_devargs.h +++ b/lib/librte_eal/common/include/rte_devargs.h @@ -120,9 +120,10 @@ int rte_eal_parse_devargs_str(const char *devargs_str, * - 0 on success. * - Negative errno on error. */ -int __rte_experimental -rte_eal_devargs_parse(struct rte_devargs *da, - const char *format, ...) +__rte_experimental +int +rte_devargs_parse(struct rte_devargs *da, + const char *format, ...) __attribute__((format(printf, 2, 0))); /** @@ -135,12 +136,13 @@ __attribute__((format(printf, 2, 0))); * - 0 on success * - Negative on error. */ -int __rte_experimental -rte_eal_devargs_insert(struct rte_devargs *da); +__rte_experimental +int +rte_devargs_insert(struct rte_devargs *da); /** * Add a device to the user device list - * See rte_eal_devargs_parse() for details. + * See rte_devargs_parse() for details. * * @param devtype * The type of the device. @@ -169,8 +171,9 @@ int rte_eal_devargs_add(enum rte_devtype devtype, const char *devargs_str); * <0 on error. * >0 if the devargs was not within the user device list. */ -int __rte_experimental rte_eal_devargs_remove(const char *busname, - const char *devname); +__rte_experimental +int rte_devargs_remove(const char *busname, + const char *devname); /** * Count the number of user devices of a specified type @@ -210,15 +213,15 @@ void rte_eal_devargs_dump(FILE *f); */ __rte_experimental struct rte_devargs * -rte_eal_devargs_next(const char *busname, const struct rte_devargs *start); +rte_devargs_next(const char *busname, const struct rte_devargs *start); /** * Iterate over all rte_devargs for a specific bus. */ #define RTE_EAL_DEVARGS_FOREACH(busname, da) \ - for (da = rte_eal_devargs_next(busname, NULL); \ + for (da = rte_devargs_next(busname, NULL); \ da != NULL; \ - da = rte_eal_devargs_next(busname, da)) \ + da = rte_devargs_next(busname, da)) \ #ifdef __cplusplus } diff --git a/lib/librte_eal/rte_eal_version.map b/lib/librte_eal/rte_eal_version.map index beb616db51..d33fbe9390 100644 --- a/lib/librte_eal/rte_eal_version.map +++ b/lib/librte_eal/rte_eal_version.map @@ -217,11 +217,11 @@ EXPERIMENTAL { rte_dev_event_callback_unregister; rte_dev_event_monitor_start; rte_dev_event_monitor_stop; + rte_devargs_insert; + rte_devargs_next; + rte_devargs_parse; + rte_devargs_remove; rte_eal_cleanup; - rte_eal_devargs_insert; - rte_eal_devargs_next; - rte_eal_devargs_parse; - rte_eal_devargs_remove; rte_eal_hotplug_add; rte_eal_hotplug_remove; rte_eal_mbuf_user_pool_ops; -- 2.20.1