DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] rte_eth_dev_attach returns 0, although device is not attached
@ 2016-08-03 16:58 Igor Ryzhov
  2016-08-04 11:33 ` Ferruh Yigit
  0 siblings, 1 reply; 7+ messages in thread
From: Igor Ryzhov @ 2016-08-03 16:58 UTC (permalink / raw)
  To: dev; +Cc: David Marchand

Hello.

Function rte_eth_dev_attach can return false positive result.
It happens because rte_eal_pci_probe_one returns zero if no driver is found for the device:
ret = pci_probe_all_drivers(dev);
if (ret < 0)
	goto err_return;
return 0;
(pci_probe_all_drivers returns 1 in that case)

For example, it can be easily reproduced by trying to attach virtio device, managed by kernel driver.

I think it should be:
ret = pci_probe_all_drivers(dev);
if (ret)
	goto err_return;
return 0;
Best regards,
Igor

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

end of thread, other threads:[~2016-08-05 12:29 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-08-03 16:58 [dpdk-dev] rte_eth_dev_attach returns 0, although device is not attached Igor Ryzhov
2016-08-04 11:33 ` Ferruh Yigit
2016-08-04 11:51   ` Igor Ryzhov
2016-08-04 13:21     ` Ferruh Yigit
2016-08-04 14:54       ` Igor Ryzhov
2016-08-04 15:47         ` Ferruh Yigit
2016-08-05 12:29           ` Bruce Richardson

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