From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by dpdk.org (Postfix) with ESMTP id EFB312BA5; Mon, 12 Mar 2018 03:51:24 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga106.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 11 Mar 2018 19:51:23 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.47,459,1515484800"; d="scan'208";a="34179673" Received: from tanjianf-mobl.ccr.corp.intel.com (HELO [10.255.27.216]) ([10.255.27.216]) by orsmga003.jf.intel.com with ESMTP; 11 Mar 2018 19:51:21 -0700 To: Nachiketa Prachanda References: <1520634518-3055-1-git-send-email-nprachan@vyatta.att-mail.com> Cc: dev@dpdk.org, jblunck@infradead.org, stable@dpdk.org From: "Tan, Jianfeng" Message-ID: Date: Mon, 12 Mar 2018 10:51:20 +0800 User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 In-Reply-To: <1520634518-3055-1-git-send-email-nprachan@vyatta.att-mail.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-stable] [PATCH] vdev: fix name comparison in find_vdev 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, 12 Mar 2018 02:51:26 -0000 Hi, On 3/10/2018 6:28 AM, Nachiketa Prachanda wrote: > Use strcmp to compare device names as the strncmp in original code > causes find_vdev to return -EEXIST for names that are prefix > of another. The creation of interfaces fails unpredictably based > on the order of their creation. An easy way hit this bug is to create > eth_vhost1 after eth_vhost11. > > Signed-off-by: Nachiketa Prachanda Except a nit bellow: Acked-by: Jianfeng Tan > > Fixes: dda987315ca2 ("vdev: make virtual bus use its device struct") > Cc: jblunck@infradead.org > Cc: stable@dpdk.org AFAIK, we usually put above line before Signed-off-by. > --- > drivers/bus/vdev/vdev.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/bus/vdev/vdev.c b/drivers/bus/vdev/vdev.c > index e4bc724..7eae319 100644 > --- a/drivers/bus/vdev/vdev.c > +++ b/drivers/bus/vdev/vdev.c > @@ -188,7 +188,7 @@ find_vdev(const char *name) > TAILQ_FOREACH(dev, &vdev_device_list, next) { > const char *devname = rte_vdev_device_name(dev); > > - if (!strncmp(devname, name, strlen(name))) > + if (!strcmp(devname, name)) > return dev; > } >