From mboxrd@z Thu Jan 1 00:00:00 1970 From: Matan Azrad Subject: [PATCH 2/3] net/vdev_netvsc: add check for specifying by 1 way Date: Tue, 10 Apr 2018 13:32:07 +0000 Message-ID: <1523367128-32317-3-git-send-email-matan@mellanox.com> References: <1523367128-32317-1-git-send-email-matan@mellanox.com> Mime-Version: 1.0 Content-Type: text/plain Cc: Ferruh Yigit , stable@dpdk.org To: dev@dpdk.org Return-path: In-Reply-To: <1523367128-32317-1-git-send-email-matan@mellanox.com> List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 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 --- drivers/net/vdev_netvsc/vdev_netvsc.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/net/vdev_netvsc/vdev_netvsc.c b/drivers/net/vdev_netvsc/vdev_netvsc.c index d2c41a5..018ffae 100644 --- a/drivers/net/vdev_netvsc/vdev_netvsc.c +++ b/drivers/net/vdev_netvsc/vdev_netvsc.c @@ -702,6 +702,11 @@ static LIST_HEAD(, vdev_netvsc_ctx) vdev_netvsc_ctx_list = 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, -- 1.9.5