From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <stephen@networkplumber.org>
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 <dev@dpdk.org>; Mon, 21 May 2018 18:52:17 +0200 (CEST)
Received: by mail-pl0-f68.google.com with SMTP id c41-v6so9123106plj.10
 for <dev@dpdk.org>; Mon, 21 May 2018 09:52:17 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=networkplumber-org.20150623.gappssmtp.com; s=20150623;
 h=date:from:to:cc:subject:message-id:in-reply-to:references
 :mime-version:content-transfer-encoding;
 bh=sAb+vYrlWcHNfR+IePrWPSL5HUnaxCQH1GspbZ1kkhM=;
 b=ASMqGRUD/oC1Rk5+bOcUqOd3YMAqQiYPYfH36U2M8zAI/TdbPflvFF2snXC58JLVde
 8RK2Ll2lLjtx3BBS/p+eCJynTl7ZqUciIQhq3buU2M3cIoy4rDmG37hVqVX0bpO8h94V
 qEwMZaCIOtk1CoQ+SInIiYUTxu54ybT8D9RweSQCvoQkEB7qRPUgzJh8oKbbiPf1t1VD
 0yfnmkeLmE8ET47jJRLz0SuSs47XSt3+wan2XQSturtBFo5luGTTz9pLa1Q4uIrSoPUh
 i/J2thzpJ+sR3mECLTeA54P5QG68nRQo9eKPttnJKVTg5KYfUaBvOzQyhK6VF806R/5P
 a7sA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to
 :references:mime-version:content-transfer-encoding;
 bh=sAb+vYrlWcHNfR+IePrWPSL5HUnaxCQH1GspbZ1kkhM=;
 b=E/dXvNYIhwD/UqFxKdbRlcOsnO3njtHXuyVQ3GrcngHGKl8cqNnQQLdrqfXYn7ns/C
 aHWYl9s0+k/kEYf96ujK3JmNZbDQHiyaPwFhsd3xyiyh482OYyRtXm96eqYO8X43VL35
 ypfalbIje2uPAbwnP6S/eH5aiAnfXHmOPANoBEHkrKCWWcBqa2aFJx/GJnWE1h75GcP3
 ZrzJBah5Oec4fD6IdWoLEJTDz9D6MxBrru+yx1iB/ZNv1VDArTEVlKQ7MMrgqX7VgYJ2
 cWQgKdcVjCF8A8YIABOiNhxnh+rh4d6jkvFM/N+KHze7LbW7+Pnv1RwPOXosTtTFHpsw
 zIAg==
X-Gm-Message-State: ALKqPwcA76SQBj/e43pl3ik9rZvjOuL/SR/ZgzI4G+O/mKgtLbRCWWpp
 s1VgdL0SdSTr1hfZVx++vgjzUQ==
X-Google-Smtp-Source: AB8JxZrZPZmE/hMck1V2+ajDanJJBswH+PTBqMJJWroKqSHUfeQ9ODej2DMCW5fckTWMeqMP4+NHPA==
X-Received: by 2002:a17:902:3f81:: with SMTP id
 a1-v6mr20847941pld.29.1526921536459; 
 Mon, 21 May 2018 09:52:16 -0700 (PDT)
Received: from xeon-e3 (204-195-35-107.wavecable.com. [204.195.35.107])
 by smtp.gmail.com with ESMTPSA id d62-v6sm20886589pga.29.2018.05.21.09.52.16
 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256);
 Mon, 21 May 2018 09:52:16 -0700 (PDT)
Date: Mon, 21 May 2018 09:52:14 -0700
From: Stephen Hemminger <stephen@networkplumber.org>
To: Matan Azrad <matan@mellanox.com>
Cc: dev@dpdk.org, Ferruh Yigit <ferruh.yigit@intel.com>, stable@dpdk.org
Message-ID: <20180521095214.2959d2c1@xeon-e3>
In-Reply-To: <1526919810-24303-1-git-send-email-matan@mellanox.com>
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
Subject: Re: [dpdk-dev] [PATCH] net/vdev_netvsc: fix automatic probing
X-BeenThere: dev@dpdk.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: DPDK patches and discussions <dev.dpdk.org>
List-Unsubscribe: <https://dpdk.org/ml/options/dev>,
 <mailto:dev-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://dpdk.org/ml/archives/dev/>
List-Post: <mailto:dev@dpdk.org>
List-Help: <mailto:dev-request@dpdk.org?subject=help>
List-Subscribe: <https://dpdk.org/ml/listinfo/dev>,
 <mailto:dev-request@dpdk.org?subject=subscribe>
X-List-Received-Date: Mon, 21 May 2018 16:52:17 -0000

On Mon, 21 May 2018 16:23:30 +0000
Matan Azrad <matan@mellanox.com> 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 <matan@mellanox.com>
> ---
>  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?