#include <rte_bus.h>
#include <rte_bus_vdev.h>
#include <rte_common.h>
-#include <rte_config.h>
#include <rte_dev.h>
#include <rte_errno.h>
#include <rte_ethdev.h>
} else if (!strcmp(pair->key, VDEV_NETVSC_ARG_MAC)) {
struct rte_ether_addr tmp;
- if (sscanf(pair->value,
- "%" SCNx8 ":%" SCNx8 ":%" SCNx8 ":"
- "%" SCNx8 ":%" SCNx8 ":%" SCNx8,
- &tmp.addr_bytes[0],
- &tmp.addr_bytes[1],
- &tmp.addr_bytes[2],
- &tmp.addr_bytes[3],
- &tmp.addr_bytes[4],
- &tmp.addr_bytes[5]) != 6) {
+ if (rte_ether_unformat_addr(pair->value, &tmp) != 0) {
DRV_LOG(ERR,
"invalid MAC address format"
" \"%s\"",
ctx->devname, ctx->devargs);
vdev_netvsc_foreach_iface(vdev_netvsc_device_probe, 0, ctx);
ret = rte_eal_hotplug_add("vdev", ctx->devname, ctx->devargs);
- if (ret)
+ if (ret < 0)
goto error;
LIST_INSERT_HEAD(&vdev_netvsc_ctx_list, ctx, entry);
++vdev_netvsc_ctx_count;