summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteve Shin <jonshin@cisco.com>2018-05-10 14:14:52 -0700
committerJohn Lo <loj@cisco.com>2018-05-11 22:47:43 +0000
commitab13462c9024a596a77d40f477ada57280e6b059 (patch)
tree53f11cdc53d9ad1823e92191028c2478c4a0631d
parent7f358b30b04aabe9a35680997cc1eeefb080a869 (diff)
dpdk: fix Unknown interface with Mellanox NIC
When port_type_from_speed_capa() is called before the port link update isn't completed, xd->port_type becomes VNET_DPDK_PORT_TYPE_UNKNOWN. This happens with Mellanox NIC without lsc interrupt. Calling rte_eth_link_get before getting dev_info will ensure the link state is up-to-date. Change-Id: I83a59654778eb4bf0c65a4a4e225a326227b9641 Signed-off-by: Steve Shin <jonshin@cisco.com>
-rwxr-xr-xsrc/plugins/dpdk/device/init.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/plugins/dpdk/device/init.c b/src/plugins/dpdk/device/init.c
index 9d4c0fd5d7f..aca57a0ce7a 100755
--- a/src/plugins/dpdk/device/init.c
+++ b/src/plugins/dpdk/device/init.c
@@ -262,6 +262,7 @@ dpdk_lib_init (dpdk_main_t * dm)
vlib_pci_addr_t pci_addr;
uword *p = 0;
+ rte_eth_link_get_nowait (i, &l);
rte_eth_dev_info_get (i, &dev_info);
if (dev_info.pci_dev) /* bonded interface has no pci info */
{
@@ -433,7 +434,6 @@ dpdk_lib_init (dpdk_main_t * dm)
/* Cisco VIC */
case VNET_DPDK_PMD_ENIC:
- rte_eth_link_get_nowait (i, &l);
if (l.link_speed == 40000)
xd->port_type = VNET_DPDK_PORT_TYPE_ETH_40G;
else