DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev]  [PATCH] bus/pci: optimize pci device probe
@ 2020-04-26 17:38 jerinj
  2020-04-26 18:08 ` Thomas Monjalon
  0 siblings, 1 reply; 15+ messages in thread
From: jerinj @ 2020-04-26 17:38 UTC (permalink / raw)
  Cc: dev, maxime.coquelin, zhihong.wang, xiaolong.ye, thomas,
	david.marchand, hkalra, Jerin Jacob

From: Jerin Jacob <jerinj@marvell.com>

If the PCI device is not attached to any driver then there is no
point in probing it. As an optimization, skip the PCI device probe if
the PCI device driver of type RTE_KDRV_NONE.

Signed-off-by: Jerin Jacob <jerinj@marvell.com>
---
Notes:
------
- virtio drivers does special treatment based on RTE_KDRV_UNKNOWN, That is
the reason allowing RTE_KDRV_UNKNOWN in this patch.
- virio devices uses RTE_KDRV_UNKNOWN for some special meaning, IMO, if it would
  be better, if
a) Introduce the KDRV for virio
b) If the PCIe device of driver type NONE or UNKNOWN then not even add in pci
list
in the scan, It will improve the boot time by avoiding operation on
unwanted device like sorting the PCI devices, scanning it, probe it, managing
it etc.

- Initial problem reported at http://patches.dpdk.org/patch/64999/ as
boot time printf clutter on octeontx2 devices with a lot PCI devices which are
of type RTE_KDRV_NONE.

 drivers/bus/pci/pci_common.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/bus/pci/pci_common.c b/drivers/bus/pci/pci_common.c
index 3f5542076..2fa3d85ae 100644
--- a/drivers/bus/pci/pci_common.c
+++ b/drivers/bus/pci/pci_common.c
@@ -271,6 +271,8 @@ pci_probe_all_drivers(struct rte_pci_device *dev)
 		return -EINVAL;

 	FOREACH_DRIVER_ON_PCIBUS(dr) {
+		if (dev->kdrv == RTE_KDRV_NONE)
+			continue;
 		rc = rte_pci_probe_one_driver(dr, dev);
 		if (rc < 0)
 			/* negative value is an error */
--
2.26.2


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

end of thread, other threads:[~2020-05-06 11:44 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-26 17:38 [dpdk-dev] [PATCH] bus/pci: optimize pci device probe jerinj
2020-04-26 18:08 ` Thomas Monjalon
2020-04-26 18:41   ` Jerin Jacob
2020-04-26 20:06     ` Thomas Monjalon
2020-04-27 17:59       ` Jerin Jacob
2020-04-28  8:50       ` David Marchand
2020-04-28  9:34         ` Jerin Jacob
2020-05-05 15:50           ` Jerin Jacob
2020-05-05 16:16             ` David Marchand
2020-05-06  6:34               ` Maxime Coquelin
2020-05-06  6:43                 ` Jerin Jacob
2020-05-06  7:52                   ` Maxime Coquelin
2020-05-06 10:51                     ` Jerin Jacob
2020-05-06 11:37                       ` David Marchand
2020-05-06 11:44                         ` Maxime Coquelin

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