From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR02-HE1-obe.outbound.protection.outlook.com (mail-eopbgr10046.outbound.protection.outlook.com [40.107.1.46]) by dpdk.org (Postfix) with ESMTP id DCB752B9E; Mon, 21 May 2018 18:23:48 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Mellanox.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=HFf8Rz35MDzTWoLtTWtqCucKvfdmUB0z44QHbrO4UCM=; b=iREtUE/+IBoUeghbQvL0l/8q7IaD3j2zZZ804SGbpvHphsPLYYf4oOk93fDSQO2pQduYtJfsrVRoYKiPSLtPdpeju/43KSjCBTVxPs17h9XgwX1kkaD/Kxfl3XKhMS/cN1lEEx004BDOYyH1f1Y+otkWjC2gibdsNx+lS7Tg/cg= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=matan@mellanox.com; Received: from mellanox.com (37.142.13.130) by AM5PR0501MB2594.eurprd05.prod.outlook.com (2603:10a6:203:d::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.776.11; Mon, 21 May 2018 16:23:47 +0000 From: Matan Azrad To: dev@dpdk.org Cc: Ferruh Yigit , stable@dpdk.org Date: Mon, 21 May 2018 16:23:30 +0000 Message-Id: <1526919810-24303-1-git-send-email-matan@mellanox.com> X-Mailer: git-send-email 1.9.5 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [37.142.13.130] X-ClientProxiedBy: VI1PR08CA0238.eurprd08.prod.outlook.com (2603:10a6:802:15::47) To AM5PR0501MB2594.eurprd05.prod.outlook.com (2603:10a6:203:d::9) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(5600026)(4534165)(4627221)(201703031133081)(201702281549075)(48565401081)(2017052603328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TAgP3db3qy4yuPmcObL0TRaGytXwAcESMq+D2SoiiEoGjDrhd6LRqfznhUVkjNmwaenekJhhxQsTKZ/wnznLS1rueAc6SRvuRQNGWPhTdVouKho4ywfwKZ1cwuSIu9CQpN3SHcy9pAVqJoG66A2u1Dg578FYJ5t32ANfbbK2cWvlmf9boqRLjq4Pi9S0RpFCX1R7vugBg1SK393iM2LNHFL5dSLWoJjorxsZsQ7VIKd/gnJmxrSo81D5hXcDYZ4bN+hx+Y1AFQ+mwhO3AlYvrQw59QqZLgFTMBG+ZV/bpvwOR4qx1xI33/HfQppodFbllIwDZMzglvWlUOYxh25iDwI4MySd9aLz7OSFVZXCxe7KgpaCaXf/tszhuz3Gh+l+AXz1RITiXi+/oQw34by9WqROyC36g4qFV8l/weWVxVIMnr0uXVRP/2m99; 4:24bo+NfXsiZlDA/EmAa28ZNvLHaadjZtKS0l9Go13slKLVLbuUQjZdua0lOHHFh/e3cijOCZvaBwLZ3IMGYRklqdZVrh7/EwS3UsJQOR3ZsWCFll18zb5mD6+EOIJH5Y1R3OE5ihPwEsfTNDWfjdTh6zdW81n4gZsb6wFGErO5NehOsfjjCKSbY1VFvH/hjNcD0EKOjB+l8+XUFNprU5pTE5SBd5B/llPDTwmEjp4dZqUHGB24W/tClCmSlbEa/XaA+XJC13pSqVvwvx3vTwPg== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(3002001)(10201501046)(93006095)(93001095)(3231254)(944501410)(52105095)(6055026)(149027)(150027)(6041310)(20161123558120)(20161123564045)(20161123560045)(20161123562045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(6072148)(201708071742011)(7699016); SRVR:AM5PR0501MB2594; BCL:0; PCL:0; RULEID:; SRVR:AM5PR0501MB2594; X-Forefront-PRVS: 06793E740F X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(396003)(366004)(346002)(376002)(39860400002)(39380400002)(199004)(189003)(956004)(2616005)(53936002)(68736007)(105586002)(7736002)(1857600001)(186003)(8936002)(86362001)(25786009)(55016002)(16526019)(305945005)(476003)(2906002)(486006)(21086003)(316002)(26005)(386003)(16586007)(106356001)(52116002)(478600001)(47776003)(6116002)(50226002)(6666003)(66066001)(97736004)(51416003)(7696005)(69596002)(8676002)(5660300001)(3846002)(50466002)(36756003)(4326008)(2361001)(6916009)(48376002)(33026002)(2351001)(81156014)(81166006); DIR:OUT; SFP:1101; SCL:1; SRVR:AM5PR0501MB2594; H:mellanox.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; Received-SPF: None (protection.outlook.com: mellanox.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; AM5PR0501MB2594; 23:wTQIObRzBVSXkoK02CJrselLT07ZFXxH9qXYwOI?= =?us-ascii?Q?Rv0pd1AuqHp+La9sEYrPx0yZePvEbpIqtNpdwrPlVPcbq8ovai93GxuZ00Dz?= =?us-ascii?Q?ITANrEMpvw0UuxETDNx13Uvpl0dsCZb2GMJvOH2ZGXvYLcWBqSHBASRqqn42?= =?us-ascii?Q?jcWYW5ZSE1gOSM0/lo7n/APxrghn+HzL+phEDy3IOgkoxNNMZHCybZnGzhb/?= =?us-ascii?Q?xvttgTA0T8N+LIznkS+WG2kezEsd3bT0X95WFfmyT3tixG8s/sHMDdK0Jzdg?= =?us-ascii?Q?lbGYVmwl4B3IvcQ0VUzMJ2xgV12UOWymUA0CzL07DTj4m7UqerebLQcC6kjb?= =?us-ascii?Q?7wC6TmqGLI6JyxY+IkxH9B2zHAsUVOiDjZE776m3dAvp1xNyxmDQoKwKKqHl?= =?us-ascii?Q?lMuRNaqaVzakEiC24hcOx5+2oXrqHhKTeW+wVir8IRA+ghI6wU+ZNrkeUcd4?= =?us-ascii?Q?AfyV2OUSqmLBW6mSJ3+H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yy3YQ7evhnVKCwV5U+wScOpF9KxyrALNrFMRurUN4EkuZkIEFEfYQoJIONYxW+ZGzA/UkJLRJDkSNaBA9hhuFFleKl0/A3grbrMGi21+8O0K4BAWTUYxeBL6Jje0m0TmAzrbgHADdVzPUlbET7sbyyFqZv8NhK X-MS-Office365-Filtering-Correlation-Id: d6ff74c1-b9f1-406e-cc3f-08d5bf373b0c X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 May 2018 16:23:47.1344 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: d6ff74c1-b9f1-406e-cc3f-08d5bf373b0c X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM5PR0501MB2594 Subject: [dpdk-stable] [PATCH] net/vdev_netvsc: fix automatic probing X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 May 2018 16:23:49 -0000 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 #define VDEV_NETVSC_ARG_IFACE "iface" #define VDEV_NETVSC_ARG_MAC "mac" #define VDEV_NETVSC_ARG_FORCE "force" @@ -798,7 +799,8 @@ static LIST_HEAD(, vdev_netvsc_ctx) vdev_netvsc_ctx_list = vdev_netvsc_cmp_rte_device(const struct rte_device *dev1, __rte_unused const void *_dev2) { - return strcmp(dev1->devargs->name, VDEV_NETVSC_DRIVER_NAME); + return strncmp(dev1->devargs->name, VDEV_NETVSC_DRIVER_NAME, + VDEV_NETVSC_DRIVER_NAME_LEN); } /** @@ -814,7 +816,8 @@ static LIST_HEAD(, vdev_netvsc_ctx) vdev_netvsc_ctx_list = struct rte_bus *vbus = rte_bus_find_by_name("vdev"); RTE_EAL_DEVARGS_FOREACH("vdev", devargs) - if (!strcmp(devargs->name, VDEV_NETVSC_DRIVER_NAME)) + if (!strncmp(devargs->name, VDEV_NETVSC_DRIVER_NAME, + VDEV_NETVSC_DRIVER_NAME_LEN)) return; dev = (struct rte_vdev_device *)vbus->find_device(NULL, vdev_netvsc_cmp_rte_device, VDEV_NETVSC_DRIVER_NAME); -- 1.9.5