From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr0-f194.google.com (mail-wr0-f194.google.com [209.85.128.194]) by dpdk.org (Postfix) with ESMTP id 99DE31066 for ; Tue, 24 Apr 2018 01:55:25 +0200 (CEST) Received: by mail-wr0-f194.google.com with SMTP id z73-v6so45762310wrb.0 for ; Mon, 23 Apr 2018 16:55:25 -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=HwG9X88V2nj7qTLxVxUhQyBJSyW0KO+lIEDbN966GPg=; b=B+r0s+EoGzeb6QLGOeefOcEb3SVCdlZA7aZQiSmQfhmGrRWddFR/rgbA63oJCnLX8T TMliy8gDC01ZxIIAO7NSIUcaLnftRh2QhID++zN6Ds4cVKRmu0GTttxDrcwf/xTGCrGO iTsEUhnvmayadi0HOyaR2u64QnSh8RBWF3QfWi7kIzQFfTHK6At5ZmGJmkERc1T5u/DU mjOZi505gCzqhd8H6E3cSLuYzuvgfjtcPCcTN9jhqR0jx6XHls76FUXJlz/u8aUoMmrU 7N+fWn0VG6m2TdzlKNFfGV4Z37R/IINhBJ3j91PsluumN2bgPJwLrvrFp4N+WeuMdno0 FsZQ== 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=HwG9X88V2nj7qTLxVxUhQyBJSyW0KO+lIEDbN966GPg=; b=C8j/niXjOkZWi43XlseVx3vTpSJN+XEkEVJWzmQFEG5RBv5InRT8oiEfoz4fuB9FKr KEO5wX03YlbbG6QkoQOJRFJ3AkA3FXHThcxoX7MUYtyfYSTi0SQYmcQ6vUA507ExWhi7 jDxW2TxxmxFqydGUiaQHs95lyYPsHj8JIo/BRCNGaCP6q6sTwtxDuYEdgBvmAIOfolZX K1qXgeOaJT1+oGhdOfRQwwvQRfrgyMRGxTLJ7xOK9I4PEI6p/nCsjz1IlISkRA8uIEDi tsjS3TBUz82dlhl2HBCjiCP/GqnrriFd7wZdS9yDvf3RM6KRMe7HVKtrsdp9NXaJRfI+ dVmw== X-Gm-Message-State: ALQs6tCKfkb8RurARNllyztip2gV/mZspalKnhT2BmVkqFJqaXKO437a yRnhh97RNIHIPvv8WFiVz3dMcvXC X-Google-Smtp-Source: AIpwx4+s9tBtwgDgmZ0TPjTblMWeFKojQdiIOnFAiqiqKbli1bfh7TVbZPqohJE2SN7Jfz5Nm2EaRw== X-Received: by 10.28.13.205 with SMTP id 196mr11103592wmn.73.1524527724738; Mon, 23 Apr 2018 16:55:24 -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 55-v6sm28922279wrw.52.2018.04.23.16.55.23 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 23 Apr 2018 16:55:23 -0700 (PDT) From: Gaetan Rivet To: dev@dpdk.org Cc: Gaetan Rivet Date: Tue, 24 Apr 2018 01:54:51 +0200 Message-Id: X-Mailer: git-send-email 2.11.0 In-Reply-To: References: In-Reply-To: References: Subject: [dpdk-dev] [PATCH v5 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 23:55:26 -0000 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 | 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 | 25 ++++++++++++++----------- lib/librte_eal/rte_eal_version.map | 8 ++++---- 7 files changed, 33 insertions(+), 30 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 bfe4da4fd..0806f2319 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 4054fc111..67f8dd4fa 100644 --- a/lib/librte_eal/rte_eal_version.map +++ b/lib/librte_eal/rte_eal_version.map @@ -216,11 +216,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.11.0