net/vdev_netvsc: add check for specifying by 1 way
authorMatan Azrad <matan@mellanox.com>
Tue, 10 Apr 2018 13:32:07 +0000 (13:32 +0000)
committerFerruh Yigit <ferruh.yigit@intel.com>
Fri, 27 Apr 2018 16:34:42 +0000 (17:34 +0100)
There are now 2 ways to specify a netvsc device by the EAL command
line - either by the interface name or by the MAC address.

The user should not specify a netvsc device using more than 1 way,
Thus, if a device is specified in more than 1 way, the driver stops
to probe it.

Validate it in the driver initialization.

Cc: stable@dpdk.org
Signed-off-by: Matan Azrad <matan@mellanox.com>
drivers/net/vdev_netvsc/vdev_netvsc.c

index ed040be..79d1324 100644 (file)
@@ -702,6 +702,11 @@ vdev_netvsc_vdev_probe(struct rte_vdev_device *dev)
                        rte_kvargs_free(kvargs);
                return 0;
        }
+       if (specified > 1) {
+               DRV_LOG(ERR, "More than one way used to specify the netvsc"
+                       " device.");
+               goto error;
+       }
        rte_eal_alarm_cancel(vdev_netvsc_alarm, NULL);
        /* Gather interfaces. */
        ret = vdev_netvsc_foreach_iface(vdev_netvsc_netvsc_probe, name, kvargs,