DPDK patches and discussions
 help / color / mirror / Atom feed
From: Yahui Cao <yahui.cao@intel.com>
To: Thomas Monjalon <thomas@monjalon.net>
Cc: dev@dpdk.org, ferruh.yigit@intel.com, tiwei.bie@intel.com
Subject: Re: [dpdk-dev] [PATCH] bus/vdev: add warning for duplicated vdev name
Date: Fri, 21 Dec 2018 14:57:57 +0800	[thread overview]
Message-ID: <20181221065757.GA24082@jim-aorus> (raw)
In-Reply-To: <1682296.hbgUrQPOuL@xps>

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 <yahui.cao@intel.com>
> > ---
> >  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.

  reply	other threads:[~2018-12-21  6:59 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-29  7:16 Yahui Cao
2018-12-19  2:26 ` Thomas Monjalon
2018-12-21  6:57   ` Yahui Cao [this message]
2023-06-10 15:51 ` Stephen Hemminger

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20181221065757.GA24082@jim-aorus \
    --to=yahui.cao@intel.com \
    --cc=dev@dpdk.org \
    --cc=ferruh.yigit@intel.com \
    --cc=thomas@monjalon.net \
    --cc=tiwei.bie@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).