From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr0-f193.google.com (mail-wr0-f193.google.com [209.85.128.193]) by dpdk.org (Postfix) with ESMTP id 758A72C8 for ; Wed, 23 May 2018 14:11:38 +0200 (CEST) Received: by mail-wr0-f193.google.com with SMTP id w3-v6so18343719wrl.12 for ; Wed, 23 May 2018 05:11:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=envKvAY/JF1HF8QGLyRR8RsUgVosH00HLGkeMBGkP3Q=; b=tmqtWi7T6vLzrGG6vuwPGzJ8Xp5/B99SfX1E6SsV1cwkNfQExJZhKa+Elrf0xGNdlp /EGDJ7/1gdWCWZf/ChuXvIB0+KugTuaft5rY9Ep8tVemQ6if1t961cJbQYANVZ2ilX+Y qxXKlrI4SPg/x2QOa4OP5zZxvddGvrHluPLpjIo58uYPW0w5ukO0GzWJXqJZsA7zu1dU uDbh1Yu3hTQHRFx0DOHRruaTJQkCR+RRRNQxeK+cMNlx7t8fDFcnDmBXAMgJIo6EOdUf ouly+m6A71/O9mZJ2THDkp4RUC/VyiVFAMd/e59nuVW/WmGJe3YEBZEBpYEMK9Pb1zHF aS3w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=envKvAY/JF1HF8QGLyRR8RsUgVosH00HLGkeMBGkP3Q=; b=IlS8GzXeSDvXSDdFRL5+0Xg5h0S/K0Wah/0q5CA9nFGsAxL1n8QtCkqQvtBmCCSbNN Mwx98cS76qAcWrMubUyJ+oGg0DJguJCfFiBHplruPe374D28sPsw2khWvgDedx4nJoZN Jud6Qw0PUr0gDpqjo5GRzqw+Ek1vh2vTr3p4Hc6L6jCtaV+66776vK8pvCrR4gwN/iIx kRBPOa7PY+QLVEmkka5G+LwG+g41Maukegde4o7xyrq/LDeq+OO3s4dh1QfkSCMSPCIS /mgNYe7AeBiJH246mDSA/LYtJUEHIATezMAyA4SgaC2Rd07FW6QFrRCGAuCXul5U4OPz eVDw== X-Gm-Message-State: ALKqPwenjHxwbl/TOFo+0QLtZcvdh74k+pTm+peNFqFmR0nQ9GPKMuRp jyN2GdyPXRVdbjFo901Ajl2wmBUFLFY= X-Google-Smtp-Source: AB8JxZpty+CSlK9Sy8/irf4YBL6LUCCNEfG1gzMCxwLIk4LalkpjCrfp59M3/OCHjQJHjDxVlSXYiA== X-Received: by 2002:adf:85b8:: with SMTP id 53-v6mr2437354wrt.31.1527077498131; Wed, 23 May 2018 05:11:38 -0700 (PDT) Received: from localhost ([2a00:23c5:be9a:5200:ce4c:82c0:d567:ecbb]) by smtp.gmail.com with ESMTPSA id l69-v6sm3994689wmb.30.2018.05.23.05.11.37 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 23 May 2018 05:11:37 -0700 (PDT) From: luca.boccassi@gmail.com To: Matan Azrad Cc: dpdk stable Date: Wed, 23 May 2018 13:10:02 +0100 Message-Id: <20180523121010.8385-51-luca.boccassi@gmail.com> X-Mailer: git-send-email 2.14.2 In-Reply-To: <20180523121010.8385-1-luca.boccassi@gmail.com> References: <20180516101323.2234-2-luca.boccassi@gmail.com> <20180523121010.8385-1-luca.boccassi@gmail.com> Subject: [dpdk-stable] patch 'net/vdev_netvsc: fix automatic probing' has been queued to stable release 18.02.2 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: Wed, 23 May 2018 12:11:38 -0000 Hi, FYI, your patch has been queued to stable release 18.02.2 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 05/25/18. So please shout if anyone has objections. Thanks. Luca Boccassi --- >>From 408bea9a5b6920d89dac9e151297e6b5a1dd2248 Mon Sep 17 00:00:00 2001 From: Matan Azrad Date: Mon, 21 May 2018 16:23:30 +0000 Subject: [PATCH] net/vdev_netvsc: fix automatic probing [ upstream commit 83d63f0903b3951c76a4508693e8bade582b28b0 ] 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") 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 f746433b5..bdd02e09c 100644 --- a/drivers/net/vdev_netvsc/vdev_netvsc.c +++ b/drivers/net/vdev_netvsc/vdev_netvsc.c @@ -38,6 +38,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" @@ -797,7 +798,8 @@ static int 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); } /** @@ -813,7 +815,8 @@ vdev_netvsc_scan_callback(__rte_unused void *arg) struct rte_bus *vbus = rte_bus_find_by_name("vdev"); TAILQ_FOREACH(devargs, &devargs_list, next) - 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); -- 2.14.2