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 0BAB21DBF for ; Tue, 24 Apr 2018 00:41:47 +0200 (CEST) Received: by mail-wr0-f193.google.com with SMTP id v15-v6so27340724wrm.10 for ; Mon, 23 Apr 2018 15:41:47 -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=hB5rho0X2ukQIcanxMEOomwjSZQOstQEaEilnwhGIl0=; b=Xt0MkM94gmYlNP3UduwarD5IsLCv/b7qRHD/OV5RAjXIDEiHggm0jqQCoA998bGWK5 cy0w2x1MqPuv5ADmZ6Eu65kC6XwoLVOs2tfADRewNETbdJOcUVatIvfN6Soccv2IRgek 5rHN/VRqrfn77dB+iqpyE3cywv5RV11IAXWX9KHQ/GdpktyoemEd6xYGnU3Sa7vwVcu1 6MKJ+TCVP9y0N87Zxx7Xmf4Jfkv18Jrkk3xxvS4NogSXueX72muW9+j+udatF1eBCzl4 //6B4A3jpXl2dWKOgtEQISIAZUjjC4iB4OjHn/4TErFPS65ayHYeXkpMg55ni7Ve/IEW luVw== 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=hB5rho0X2ukQIcanxMEOomwjSZQOstQEaEilnwhGIl0=; b=lmuuoCXT8+Q149B8vmuGvCFytiEK6UJLagp2reb0sjn7HM4GJYoy9ndg9gnHvNIqAf c05bSC3bpJBB/5Rr6XxgTv6IjOhcXhtQJx05MY03aq56+u+7OVW//14/8TE9WIGAQHFf qoDKZAEmSIzaJKw2+aPoUtGw8A7euSbz8OzeztwynMEp4TcUCBdl1BoiR6RLTNvq0++J Z0WOmzUtS57gl7R083TmvpHstslKuHbVL0yy5eSCfUMGBxnoPJ4i6kIvEHfdWoFzqNKD SoHNlsUckDJbmza4RORTv666KjeEtrjJb+nyxxn6EkOsM1v+aOV4oOozBECPRGXHC+iP oLvg== X-Gm-Message-State: ALQs6tBbNNqBmOtuFCSz9Vm1pJA5FMfBJyYpgsguCYOclmQTQ19JIU/3 HVrt9GLVSnb7W9FSarcsorUioL1D X-Google-Smtp-Source: AIpwx4/mYUA6860HIoZ8b54sYhUx6BsDD3jamNesbxMErBqYyYTat4CLCbVDwxAaGBDFas3aJH7dhQ== X-Received: by 2002:adf:e802:: with SMTP id o2-v6mr9201218wrm.123.1524523306202; Mon, 23 Apr 2018 15:41:46 -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 x189sm1590705wmg.0.2018.04.23.15.41.44 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 23 Apr 2018 15:41:44 -0700 (PDT) From: Gaetan Rivet To: dev@dpdk.org Cc: Gaetan Rivet Date: Tue, 24 Apr 2018 00:41:09 +0200 Message-Id: <2e531df113cd9d4a6ac97dcbd040758c2e8b9e4c.1524522515.git.gaetan.rivet@6wind.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: References: In-Reply-To: References: Subject: [dpdk-dev] [PATCH v4 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: Mon, 23 Apr 2018 22:41:47 -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 d100f3232..f7a2148ef 100644 --- a/drivers/bus/vdev/vdev.c +++ b/drivers/bus/vdev/vdev.c @@ -228,7 +228,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; @@ -278,7 +278,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; @@ -297,7 +297,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 5edc061e8..2c002b164 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 c11621e93..ee89236f1 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 809d6649d..61cb3b162 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 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 4054fc111..526b0d95c 100644 --- a/lib/librte_eal/rte_eal_version.map +++ b/lib/librte_eal/rte_eal_version.map @@ -217,10 +217,10 @@ EXPERIMENTAL { rte_dev_event_monitor_start; rte_dev_event_monitor_stop; 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