summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Popovsky <apopovsk@cisco.com>2016-12-04 15:26:58 -0800
committerAlexander Popovsky <apopovsk@cisco.com>2016-12-04 16:04:06 -0800
commit9dfd3383e5dd2c50fa5b65ba1bfc27ced8728b7c (patch)
treead67f26a0216a1e78b57a4305c10cfd65f5b498c
parent00dad123ab284ab0c9c4a8387c93ccbc056e6440 (diff)
Fix crash whith bonded ethernet / DPDK 16.11
In DPDK 16.11 bonded PMD is still using old naming ‘rte_bond_pmd’. See: dpdk-16.11/drivers/net/bonding/rte_eth_bond_api.c Fixed crash when VPP is generating a name for ‘unknown’ non-PCI interface Change-Id: I59e15f009e1a11949a19abf5234d09425a81c6ce Signed-off-by: Alexander Popovsky <apopovsk@cisco.com>
-rw-r--r--vnet/vnet/devices/dpdk/dpdk.h2
-rw-r--r--vnet/vnet/devices/dpdk/format.c10
2 files changed, 8 insertions, 4 deletions
diff --git a/vnet/vnet/devices/dpdk/dpdk.h b/vnet/vnet/devices/dpdk/dpdk.h
index 19c521bcf3a..554b95f6aa9 100644
--- a/vnet/vnet/devices/dpdk/dpdk.h
+++ b/vnet/vnet/devices/dpdk/dpdk.h
@@ -80,7 +80,7 @@ extern vlib_node_registration_t handoff_dispatch_node;
_ ("net_enic", ENIC) \
_ ("net_vmxnet3", VMXNET3) \
_ ("net_af_packet", AF_PACKET) \
- _ ("net_bonding", BOND) \
+ _ ("rte_bond_pmd", BOND) \
_ ("net_fm10k", FM10K) \
_ ("net_cxgbe", CXGBE) \
_ ("net_dpaa2", DPAA2)
diff --git a/vnet/vnet/devices/dpdk/format.c b/vnet/vnet/devices/dpdk/format.c
index b0e624cddf7..212f10914af 100644
--- a/vnet/vnet/devices/dpdk/format.c
+++ b/vnet/vnet/devices/dpdk/format.c
@@ -183,9 +183,13 @@ format_dpdk_device_name (u8 * s, va_list * args)
}
rte_eth_dev_info_get (i, &dev_info);
- ret = format (s, devname_format, device_name, dev_info.pci_dev->addr.bus,
- dev_info.pci_dev->addr.devid,
- dev_info.pci_dev->addr.function);
+
+ if (dev_info.pci_dev)
+ ret = format (s, devname_format, device_name, dev_info.pci_dev->addr.bus,
+ dev_info.pci_dev->addr.devid,
+ dev_info.pci_dev->addr.function);
+ else
+ ret = format (s, "%s%d", device_name, dm->devices[i].device_index);
if (dm->devices[i].interface_name_suffix)
return format (ret, "/%s", dm->devices[i].interface_name_suffix);