summaryrefslogtreecommitdiffstats
path: root/vlib/vlib/unix/pci.h
diff options
context:
space:
mode:
authorDamjan Marion <damarion@cisco.com>2016-04-13 18:03:20 +0200
committerGerrit Code Review <gerrit@fd.io>2016-04-14 23:29:13 +0000
commita42cd34f106869d5afc26f5b5db7e0cb2f73ae97 (patch)
tree0c2b31263d7d77a57db3b56dc0736a1d8ef96e07 /vlib/vlib/unix/pci.h
parent550b5f62528c435e4b9d41729f1d92e8ed9e161a (diff)
Rework of DPDK PCI device uio driver binding process
This is complete rework of DPDK PCI initialization. It drops previous scheme where lspci/route/awk/sed are used and instead sysfs is solely used for discovering Ethernet PCI devices. Criteria for blacklisting device is changed from exsiting routing table entry to simple interface state obtained by SIOCGIFFLAGS ioctl(). It checks for IFF_UP flag, so as long as interface is declared up and even when carrier is down interface will be blacklisted. Change-Id: I59961ddcf1c19c728934e7fe746f343983741bf1 Signed-off-by: Damjan Marion <damarion@cisco.com>
Diffstat (limited to 'vlib/vlib/unix/pci.h')
-rw-r--r--vlib/vlib/unix/pci.h13
1 files changed, 9 insertions, 4 deletions
diff --git a/vlib/vlib/unix/pci.h b/vlib/vlib/unix/pci.h
index b384250eb47..dcbf1cfbf60 100644
--- a/vlib/vlib/unix/pci.h
+++ b/vlib/vlib/unix/pci.h
@@ -53,7 +53,7 @@ typedef struct {
int config_fd;
/* PCI bus address for this devices parsed from /sys/bus/pci/devices name. */
- pci_bus_address_t bus_address;
+ vlib_pci_addr_t bus_address;
/* File descriptor for /dev/uio%d */
int uio_fd;
@@ -74,16 +74,19 @@ typedef struct {
/* Pool of PCI devices. */
typedef struct {
vlib_main_t * vlib_main;
- linux_pci_device_t * pci_devices;
+ vlib_pci_device_t * pci_devs;
+ linux_pci_device_t * linux_pci_devices;
+ pci_device_registration_t * pci_device_registrations;
+ uword * pci_dev_index_by_pci_addr;
} linux_pci_main_t;
extern linux_pci_main_t linux_pci_main;
always_inline linux_pci_device_t *
-pci_dev_for_linux (pci_device_t * dev)
+pci_dev_for_linux (vlib_pci_device_t * dev)
{
linux_pci_main_t * pm = &linux_pci_main;
- return pool_elt_at_index (pm->pci_devices, dev->os_handle);
+ return pool_elt_at_index (pm->linux_pci_devices, dev->os_handle);
}
/* Call to allocate/initialize the pci subsystem.
@@ -91,4 +94,6 @@ pci_dev_for_linux (pci_device_t * dev)
pci only when it's needed. */
clib_error_t * pci_bus_init (vlib_main_t * vm);
+clib_error_t * vlib_pci_bind_to_uio (vlib_pci_device_t * d, char * uio_driver_name);
+
#endif /* included_unix_pci_h */