From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stephen Hemminger Subject: Re: [PATCH] net/vdev_netvsc: fix automatic probing Date: Mon, 21 May 2018 09:52:14 -0700 Message-ID: <20180521095214.2959d2c1@xeon-e3> References: <1526919810-24303-1-git-send-email-matan@mellanox.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: dev@dpdk.org, Ferruh Yigit , stable@dpdk.org To: Matan Azrad Return-path: Received: from mail-pl0-f68.google.com (mail-pl0-f68.google.com [209.85.160.68]) by dpdk.org (Postfix) with ESMTP id 4C1A71B1D1 for ; Mon, 21 May 2018 18:52:17 +0200 (CEST) Received: by mail-pl0-f68.google.com with SMTP id c41-v6so9123106plj.10 for ; Mon, 21 May 2018 09:52:17 -0700 (PDT) In-Reply-To: <1526919810-24303-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" On Mon, 21 May 2018 16:23:30 +0000 Matan Azrad wrote: > The vdev_netvsc driver allows an automatic probe in Hyper-V VM systems > unless it was already specified by the EAL command line. > > The detection of a specified NetVSC device is wrongly done by comparing > the vdev_netvsc driver name to all the vdev devices names, including > the suffix device index. Thus, if the user specifies the vdev_netvsc > device by adding an index to the device name, the comparison fails. > Consequently, the vdev_netvsc driver may automatically probe NetVSC > devices, despite the NetVSC device that was specified by the EAL command > line. > > Compare the vdev_netvsc driver name to the devices names without the > index. > > Fixes: 56252de779a6 ("net/vdev_netvsc: add automatic probing") > Cc: stable@dpdk.org > > Signed-off-by: Matan Azrad > --- > drivers/net/vdev_netvsc/vdev_netvsc.c | 7 +++++-- > 1 file changed, 5 insertions(+), 2 deletions(-) > > diff --git a/drivers/net/vdev_netvsc/vdev_netvsc.c b/drivers/net/vdev_netvsc/vdev_netvsc.c > index de2bd14..48717f2 100644 > --- a/drivers/net/vdev_netvsc/vdev_netvsc.c > +++ b/drivers/net/vdev_netvsc/vdev_netvsc.c > @@ -39,6 +39,7 @@ > > #define VDEV_NETVSC_DRIVER net_vdev_netvsc > #define VDEV_NETVSC_DRIVER_NAME RTE_STR(VDEV_NETVSC_DRIVER) > +#define VDEV_NETVSC_DRIVER_NAME_LEN 15 Looks correct, why did you not just use IFNAMSIZ which is commonly used across much of the network code?