DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] eal: fixup hotplugging an already present device
@ 2018-10-25 10:51 Darek Stojaczyk
  2018-10-25 11:49 ` Thomas Monjalon
  0 siblings, 1 reply; 3+ messages in thread
From: Darek Stojaczyk @ 2018-10-25 10:51 UTC (permalink / raw)
  To: dev; +Cc: Darek Stojaczyk, thomas, stable

We were returning rc = -1 from a device probing function
whenever the provided device was already probed before.

This basically broke hotplugging a device in secondary
process when the same device was already hotplugged in
the primary.

To fix it, just return 0 instead of -1. I believe this is
the originally intented behavior.

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

Signed-off-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
---
 lib/librte_eal/common/eal_common_dev.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/librte_eal/common/eal_common_dev.c b/lib/librte_eal/common/eal_common_dev.c
index 6ac3ee859..75b83418c 100644
--- a/lib/librte_eal/common/eal_common_dev.c
+++ b/lib/librte_eal/common/eal_common_dev.c
@@ -222,7 +222,7 @@ local_dev_probe(const char *devargs, struct rte_device **new_dev)
 	ret = dev->bus->plug(dev);
 	if (ret) {
 		if (rte_dev_is_probed(dev)) /* if already succeeded earlier */
-			return ret; /* no rollback */
+			return 0; /* no rollback */
 		RTE_LOG(ERR, EAL, "Driver cannot attach the device (%s)\n",
 			dev->name);
 		goto err_devarg;
-- 
2.17.1

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

* Re: [dpdk-dev] [PATCH] eal: fixup hotplugging an already present device
  2018-10-25 10:51 [dpdk-dev] [PATCH] eal: fixup hotplugging an already present device Darek Stojaczyk
@ 2018-10-25 11:49 ` Thomas Monjalon
  2018-10-26  8:18   ` Stojaczyk, Dariusz
  0 siblings, 1 reply; 3+ messages in thread
From: Thomas Monjalon @ 2018-10-25 11:49 UTC (permalink / raw)
  To: Darek Stojaczyk; +Cc: dev, stable

25/10/2018 12:51, Darek Stojaczyk:
> We were returning rc = -1 from a device probing function
> whenever the provided device was already probed before.
> 
> This basically broke hotplugging a device in secondary
> process when the same device was already hotplugged in
> the primary.
> 
> To fix it, just return 0 instead of -1. I believe this is
> the originally intented behavior.

The intent was to return the error seen during probing again.
If there is no error, the PMD must return 0.
It means I reject this patch so far.

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

* Re: [dpdk-dev] [PATCH] eal: fixup hotplugging an already present device
  2018-10-25 11:49 ` Thomas Monjalon
@ 2018-10-26  8:18   ` Stojaczyk, Dariusz
  0 siblings, 0 replies; 3+ messages in thread
From: Stojaczyk, Dariusz @ 2018-10-26  8:18 UTC (permalink / raw)
  To: Thomas Monjalon; +Cc: dev, stable

> -----Original Message-----
> From: Thomas Monjalon [mailto:thomas@monjalon.net]
> Sent: Thursday, October 25, 2018 1:49 PM
> To: Stojaczyk, Dariusz <dariusz.stojaczyk@intel.com>
> Cc: dev@dpdk.org; stable@dpdk.org
> Subject: Re: [PATCH] eal: fixup hotplugging an already present device
> 
> 25/10/2018 12:51, Darek Stojaczyk:
> > We were returning rc = -1 from a device probing function
> > whenever the provided device was already probed before.
> >
> > This basically broke hotplugging a device in secondary
> > process when the same device was already hotplugged in
> > the primary.
> >
> > To fix it, just return 0 instead of -1. I believe this is
> > the originally intented behavior.
> 
> The intent was to return the error seen during probing again.
> If there is no error, the PMD must return 0.
> It means I reject this patch so far.
> 

I see, let's abandon this one.
I submitted another patch for PCI that resolves the mentioned hotplug issue:
[PATCH] pci: propagate exact error codes in pci_probe_all_drivers()

D.

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

end of thread, other threads:[~2018-10-26  8:18 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-10-25 10:51 [dpdk-dev] [PATCH] eal: fixup hotplugging an already present device Darek Stojaczyk
2018-10-25 11:49 ` Thomas Monjalon
2018-10-26  8:18   ` Stojaczyk, Dariusz

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