[dpdk-dev,v2,15/18] ether: use new devargs parsing function
Checks
Commit Message
The previous one is being deprecated.
Signed-off-by: Gaetan Rivet <gaetan.rivet@6wind.com>
---
lib/librte_ether/rte_ethdev.c | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
@@ -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)