[dpdk-dev] pci: fix one device probing

Message ID 1470311406-38841-1-git-send-email-iryzhov@nfware.com (mailing list archive)
State Accepted, archived
Delegated to: Thomas Monjalon
Headers

Commit Message

Igor Ryzhov Aug. 4, 2016, 11:50 a.m. UTC
  The rte_eal_pci_probe_one function could return false positive result if
no driver is found for the device.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
---
 lib/librte_eal/common/eal_common_pci.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Comments

Thomas Monjalon Sept. 16, 2016, 1:20 p.m. UTC | #1
2016-08-04 14:50, Igor Ryzhov:
> The rte_eal_pci_probe_one function could return false positive result if
> no driver is found for the device.
> 
> Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
[...]
> --- a/lib/librte_eal/common/eal_common_pci.c
> +++ b/lib/librte_eal/common/eal_common_pci.c
> @@ -344,7 +344,7 @@ rte_eal_pci_probe_one(const struct rte_pci_addr *addr)
>  			continue;
>  
>  		ret = pci_probe_all_drivers(dev);
> -		if (ret < 0)
> +		if (ret)
>  			goto err_return;
>  		return 0;
>  	}

This patch was discussed in another thread:
	http://dpdk.org/ml/archives/dev/2016-August/045127.html
Is there anyone thinking this patch is not a step forward?
  
David Marchand Nov. 7, 2016, 1:26 p.m. UTC | #2
On Thu, Aug 4, 2016 at 1:50 PM, Igor Ryzhov <iryzhov@nfware.com> wrote:
> The rte_eal_pci_probe_one function could return false positive result if
> no driver is found for the device.
>
> Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
> ---
>  lib/librte_eal/common/eal_common_pci.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/lib/librte_eal/common/eal_common_pci.c b/lib/librte_eal/common/eal_common_pci.c
> index 7248c38..bfb6fd2 100644
> --- a/lib/librte_eal/common/eal_common_pci.c
> +++ b/lib/librte_eal/common/eal_common_pci.c
> @@ -344,7 +344,7 @@ rte_eal_pci_probe_one(const struct rte_pci_addr *addr)
>                         continue;
>
>                 ret = pci_probe_all_drivers(dev);
> -               if (ret < 0)
> +               if (ret)
>                         goto err_return;
>                 return 0;
>         }

Acked-by: David Marchand <david.marchand@6wind.com>
  
Thomas Monjalon Nov. 7, 2016, 1:49 p.m. UTC | #3
2016-11-07 14:26, David Marchand:
> On Thu, Aug 4, 2016 at 1:50 PM, Igor Ryzhov <iryzhov@nfware.com> wrote:
> > The rte_eal_pci_probe_one function could return false positive result if
> > no driver is found for the device.
> >
> > Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
> 
> Acked-by: David Marchand <david.marchand@6wind.com>

Applied, thanks
  

Patch

diff --git a/lib/librte_eal/common/eal_common_pci.c b/lib/librte_eal/common/eal_common_pci.c
index 7248c38..bfb6fd2 100644
--- a/lib/librte_eal/common/eal_common_pci.c
+++ b/lib/librte_eal/common/eal_common_pci.c
@@ -344,7 +344,7 @@  rte_eal_pci_probe_one(const struct rte_pci_addr *addr)
 			continue;
 
 		ret = pci_probe_all_drivers(dev);
-		if (ret < 0)
+		if (ret)
 			goto err_return;
 		return 0;
 	}