small fixes for vdev hotplug
cover small fixes for vdev hotplug
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(-)
Signature · 1 line
2.20.1
PATCH 1/2 bus/vdev: fix debug message on probing
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.
--- drivers/bus/vdev/vdev.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/bus/vdev/vdev.c +1 -3
@@ -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 ;
Signature · 1 line
2.20.1
Re: [PATCH 1/2] bus/vdev: fix debug message on probing
בתאריך יום ה׳, 21 בפבר׳ 2019, 21:01, מאת Thomas Monjalon < [email protected]>:
Quoted 31 lines
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")Signed-off-by Thomas Monjalon <[email protected]>--- drivers/bus/vdev/vdev.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)drivers/bus/vdev/vdev.c +1
-4@@ -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
Re: [PATCH 1/2] bus/vdev: fix debug message on probing
In reply to Thomas MonjalonQuoted 8 lines · Thomas Monjalon
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")Signed-off-by Thomas Monjalon <[email protected]>
PATCH 2/2 bus/vdev: fix hotplug twice
In reply to Thomas MonjalonFrom: Raslan Darawsheh <[email protected]>
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.
--- drivers/bus/vdev/vdev.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-)
drivers/bus/vdev/vdev.c +8 -5
@@ -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 intvdev_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 ;
Signature · 1 line
2.20.1
Re: [PATCH 2/2] bus/vdev: fix hotplug twice
Quoted 9 lines · Thomas Monjalon
From: Raslan Darawsheh <[email protected]>
In case vdev was already probed, it shouldn't be probed again, and it should return
-EEXISTas error.
There are some checks invdev_probe()andinsert_vdev(), but a check was missing invdev_plug().
The check is moved invdev_probe_all_drivers()which is called in all code paths.
Quoted 6 lines
Fixes e9d159c3d534 ("eal: allow probing a device again")Signed-off-by Raslan Darawsheh <[email protected]>Signed-off-by Thomas Monjalon <[email protected]>
Quoted 7 lines · Thomas Monjalon
These are 2 small fixes.
A bigger cleanup may be needed in vdev:
rte_vdev_init()can be replaced byrte_dev_probe(). Any volunteer? Note: vdev has no maintainer.
Quoted 5 lines
Raslan Darawsheh (1):
bus/vdev: fix hotplug twiceThomas Monjalon (1):
bus/vdev: fix debug message on probing
Series applied, thanks.