DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] bus/vdev: add warning for duplicated vdev name
@ 2018-11-29  7:16 Yahui Cao
  2018-12-19  2:26 ` Thomas Monjalon
  2023-06-10 15:51 ` Stephen Hemminger
  0 siblings, 2 replies; 4+ messages in thread
From: Yahui Cao @ 2018-11-29  7:16 UTC (permalink / raw)
  To: thomas, ferruh.yigit; +Cc: dev

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;
 		}
 
-- 
2.17.1

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [dpdk-dev] [PATCH] bus/vdev: add warning for duplicated vdev name
  2018-11-29  7:16 [dpdk-dev] [PATCH] bus/vdev: add warning for duplicated vdev name Yahui Cao
@ 2018-12-19  2:26 ` Thomas Monjalon
  2018-12-21  6:57   ` Yahui Cao
  2023-06-10 15:51 ` Stephen Hemminger
  1 sibling, 1 reply; 4+ messages in thread
From: Thomas Monjalon @ 2018-12-19  2:26 UTC (permalink / raw)
  To: Yahui Cao; +Cc: dev, ferruh.yigit

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.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [dpdk-dev] [PATCH] bus/vdev: add warning for duplicated vdev name
  2018-12-19  2:26 ` Thomas Monjalon
@ 2018-12-21  6:57   ` Yahui Cao
  0 siblings, 0 replies; 4+ messages in thread
From: Yahui Cao @ 2018-12-21  6:57 UTC (permalink / raw)
  To: Thomas Monjalon; +Cc: dev, ferruh.yigit, tiwei.bie

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.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [dpdk-dev] [PATCH] bus/vdev: add warning for duplicated vdev name
  2018-11-29  7:16 [dpdk-dev] [PATCH] bus/vdev: add warning for duplicated vdev name Yahui Cao
  2018-12-19  2:26 ` Thomas Monjalon
@ 2023-06-10 15:51 ` Stephen Hemminger
  1 sibling, 0 replies; 4+ messages in thread
From: Stephen Hemminger @ 2023-06-10 15:51 UTC (permalink / raw)
  To: Yahui Cao; +Cc: thomas, ferruh.yigit, dev

On Thu, 29 Nov 2018 15:16:08 +0800
Yahui Cao <yahui.cao@intel.com> wrote:

> 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;
>  		}
>  

Do you have an example of this?

It should be an error and have the scan fail.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2023-06-10 15:51 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-11-29  7:16 [dpdk-dev] [PATCH] bus/vdev: add warning for duplicated vdev name Yahui Cao
2018-12-19  2:26 ` Thomas Monjalon
2018-12-21  6:57   ` Yahui Cao
2023-06-10 15:51 ` Stephen Hemminger

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).