From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr0-f193.google.com (mail-wr0-f193.google.com [209.85.128.193]) by dpdk.org (Postfix) with ESMTP id 61C484C93 for ; Wed, 21 Mar 2018 00:20:45 +0100 (CET) Received: by mail-wr0-f193.google.com with SMTP id o1so3390403wro.10 for ; Tue, 20 Mar 2018 16:20:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6wind-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :in-reply-to:references; bh=Up7ZWcGHackg8cVymmNBqL8aGIzQZWOKPsxbxtkhAv8=; b=qJ1h16u4gLJTnwefT/wJx5Hp07WD6RS5/ElmlE96qVZAXMcMdDI7ix4fvvqrQlbO/c ZrilSQxHT/oPbUZ/f8ZoVgG49H5VVZvFXgEUJ151+DfrcGZq0vx7aTo8Km5cQDH3RUN1 XWMM3WbwXvQNVhMxxqthkKQKbg5B01jHDs8PcbGS1htsjwQz/U2NQ3xqf+LCbYaMmM8B /q5ZwE/7vmDA+MNXi95GPDIynNCciPBQTKeVpYctGpV8kjPlnSJWp/YVNtnDiZR9jvSg M+9G7jbhtB/6eEWkkHleKJB0tk6rWWgN672gC7dzEApyhL5LYPrX9CMrIobGyHIgUmuI FYmQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:in-reply-to:references; bh=Up7ZWcGHackg8cVymmNBqL8aGIzQZWOKPsxbxtkhAv8=; b=nnDK8IIGcKzNL33Pd0ggiy0mUioJ8k3SthXM+qLqRpslDfmOolxrZKaO+aOBCLoNOi 6hsmOl9F2nKOqMEvmaMTAxj17YCXDku3wZ3i8RKRpY0exMVU/8QJOaA/HW9b70l/x1mq c1KoVj2j7aXp//sWo3yw/25yvNx+NK0A8zTARlUR8P87oLfAW3jZZjakgsuRRaxN6Lq/ 7DzI2baX2BTSV+rAdskytHzXOE7Ss5rUi2aTRvoiTOWmimVJX7G9GdVJT6net8a73TBb QiTGAw1fzmq36lD0KY/M23cgdxVWnO1nk4aeb4KCAM5aV3ZWOScIneYz2tEpK5q05NSE qowA== X-Gm-Message-State: AElRT7GTrPjF6qVRtgXXRHjiHvSM1yOmtSufrP6zvWhIcBPrLApKg+dR qeuaOLHk8o1bDWilzXim5tkPv+HB X-Google-Smtp-Source: AG47ELuUG2rp7sO8vWtnwOtOtV7P4/ASyrWHb4qhSs7f1DcWgFRVkzca0OPvxGUbQ6YbZ6QfKBe5EQ== X-Received: by 10.223.181.149 with SMTP id c21mr131411wre.233.1521588044568; Tue, 20 Mar 2018 16:20:44 -0700 (PDT) Received: from bidouze.dev.6wind.com. (host.78.145.23.62.rev.coltfrance.com. [62.23.145.78]) by smtp.gmail.com with ESMTPSA id m135sm3983479wma.2.2018.03.20.16.20.43 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 20 Mar 2018 16:20:43 -0700 (PDT) From: Gaetan Rivet To: dev@dpdk.org Cc: Gaetan Rivet Date: Wed, 21 Mar 2018 00:20:10 +0100 Message-Id: X-Mailer: git-send-email 2.11.0 In-Reply-To: References: In-Reply-To: References: Subject: [dpdk-dev] [PATCH v3 09/10] devargs: use proper namespace prefix X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Mar 2018 23:20:45 -0000 rte_eal_devargs is useless, rte_devargs is sufficient. Only experimental functions are changed for now. Signed-off-by: Gaetan Rivet --- drivers/bus/vdev/vdev.c | 6 +++--- 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 | 23 +++++++++++++---------- lib/librte_eal/rte_eal_version.map | 8 ++++---- 7 files changed, 32 insertions(+), 29 deletions(-) diff --git a/drivers/bus/vdev/vdev.c b/drivers/bus/vdev/vdev.c index 8ee264baf..4fcbd9c79 100644 --- a/drivers/bus/vdev/vdev.c +++ b/drivers/bus/vdev/vdev.c @@ -256,7 +256,7 @@ rte_vdev_init(const char *name, const char *args) goto fail; } - rte_eal_devargs_insert(devargs); + rte_devargs_insert(devargs); TAILQ_INSERT_TAIL(&vdev_device_list, dev, next); return 0; @@ -306,7 +306,7 @@ rte_vdev_uninit(const char *name) 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); return 0; @@ -325,7 +325,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 f303668bb..05773556c 100644 --- a/drivers/net/failsafe/failsafe_args.c +++ b/drivers/net/failsafe/failsafe_args.c @@ -62,7 +62,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 5adaabfeb..f382f5709 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 43e1fb767..07e3e1647 100644 --- a/lib/librte_eal/common/eal_common_dev.c +++ b/lib/librte_eal/common/eal_common_dev.c @@ -113,12 +113,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; @@ -143,7 +143,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); } @@ -179,6 +179,6 @@ 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 b251bb0a6..24d0f6f44 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 @@ rte_eal_devargs_add(enum rte_devtype devtype, const char *devargs_str) } 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 e261f7c69..07a4701b2 100644 --- a/lib/librte_eal/common/include/rte_devargs.h +++ b/lib/librte_eal/common/include/rte_devargs.h @@ -105,9 +105,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))); /** @@ -120,8 +121,9 @@ __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 @@ -162,8 +164,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 @@ -203,15 +206,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 8dab46ba6..1e614f088 100644 --- a/lib/librte_eal/rte_eal_version.map +++ b/lib/librte_eal/rte_eal_version.map @@ -214,10 +214,10 @@ EXPERIMENTAL { global: rte_eal_cleanup; - rte_eal_devargs_insert; - rte_eal_devargs_next; - rte_eal_devargs_parse; - rte_eal_devargs_remove; + rte_devargs_insert; + rte_devargs_next; + rte_devargs_parse; + rte_devargs_remove; rte_eal_hotplug_add; rte_eal_hotplug_remove; rte_eal_mbuf_user_pool_ops; -- 2.11.0