[dpdk-dev] [PATCH v2 15/18] ether: use new devargs parsing function

Gaetan Rivet gaetan.rivet at 6wind.com
Thu Oct 12 10:21:22 CEST 2017


The previous one is being deprecated.

Signed-off-by: Gaetan Rivet <gaetan.rivet at 6wind.com>
---
 lib/librte_ether/rte_ethdev.c | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/lib/librte_ether/rte_ethdev.c b/lib/librte_ether/rte_ethdev.c
index bb08204..618f576 100644
--- a/lib/librte_ether/rte_ethdev.c
+++ b/lib/librte_ether/rte_ethdev.c
@@ -372,21 +372,24 @@ rte_eth_dev_is_detachable(uint16_t port_id)
 
 /* attach the new device, then store port_id of the device */
 int
-rte_eth_dev_attach(const char *devargs, uint16_t *port_id)
+rte_eth_dev_attach(const char *devstr, uint16_t *port_id)
 {
 	int ret = -1;
 	int current = rte_eth_dev_count();
+	struct rte_devargs devargs;
 	char *name = NULL;
 	char *args = NULL;
 
-	if ((devargs == NULL) || (port_id == NULL)) {
+	if ((devstr == NULL) || (port_id == NULL)) {
 		ret = -EINVAL;
 		goto err;
 	}
 
-	/* parse devargs, then retrieve device name and args */
-	if (rte_eal_parse_devargs_str(devargs, &name, &args))
+	/* parse device, then retrieve device name and args */
+	if (rte_eal_devargs_parse(&devargs, "%s", devstr))
 		goto err;
+	name = devargs.name;
+	args = devargs.args;
 
 	ret = rte_eal_dev_attach(name, args);
 	if (ret < 0)
-- 
2.1.4



More information about the dev mailing list