From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by dpdk.org (Postfix) with ESMTP id 2226F1BD41 for ; Fri, 21 Dec 2018 07:59:49 +0100 (CET) X-Amp-Result: UNSCANNABLE X-Amp-File-Uploaded: False Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga103.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 20 Dec 2018 22:59:49 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.56,380,1539673200"; d="scan'208";a="103740058" Received: from jim-aorus.sh.intel.com (HELO localhost) ([10.67.102.207]) by orsmga008.jf.intel.com with ESMTP; 20 Dec 2018 22:59:48 -0800 Date: Fri, 21 Dec 2018 14:57:57 +0800 From: Yahui Cao To: Thomas Monjalon Cc: dev@dpdk.org, ferruh.yigit@intel.com, tiwei.bie@intel.com Message-ID: <20181221065757.GA24082@jim-aorus> References: <20181129071608.20820-1-yahui.cao@intel.com> <1682296.hbgUrQPOuL@xps> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1682296.hbgUrQPOuL@xps> User-Agent: Mutt/1.9.4 (2018-02-28) Subject: Re: [dpdk-dev] [PATCH] bus/vdev: add warning for duplicated vdev name X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Dec 2018 06:59:50 -0000 On Wed, Dec 19, 2018 at 03:26:36AM +0100, Thomas Monjalon wrote: > 29/11/2018 08:16, Yahui Cao: > > If duplicated vdev name is detected, print out a warning message. > > > > Signed-off-by: Yahui Cao > > --- > > drivers/bus/vdev/vdev.c | 2 ++ > > 1 file changed, 2 insertions(+) > > > > diff --git a/drivers/bus/vdev/vdev.c b/drivers/bus/vdev/vdev.c > > index 9c66bdc78..ff2db7d3f 100644 > > --- a/drivers/bus/vdev/vdev.c > > +++ b/drivers/bus/vdev/vdev.c > > @@ -462,6 +462,8 @@ vdev_scan(void) > > if (find_vdev(devargs->name)) { > > rte_spinlock_recursive_unlock(&vdev_device_list_lock); > > free(dev); > > + VDEV_LOG(WARNING, "duplicated vdev name %s detected!", > > + devargs->name); > > continue; > > } > > I'm surprised there is nothing to prevent from creating 2 vdevs > with the same name. It should be considered as an error > and reject the vdev creation. > > Actually it does skip the creation of vdev with the same name. Is it enough to return error from vdev_scan(), or even return error from rte_bus_scan()? Please give some advice.