MCPcopy Create free account
hub / github.com/F-Stack/f-stack / rte_pci_map_device

Function rte_pci_map_device

dpdk/drivers/bus/pci/linux/pci.c:57–85  ·  view source on GitHub ↗

Map pci device */

Source from the content-addressed store, hash-verified

55
56/* Map pci device */
57int
58rte_pci_map_device(struct rte_pci_device *dev)
59{
60 int ret = -1;
61
62 /* try mapping the NIC resources using VFIO if it exists */
63 switch (dev->kdrv) {
64 case RTE_PCI_KDRV_VFIO:
65#ifdef VFIO_PRESENT
66 if (pci_vfio_is_enabled())
67 ret = pci_vfio_map_resource(dev);
68#endif
69 break;
70 case RTE_PCI_KDRV_IGB_UIO:
71 case RTE_PCI_KDRV_UIO_GENERIC:
72 if (rte_eal_using_phys_addrs()) {
73 /* map resources for devices that use uio */
74 ret = pci_uio_map_resource(dev);
75 }
76 break;
77 default:
78 RTE_LOG(DEBUG, EAL,
79 " Not managed by a supported kernel driver, skipped\n");
80 ret = 1;
81 break;
82 }
83
84 return ret;
85}
86
87/* Unmap pci device */
88void

Callers

nothing calls this directly

Calls 4

pci_vfio_is_enabledFunction · 0.85
pci_vfio_map_resourceFunction · 0.85
pci_uio_map_resourceFunction · 0.85
rte_eal_using_phys_addrsFunction · 0.50

Tested by

no test coverage detected