aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVladimir Zhigulin <scripath96@gmail.com>2024-04-19 12:08:02 +0200
committerDamjan Marion <dmarion@0xa5.net>2024-05-13 15:03:18 +0000
commit05c625f1f68eb6a2a3686caba3588ca4e2d5145e (patch)
tree7984ceadbf0768d6cbb8b82975994a96ab2c91ab
parent5233ee29cc1e8b209e92e05ab699ee900e8c0b44 (diff)
vlib: avoid pci scan without registrations
Type: improvement Signed-off-by: Vladimir Zhigulin <scripath96@gmail.com> Change-Id: Id1d78a36cec10a01fbf266b016ba364519e5cb66
-rw-r--r--src/vlib/linux/pci.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/src/vlib/linux/pci.c b/src/vlib/linux/pci.c
index f7c63bc3607..29ca3d97523 100644
--- a/src/vlib/linux/pci.c
+++ b/src/vlib/linux/pci.c
@@ -1561,14 +1561,17 @@ linux_pci_init (vlib_main_t * vm)
ASSERT (sizeof (vlib_pci_addr_t) == sizeof (u32));
- addrs = vlib_pci_get_all_dev_addrs ();
- vec_foreach (addr, addrs)
+ if (pm->pci_device_registrations)
{
- vlib_pci_device_info_t *d;
- if ((d = vlib_pci_get_device_info (vm, addr, 0)))
+ addrs = vlib_pci_get_all_dev_addrs ();
+ vec_foreach (addr, addrs)
{
- init_device_from_registered (vm, d);
- vlib_pci_free_device_info (d);
+ vlib_pci_device_info_t *d;
+ if ((d = vlib_pci_get_device_info (vm, addr, 0)))
+ {
+ init_device_from_registered (vm, d);
+ vlib_pci_free_device_info (d);
+ }
}
}