From fa659bbe1938875ef27eba2cbb60a43443a65f99 Mon Sep 17 00:00:00 2001 From: Alex Williams Date: Tue, 12 Mar 2019 11:19:13 -0700 Subject: uhd-dpdk: Wait for links to come up before poking MPM Occasionally, MPM would check its links before the kernel would report link up, and it would then shave those ports off the CHDR link list prematurely. This commit adds a second of wait to allow the kernel time to respond. It also includes some additional reporting of link status, since Intel PMDs may report a misleading initial state upon bring-up. --- host/lib/transport/uhd-dpdk/uhd_dpdk.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/host/lib/transport/uhd-dpdk/uhd_dpdk.c b/host/lib/transport/uhd-dpdk/uhd_dpdk.c index dd09525f1..b83b539fd 100644 --- a/host/lib/transport/uhd-dpdk/uhd_dpdk.c +++ b/host/lib/transport/uhd-dpdk/uhd_dpdk.c @@ -9,6 +9,7 @@ #include "uhd_dpdk_driver.h" #include #include +#include #include #include #include @@ -212,10 +213,6 @@ static inline int uhd_dpdk_port_init(struct uhd_dpdk_port *port, port->mac_addr.addr_bytes[2], port->mac_addr.addr_bytes[3], port->mac_addr.addr_bytes[4], port->mac_addr.addr_bytes[5]); - struct rte_eth_link link; - rte_eth_link_get(port->id, &link); - RTE_LOG(INFO, EAL, "Port %u UP: %d\n", port->id, link.link_status); - return 0; free_arp_table: @@ -377,6 +374,17 @@ int uhd_dpdk_start(unsigned int num_ports, int *port_thread_mapping, i); } + RTE_LOG(INFO, EAL, "Waiting for links to come up...\n"); + rte_delay_ms(1000); + for (unsigned int i = 0; i < num_ports; i++) { + struct uhd_dpdk_port *port = &ctx->ports[i]; + if (!port->parent) + continue; + struct rte_eth_link link; + rte_eth_link_get(i, &link); + RTE_LOG(INFO, EAL, "Port %u UP: %d, %u Mbps\n", i, + link.link_status, link.link_speed); + } RTE_LOG(INFO, EAL, "Init DONE!\n"); /* FIXME: Create functions to do this */ -- cgit v1.2.3