From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f49.google.com (mail-wm0-f49.google.com [74.125.82.49]) by dpdk.org (Postfix) with ESMTP id 5D1061B1F7 for ; Thu, 12 Oct 2017 10:22:02 +0200 (CEST) Received: by mail-wm0-f49.google.com with SMTP id k4so11008189wmc.1 for ; Thu, 12 Oct 2017 01:22:02 -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=J0NhcHLErKTko9NnymN8AfVTbdsNH+4plbnzqg/ll88=; b=opSZqN6dtqhxLYGQAnyNgZh5+6kN/4dZ9iFXUE91ddZsDeq/0J15/K53VRh6u0m6TX e+mqAkxUpgIaNgheRWH/OhE114XJVWjNFC4+mNGiu4uYwCZBVM3mX47B3r8wRKya4nI2 1pRlkMCAL4Y3Mjgu5NHEx+avBwjGkHAGYxZUj3GZA4Srdf6stU22Xwb6ds+lDgVuyHvc nzktBWS+K1dRZ2Rd4Da2NMFRRcD9X0Fbmq0Ig5cBkT0JZuXX9sjZ6y+NRsP4wabrMK8n uuTcFumRTT876HgzxFwtGh4vflJxaRZj3MLFVOWce/AA4+mqwotjKtrTGE4/KbB/eiR3 pbYg== 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=J0NhcHLErKTko9NnymN8AfVTbdsNH+4plbnzqg/ll88=; b=Jz2pA0EogXUphQ9pUCIFeINDY40rZgv4T4BSN9BWWcWvIM2RDuxsJrTRU7m2x74JQ5 tlst+dGLL1gc2CHPEZn4aszLqFvqC/VyVpRXjghcsNUXQHH8W27Sr4/7BdkosXQD+zQJ W4wcuH2FmdnIrIVxOLwF2Enk/RvuQcjA+O6x/aDSYJp7su38RXqCJaoOFkHuIQ/E4siF tGQA+/4lbmqkZ3PbzBW+gnCmx94FEUY/WMWeGQ+S2gpRSBBouUbb6HuNnmzBOa4TIbp0 0/4XpCVb/GQjkMO81M3cDhxvVQmTu5ff9Y6cnvLv1XRncWSZzOKMM4IwAfIN7Qu7FRla Kt2Q== X-Gm-Message-State: AMCzsaX/Dw+4djVQuJuFdcCARq2U+7U7PEvXUTv1LJRGMEWJIM5gtM6L 8e+6ap/6HP3cad/lFMSwfPcm0Zzx X-Google-Smtp-Source: AOwi7QBXHjo/eoNnabW1jqB8LVmC1RLXmx++PHme17wXCv1YBZUW4DxzOD33XCOV7ft6GJu95BtWtw== X-Received: by 10.28.130.69 with SMTP id e66mr1056812wmd.54.1507796521466; Thu, 12 Oct 2017 01:22:01 -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 200sm19424728wmu.44.2017.10.12.01.22.00 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 12 Oct 2017 01:22:00 -0700 (PDT) From: Gaetan Rivet To: dev@dpdk.org Cc: Gaetan Rivet Date: Thu, 12 Oct 2017 10:21:24 +0200 Message-Id: X-Mailer: git-send-email 2.1.4 In-Reply-To: References: In-Reply-To: References: Subject: [dpdk-dev] [PATCH v2 17/18] devargs: use proper 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: Thu, 12 Oct 2017 08:22:02 -0000 rte_eal_devargs is redundant. Make it concise. Signed-off-by: Gaetan Rivet --- app/test-pmd/cmdline.c | 2 +- drivers/net/failsafe/failsafe_args.c | 4 ++-- examples/bond/main.c | 2 +- lib/librte_eal/bsdapp/eal/rte_eal_version.map | 12 ++++++------ lib/librte_eal/common/eal_common_dev.c | 8 ++++---- lib/librte_eal/common/eal_common_devargs.c | 18 +++++++++--------- lib/librte_eal/common/eal_common_options.c | 4 ++-- lib/librte_eal/common/eal_common_vdev.c | 4 ++-- lib/librte_eal/common/include/rte_devargs.h | 18 +++++++++--------- lib/librte_eal/linuxapp/eal/rte_eal_version.map | 12 ++++++------ lib/librte_ether/rte_ethdev.c | 2 +- test/test/commands.c | 2 +- 12 files changed, 44 insertions(+), 44 deletions(-) diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c index 1204604..3b338e5 100644 --- a/app/test-pmd/cmdline.c +++ b/app/test-pmd/cmdline.c @@ -8322,7 +8322,7 @@ static void cmd_dump_parsed(void *parsed_result, else if (!strcmp(res->dump, "dump_mempool")) rte_mempool_list_dump(stdout); else if (!strcmp(res->dump, "dump_devargs")) - rte_eal_devargs_dump(stdout); + rte_devargs_dump(stdout); else if (!strcmp(res->dump, "dump_log_types")) rte_log_dump(stdout); } diff --git a/drivers/net/failsafe/failsafe_args.c b/drivers/net/failsafe/failsafe_args.c index 0c98264..79c90cf 100644 --- a/drivers/net/failsafe/failsafe_args.c +++ b/drivers/net/failsafe/failsafe_args.c @@ -93,10 +93,10 @@ fs_parse_device(struct sub_device *sdev, char *args) bus = rte_bus_find_by_device_name(args); if (bus == NULL) /* args may contain the bus name */ - ret = rte_eal_devargs_parse(d, "%s", args); + ret = rte_devargs_parse(d, "%s", args); else /* args is a device name */ - ret = rte_eal_devargs_parse(d, "%s:%s", + ret = rte_devargs_parse(d, "%s:%s", bus->name, args); if (ret) { DEBUG("devargs parsing failed with code %d", ret); diff --git a/examples/bond/main.c b/examples/bond/main.c index cb55552..420ba1f 100644 --- a/examples/bond/main.c +++ b/examples/bond/main.c @@ -744,7 +744,7 @@ main(int argc, char *argv[]) /* init EAL */ ret = rte_eal_init(argc, argv); - rte_eal_devargs_dump(stdout); + rte_devargs_dump(stdout); if (ret < 0) rte_exit(EXIT_FAILURE, "Error with EAL initialization\n"); argc -= ret; diff --git a/lib/librte_eal/bsdapp/eal/rte_eal_version.map b/lib/librte_eal/bsdapp/eal/rte_eal_version.map index aae8d32..0913a52 100644 --- a/lib/librte_eal/bsdapp/eal/rte_eal_version.map +++ b/lib/librte_eal/bsdapp/eal/rte_eal_version.map @@ -19,8 +19,6 @@ DPDK_2.0 { rte_dump_tailq; rte_eal_alarm_cancel; rte_eal_alarm_set; - rte_eal_devargs_add; - rte_eal_devargs_dump; rte_eal_get_configuration; rte_eal_get_lcore_state; rte_eal_get_physmem_layout; @@ -186,10 +184,12 @@ DPDK_17.08 { EXPERIMENTAL { global: - rte_eal_devargs_insert; - rte_eal_devargs_next; - rte_eal_devargs_parse; - rte_eal_devargs_remove; + rte_devargs_add; + rte_devargs_dump; + rte_devargs_insert; + rte_devargs_next; + rte_devargs_parse; + rte_devargs_remove; rte_eal_hotplug_add; rte_eal_hotplug_remove; rte_service_component_register; diff --git a/lib/librte_eal/common/eal_common_dev.c b/lib/librte_eal/common/eal_common_dev.c index b965e56..5608690 100644 --- a/lib/librte_eal/common/eal_common_dev.c +++ b/lib/librte_eal/common/eal_common_dev.c @@ -151,12 +151,12 @@ int rte_eal_hotplug_add(const char *busname, const char *devname, 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; @@ -181,7 +181,7 @@ int rte_eal_hotplug_add(const char *busname, const char *devname, return 0; err_devarg: - if (rte_eal_devargs_remove(busname, devname)) { + if (rte_devargs_remove(busname, devname)) { free(da->args); free(da); } @@ -216,6 +216,6 @@ int 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 82c8573..d5e36d2 100644 --- a/lib/librte_eal/common/eal_common_devargs.c +++ b/lib/librte_eal/common/eal_common_devargs.c @@ -60,7 +60,7 @@ bus_name_cmp(const struct rte_bus *bus, const void *name) } int -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; @@ -112,11 +112,11 @@ rte_eal_devargs_parse(struct rte_devargs *da, const char *format, ...) } int -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); @@ -124,7 +124,7 @@ rte_eal_devargs_insert(struct rte_devargs *da) } int -rte_eal_devargs_add(const char *dev) +rte_devargs_add(const char *dev) { struct rte_devargs *devargs = NULL; @@ -132,9 +132,9 @@ rte_eal_devargs_add(const char *dev) if (devargs == NULL) goto fail; - if (rte_eal_devargs_parse(devargs, "%s", dev)) + if (rte_devargs_parse(devargs, "%s", dev)) goto fail; - if (rte_eal_devargs_insert(devargs)) + if (rte_devargs_insert(devargs)) goto fail; return 0; @@ -148,7 +148,7 @@ rte_eal_devargs_add(const char *dev) } int -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; @@ -167,7 +167,7 @@ rte_eal_devargs_remove(const char *busname, const char *devname) /* dump the user devices on the console */ void -rte_eal_devargs_dump(FILE *f) +rte_devargs_dump(FILE *f) { struct rte_devargs *devargs; @@ -181,7 +181,7 @@ rte_eal_devargs_dump(FILE *f) /* bus-aware rte_devargs iterator. */ 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/eal_common_options.c b/lib/librte_eal/common/eal_common_options.c index b7591fd..a3238fb 100644 --- a/lib/librte_eal/common/eal_common_options.c +++ b/lib/librte_eal/common/eal_common_options.c @@ -181,7 +181,7 @@ eal_option_device_parse(void) TAILQ_FOREACH_SAFE(devopt, &devopt_list, next, tmp) { if (ret == 0) { - ret = rte_eal_devargs_add(devopt->arg); + ret = rte_devargs_add(devopt->arg); if (ret) RTE_LOG(ERR, EAL, "Unable to parse device '%s'\n", devopt->arg); @@ -1125,7 +1125,7 @@ eal_parse_common_option(int opt, const char *optarg, struct rte_devargs da; int ret; - if (rte_eal_devargs_parse(&da, optarg) < 0) + if (rte_devargs_parse(&da, optarg) < 0) return -1; ret = rte_bus_probe_mode_set(da.bus->name, RTE_BUS_PROBE_WHITELIST); diff --git a/lib/librte_eal/common/eal_common_vdev.c b/lib/librte_eal/common/eal_common_vdev.c index a7410a6..583648d 100644 --- a/lib/librte_eal/common/eal_common_vdev.c +++ b/lib/librte_eal/common/eal_common_vdev.c @@ -192,7 +192,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; @@ -242,7 +242,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; diff --git a/lib/librte_eal/common/include/rte_devargs.h b/lib/librte_eal/common/include/rte_devargs.h index 499f7e3..e46686d 100644 --- a/lib/librte_eal/common/include/rte_devargs.h +++ b/lib/librte_eal/common/include/rte_devargs.h @@ -92,8 +92,8 @@ struct rte_devargs { * - Negative errno on error. */ int -rte_eal_devargs_parse(struct rte_devargs *da, - const char *format, ...); +rte_devargs_parse(struct rte_devargs *da, + const char *format, ...); /** * Insert an rte_devargs in the global list. @@ -106,7 +106,7 @@ rte_eal_devargs_parse(struct rte_devargs *da, * - Negative on error. */ int -rte_eal_devargs_insert(struct rte_devargs *da); +rte_devargs_insert(struct rte_devargs *da); /** * Add a device to the user device list @@ -127,7 +127,7 @@ rte_eal_devargs_insert(struct rte_devargs *da); * - 0 on success * - A negative value on error */ -int rte_eal_devargs_add(const char *devargs_str); +int rte_devargs_add(const char *devargs_str); /** * Remove a device from the user device list. @@ -145,7 +145,7 @@ int rte_eal_devargs_add(const char *devargs_str); * <0 on error. * >0 if the devargs was not within the user device list. */ -int rte_eal_devargs_remove(const char *busname, const char *devname); +int rte_devargs_remove(const char *busname, const char *devname); /** * This function dumps the list of user device and their arguments. @@ -153,7 +153,7 @@ int rte_eal_devargs_remove(const char *busname, const char *devname); * @param f * A pointer to a file for output */ -void rte_eal_devargs_dump(FILE *f); +void rte_devargs_dump(FILE *f); /** * Find next rte_devargs matching the provided bus name. @@ -171,15 +171,15 @@ void rte_eal_devargs_dump(FILE *f); * NULL if there is none. */ 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/linuxapp/eal/rte_eal_version.map b/lib/librte_eal/linuxapp/eal/rte_eal_version.map index 323f799..87b9a3b 100644 --- a/lib/librte_eal/linuxapp/eal/rte_eal_version.map +++ b/lib/librte_eal/linuxapp/eal/rte_eal_version.map @@ -19,8 +19,6 @@ DPDK_2.0 { rte_dump_tailq; rte_eal_alarm_cancel; rte_eal_alarm_set; - rte_eal_devargs_add; - rte_eal_devargs_dump; rte_eal_get_configuration; rte_eal_get_lcore_state; rte_eal_get_physmem_layout; @@ -190,10 +188,12 @@ DPDK_17.08 { EXPERIMENTAL { global: - rte_eal_devargs_insert; - rte_eal_devargs_next; - rte_eal_devargs_parse; - rte_eal_devargs_remove; + rte_devargs_add; + rte_devargs_dump; + rte_devargs_insert; + rte_devargs_next; + rte_devargs_parse; + rte_devargs_remove; rte_eal_hotplug_add; rte_eal_hotplug_remove; rte_service_component_register; diff --git a/lib/librte_ether/rte_ethdev.c b/lib/librte_ether/rte_ethdev.c index 618f576..2f3f721 100644 --- a/lib/librte_ether/rte_ethdev.c +++ b/lib/librte_ether/rte_ethdev.c @@ -386,7 +386,7 @@ rte_eth_dev_attach(const char *devstr, uint16_t *port_id) } /* parse device, then retrieve device name and args */ - if (rte_eal_devargs_parse(&devargs, "%s", devstr)) + if (rte_devargs_parse(&devargs, "%s", devstr)) goto err; name = devargs.name; args = devargs.args; diff --git a/test/test/commands.c b/test/test/commands.c index 4097a33..1670f75 100644 --- a/test/test/commands.c +++ b/test/test/commands.c @@ -157,7 +157,7 @@ static void cmd_dump_parsed(void *parsed_result, else if (!strcmp(res->dump, "dump_mempool")) rte_mempool_list_dump(stdout); else if (!strcmp(res->dump, "dump_devargs")) - rte_eal_devargs_dump(stdout); + rte_devargs_dump(stdout); else if (!strcmp(res->dump, "dump_log_types")) rte_log_dump(stdout); } -- 2.1.4