diff options
author | Alex Williams <alex.williams@ni.com> | 2019-03-12 11:19:13 -0700 |
---|---|---|
committer | michael-west <michael.west@ettus.com> | 2019-05-21 15:52:42 -0700 |
commit | 223751ad9fbc3bd12953898ea2a6c9e9490e746c (patch) | |
tree | 1ceda98484d78f5b795c7f1fd245f10aa0770c92 /host/lib | |
parent | 904b4d703a58479bdb8ae8efb245aeeaa4605e39 (diff) | |
download | uhd-223751ad9fbc3bd12953898ea2a6c9e9490e746c.tar.gz uhd-223751ad9fbc3bd12953898ea2a6c9e9490e746c.tar.bz2 uhd-223751ad9fbc3bd12953898ea2a6c9e9490e746c.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.
Diffstat (limited to 'host/lib')
-rw-r--r-- | host/lib/transport/uhd-dpdk/uhd_dpdk.c | 16 |
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 */ |