aboutsummaryrefslogtreecommitdiffstats
path: root/src/vlib/linux/pci.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/vlib/linux/pci.c')
-rw-r--r--src/vlib/linux/pci.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/vlib/linux/pci.c b/src/vlib/linux/pci.c
index 910f8c2f9cc..127d2ef167a 100644
--- a/src/vlib/linux/pci.c
+++ b/src/vlib/linux/pci.c
@@ -263,6 +263,17 @@ vlib_pci_get_device_info (vlib_pci_addr_t * addr, clib_error_t ** error)
di->iommu_group = atoi ((char *) tmpstr);
vec_free (tmpstr);
}
+ vec_reset_length (f);
+ f = format (f, "%v/iommu_group/name%c", dev_dir_name, 0);
+ err = clib_sysfs_read ((char *) f, "%s", &tmpstr);
+ if (err == 0)
+ {
+ if (strncmp ((char *) tmpstr, "vfio-noiommu", 12) == 0)
+ di->flags |= VLIB_PCI_DEVICE_INFO_F_NOIOMMU;
+ vec_free (tmpstr);
+ }
+ else
+ clib_error_free (err);
}
close (fd);
@@ -695,7 +706,7 @@ add_device_uio (linux_pci_device_t * p, vlib_pci_device_info_t * di,
err = r->init_function (lpm->vlib_main, p->handle);
error:
- free (s);
+ vec_free (s);
if (err)
{
if (p->config_fd != -1)