summaryrefslogtreecommitdiffstats
path: root/vnet
diff options
context:
space:
mode:
Diffstat (limited to 'vnet')
-rw-r--r--vnet/vnet/devices/dpdk/init.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/vnet/vnet/devices/dpdk/init.c b/vnet/vnet/devices/dpdk/init.c
index 63af5b345a3..6b6f63a7ea8 100644
--- a/vnet/vnet/devices/dpdk/init.c
+++ b/vnet/vnet/devices/dpdk/init.c
@@ -313,14 +313,17 @@ dpdk_lib_init (dpdk_main_t * dm)
struct rte_eth_link l;
dpdk_device_config_t * devconf = 0;
vlib_pci_addr_t pci_addr;
- uword * p;
+ uword * p = 0;
rte_eth_dev_info_get(i, &dev_info);
- pci_addr.domain = dev_info.pci_dev->addr.domain;
- pci_addr.bus = dev_info.pci_dev->addr.bus;
- pci_addr.slot = dev_info.pci_dev->addr.devid;
- pci_addr.function = dev_info.pci_dev->addr.function;
- p = hash_get (dm->conf->device_config_index_by_pci_addr, pci_addr.as_u32);
+ if (dev_info.pci_dev) /* bonded interface has no pci info */
+ {
+ pci_addr.domain = dev_info.pci_dev->addr.domain;
+ pci_addr.bus = dev_info.pci_dev->addr.bus;
+ pci_addr.slot = dev_info.pci_dev->addr.devid;
+ pci_addr.function = dev_info.pci_dev->addr.function;
+ p = hash_get (dm->conf->device_config_index_by_pci_addr, pci_addr.as_u32);
+ }
if (p)
devconf = pool_elt_at_index (dm->conf->dev_confs, p[0]);
@@ -371,7 +374,7 @@ dpdk_lib_init (dpdk_main_t * dm)
xd->dev_type = VNET_DPDK_DEV_ETH;
/* workaround for drivers not setting driver_name */
- if (!dev_info.driver_name)
+ if ((!dev_info.driver_name) && (dev_info.pci_dev))
dev_info.driver_name = dev_info.pci_dev->driver->name;
ASSERT(dev_info.driver_name);