All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] small fixes for vdev hotplug
@ 2019-02-21 19:01 Thomas Monjalon
  2019-02-21 19:01 ` [PATCH 1/2] bus/vdev: fix debug message on probing Thomas Monjalon
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Thomas Monjalon @ 2019-02-21 19:01 UTC (permalink / raw)
  To: dev

These are 2 small fixes.

A bigger cleanup may be needed in vdev:
rte_vdev_init() can be replaced by rte_dev_probe().
Any volunteer? Note: vdev has no maintainer.


Raslan Darawsheh (1):
  bus/vdev: fix hotplug twice

Thomas Monjalon (1):
  bus/vdev: fix debug message on probing

 drivers/bus/vdev/vdev.c | 17 +++++++++--------
 1 file changed, 9 insertions(+), 8 deletions(-)

-- 
2.20.1

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

* [PATCH 1/2] bus/vdev: fix debug message on probing
  2019-02-21 19:01 [PATCH 0/2] small fixes for vdev hotplug Thomas Monjalon
@ 2019-02-21 19:01 ` Thomas Monjalon
  2019-02-22  5:06   ` Rami Rosen
  2019-02-25  7:45   ` Andrew Rybchenko
  2019-02-21 19:01 ` [PATCH 2/2] bus/vdev: fix hotplug twice Thomas Monjalon
  2019-03-05 12:36 ` [PATCH 0/2] small fixes for vdev hotplug Ferruh Yigit
  2 siblings, 2 replies; 7+ messages in thread
From: Thomas Monjalon @ 2019-02-21 19:01 UTC (permalink / raw)
  To: dev; +Cc: ferruh.yigit

The log was printing the device name two times,
first one being supposed to be the driver name.
As we don't know yet the driver name, the log is simplified.

Fixes: 9bf4901d1a11 ("bus/vdev: remove probe with driver name option")
Cc: ferruh.yigit@intel.com

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
---
 drivers/bus/vdev/vdev.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/bus/vdev/vdev.c b/drivers/bus/vdev/vdev.c
index 2c03ca4185..7225411791 100644
--- a/drivers/bus/vdev/vdev.c
+++ b/drivers/bus/vdev/vdev.c
@@ -144,9 +144,7 @@ vdev_probe_all_drivers(struct rte_vdev_device *dev)
 	int ret;
 
 	name = rte_vdev_device_name(dev);
-
-	VDEV_LOG(DEBUG, "Search driver %s to probe device %s", name,
-		rte_vdev_device_name(dev));
+	VDEV_LOG(DEBUG, "Search driver to probe device %s", name);
 
 	if (vdev_parse(name, &driver))
 		return -1;
-- 
2.20.1

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

* [PATCH 2/2] bus/vdev: fix hotplug twice
  2019-02-21 19:01 [PATCH 0/2] small fixes for vdev hotplug Thomas Monjalon
  2019-02-21 19:01 ` [PATCH 1/2] bus/vdev: fix debug message on probing Thomas Monjalon
@ 2019-02-21 19:01 ` Thomas Monjalon
  2019-02-25  7:50   ` Andrew Rybchenko
  2019-03-05 12:36 ` [PATCH 0/2] small fixes for vdev hotplug Ferruh Yigit
  2 siblings, 1 reply; 7+ messages in thread
From: Thomas Monjalon @ 2019-02-21 19:01 UTC (permalink / raw)
  To: dev; +Cc: Raslan Darawsheh, stable

From: Raslan Darawsheh <rasland@mellanox.com>

In case vdev was already probed, it shouldn't be probed again,
and it should return -EEXIST as error.
There are some checks in vdev_probe() and insert_vdev(),
but a check was missing in vdev_plug().
The check is moved in vdev_probe_all_drivers() which is called
in all code paths.

Fixes: e9d159c3d534 ("eal: allow probing a device again")
Cc: stable@dpdk.org

Signed-off-by: Raslan Darawsheh <rasland@mellanox.com>
Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
---
 drivers/bus/vdev/vdev.c | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)

diff --git a/drivers/bus/vdev/vdev.c b/drivers/bus/vdev/vdev.c
index 7225411791..87f0e2b6bb 100644
--- a/drivers/bus/vdev/vdev.c
+++ b/drivers/bus/vdev/vdev.c
@@ -143,6 +143,9 @@ vdev_probe_all_drivers(struct rte_vdev_device *dev)
 	struct rte_vdev_driver *driver;
 	int ret;
 
+	if (rte_dev_is_probed(&dev->device))
+		return -EEXIST;
+
 	name = rte_vdev_device_name(dev);
 	VDEV_LOG(DEBUG, "Search driver to probe device %s", name);
 
@@ -480,7 +483,7 @@ static int
 vdev_probe(void)
 {
 	struct rte_vdev_device *dev;
-	int ret = 0;
+	int r, ret = 0;
 
 	/* call the init function for each virtual device */
 	TAILQ_FOREACH(dev, &vdev_device_list, next) {
@@ -489,10 +492,10 @@ vdev_probe(void)
 		 * we call each driver probe.
 		 */
 
-		if (rte_dev_is_probed(&dev->device))
-			continue;
-
-		if (vdev_probe_all_drivers(dev)) {
+		r = vdev_probe_all_drivers(dev);
+		if (r != 0) {
+			if (r == -EEXIST)
+				continue;
 			VDEV_LOG(ERR, "failed to initialize %s device",
 				rte_vdev_device_name(dev));
 			ret = -1;
-- 
2.20.1

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

* Re: [PATCH 1/2] bus/vdev: fix debug message on probing
  2019-02-21 19:01 ` [PATCH 1/2] bus/vdev: fix debug message on probing Thomas Monjalon
@ 2019-02-22  5:06   ` Rami Rosen
  2019-02-25  7:45   ` Andrew Rybchenko
  1 sibling, 0 replies; 7+ messages in thread
From: Rami Rosen @ 2019-02-22  5:06 UTC (permalink / raw)
  To: Thomas Monjalon; +Cc: dev, ferruh.yigit

Reviewed-by: Rami Rosen <ramirose@gmail.com>

בתאריך יום ה׳, 21 בפבר׳ 2019, 21:01, מאת Thomas Monjalon ‏<
thomas@monjalon.net>:

> The log was printing the device name two times,
> first one being supposed to be the driver name.
> As we don't know yet the driver name, the log is simplified.
>
> Fixes: 9bf4901d1a11 ("bus/vdev: remove probe with driver name option")
> Cc: ferruh.yigit@intel.com
>
> Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
> ---
>  drivers/bus/vdev/vdev.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
>
> diff --git a/drivers/bus/vdev/vdev.c b/drivers/bus/vdev/vdev.c
> index 2c03ca4185..7225411791 100644
> --- a/drivers/bus/vdev/vdev.c
> +++ b/drivers/bus/vdev/vdev.c
> @@ -144,9 +144,7 @@ vdev_probe_all_drivers(struct rte_vdev_device *dev)
>         int ret;
>
>         name = rte_vdev_device_name(dev);
> -
> -       VDEV_LOG(DEBUG, "Search driver %s to probe device %s", name,
> -               rte_vdev_device_name(dev));
> +       VDEV_LOG(DEBUG, "Search driver to probe device %s", name);
>
>         if (vdev_parse(name, &driver))
>                 return -1;
> --
> 2.20.1
>
>

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

* Re: [PATCH 1/2] bus/vdev: fix debug message on probing
  2019-02-21 19:01 ` [PATCH 1/2] bus/vdev: fix debug message on probing Thomas Monjalon
  2019-02-22  5:06   ` Rami Rosen
@ 2019-02-25  7:45   ` Andrew Rybchenko
  1 sibling, 0 replies; 7+ messages in thread
From: Andrew Rybchenko @ 2019-02-25  7:45 UTC (permalink / raw)
  To: Thomas Monjalon, dev; +Cc: ferruh.yigit

On 2/21/19 10:01 PM, Thomas Monjalon wrote:
> The log was printing the device name two times,
> first one being supposed to be the driver name.
> As we don't know yet the driver name, the log is simplified.
>
> Fixes: 9bf4901d1a11 ("bus/vdev: remove probe with driver name option")
> Cc: ferruh.yigit@intel.com
>
> Signed-off-by: Thomas Monjalon <thomas@monjalon.net>

Reviewed-by: Andrew Rybchenko <arybchenko@solarflare.com>

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

* Re: [PATCH 2/2] bus/vdev: fix hotplug twice
  2019-02-21 19:01 ` [PATCH 2/2] bus/vdev: fix hotplug twice Thomas Monjalon
@ 2019-02-25  7:50   ` Andrew Rybchenko
  0 siblings, 0 replies; 7+ messages in thread
From: Andrew Rybchenko @ 2019-02-25  7:50 UTC (permalink / raw)
  To: Thomas Monjalon, dev; +Cc: Raslan Darawsheh, stable

On 2/21/19 10:01 PM, Thomas Monjalon wrote:
> From: Raslan Darawsheh <rasland@mellanox.com>
>
> In case vdev was already probed, it shouldn't be probed again,
> and it should return -EEXIST as error.
> There are some checks in vdev_probe() and insert_vdev(),
> but a check was missing in vdev_plug().
> The check is moved in vdev_probe_all_drivers() which is called
> in all code paths.
>
> Fixes: e9d159c3d534 ("eal: allow probing a device again")
> Cc: stable@dpdk.org
>
> Signed-off-by: Raslan Darawsheh <rasland@mellanox.com>
> Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
>

Reviewed-by: Andrew Rybchenko <arybchenko@solarflare.com>

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

* Re: [PATCH 0/2] small fixes for vdev hotplug
  2019-02-21 19:01 [PATCH 0/2] small fixes for vdev hotplug Thomas Monjalon
  2019-02-21 19:01 ` [PATCH 1/2] bus/vdev: fix debug message on probing Thomas Monjalon
  2019-02-21 19:01 ` [PATCH 2/2] bus/vdev: fix hotplug twice Thomas Monjalon
@ 2019-03-05 12:36 ` Ferruh Yigit
  2 siblings, 0 replies; 7+ messages in thread
From: Ferruh Yigit @ 2019-03-05 12:36 UTC (permalink / raw)
  To: Thomas Monjalon, dev

On 2/21/2019 7:01 PM, Thomas Monjalon wrote:
> These are 2 small fixes.
> 
> A bigger cleanup may be needed in vdev:
> rte_vdev_init() can be replaced by rte_dev_probe().
> Any volunteer? Note: vdev has no maintainer.
> 
> 
> Raslan Darawsheh (1):
>   bus/vdev: fix hotplug twice
> 
> Thomas Monjalon (1):
>   bus/vdev: fix debug message on probing

Series applied, thanks.

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

end of thread, other threads:[~2019-03-05 12:36 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-02-21 19:01 [PATCH 0/2] small fixes for vdev hotplug Thomas Monjalon
2019-02-21 19:01 ` [PATCH 1/2] bus/vdev: fix debug message on probing Thomas Monjalon
2019-02-22  5:06   ` Rami Rosen
2019-02-25  7:45   ` Andrew Rybchenko
2019-02-21 19:01 ` [PATCH 2/2] bus/vdev: fix hotplug twice Thomas Monjalon
2019-02-25  7:50   ` Andrew Rybchenko
2019-03-05 12:36 ` [PATCH 0/2] small fixes for vdev hotplug Ferruh Yigit

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.