aboutsummaryrefslogtreecommitdiffstats
path: root/src/vlib/pci/pci.c
diff options
context:
space:
mode:
authorDamjan Marion <damarion@cisco.com>2018-10-22 13:38:57 +0200
committerDave Barach <openvpp@barachs.net>2018-10-22 16:10:26 +0000
commit2322798bea16ff4092e2361423af6fd451fd1669 (patch)
treebeec5b680365a31c40bb9ff8ea656e8323aca734 /src/vlib/pci/pci.c
parenta26373bda8aa66cebf03ac092c20fdf4b0a0f625 (diff)
vlib: pci improvements
- logging - pass vlib_main_t to all APIs - open vfio container only when needed Change-Id: I897e53e0af3f91c3a99f0c827401d1c0ec2e478a Signed-off-by: Damjan Marion <damarion@cisco.com>
Diffstat (limited to 'src/vlib/pci/pci.c')
-rw-r--r--src/vlib/pci/pci.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/vlib/pci/pci.c b/src/vlib/pci/pci.c
index f50ae2d9edf..4cd31004586 100644
--- a/src/vlib/pci/pci.c
+++ b/src/vlib/pci/pci.c
@@ -53,7 +53,8 @@
vlib_pci_main_t pci_main;
vlib_pci_device_info_t * __attribute__ ((weak))
-vlib_pci_get_device_info (vlib_pci_addr_t * addr, clib_error_t ** error)
+vlib_pci_get_device_info (vlib_main_t * vm, vlib_pci_addr_t * addr,
+ clib_error_t ** error)
{
if (error)
*error = clib_error_return (0, "unsupported");
@@ -91,7 +92,7 @@ show_pci_fn (vlib_main_t * vm,
vec_foreach (addr, addrs)
{
vlib_pci_device_info_t *d;
- d = vlib_pci_get_device_info (addr, 0);
+ d = vlib_pci_get_device_info (vm, addr, 0);
if (!d)
continue;
@@ -250,7 +251,9 @@ VLIB_CLI_COMMAND (show_pci_command, static) = {
clib_error_t *
pci_bus_init (vlib_main_t * vm)
{
- return vlib_call_init_function (vm, pci_bus_init);
+ vlib_pci_main_t *pm = &pci_main;
+ pm->log_default = vlib_log_register_class ("pci", 0);
+ return 0;
}
VLIB_INIT_FUNCTION (pci_bus_init);