aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlex Williams <alex.williams@ni.com>2019-03-12 11:19:13 -0700
committerBrent Stapleton <brent.stapleton@ettus.com>2019-04-02 10:36:58 -0700
commitfa659bbe1938875ef27eba2cbb60a43443a65f99 (patch)
tree399f9ae532c82d9d3f99cc2097d5a427dd294448
parentbeb1f3c207bcf1ebc6ca1e83f1940bd91c867d9a (diff)
downloaduhd-fa659bbe1938875ef27eba2cbb60a43443a65f99.tar.gz
uhd-fa659bbe1938875ef27eba2cbb60a43443a65f99.tar.bz2
uhd-fa659bbe1938875ef27eba2cbb60a43443a65f99.zip
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.
-rw-r--r--host/lib/transport/uhd-dpdk/uhd_dpdk.c16
1 files 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 <stdlib.h>
#include <sched.h>
+#include <rte_cycles.h>
#include <rte_errno.h>
#include <rte_malloc.h>
#include <rte_log.h>
@@ -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 */