From ea5a19c418673a8939360757c5adc08788c87496 Mon Sep 17 00:00:00 2001 From: Alex Williams Date: Wed, 22 Jan 2020 15:04:12 -0800 Subject: x300: Remove early x300_device_args usage Args were being parsed in x300_eth_manager::find(), before UHD could ascertain the args were intended for an X300 device (and not some other device). This caused unwarranted error messages to print in some cases. The changes here fix this and prevent the premature parsing and error messages. --- host/lib/usrp/x300/x300_eth_mgr.cpp | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'host/lib/usrp') diff --git a/host/lib/usrp/x300/x300_eth_mgr.cpp b/host/lib/usrp/x300/x300_eth_mgr.cpp index 5153af671..85f7a138b 100644 --- a/host/lib/usrp/x300/x300_eth_mgr.cpp +++ b/host/lib/usrp/x300/x300_eth_mgr.cpp @@ -93,14 +93,13 @@ eth_manager::udp_simple_factory_t eth_manager::x300_get_udp_factory(const bool u device_addrs_t eth_manager::find(const device_addr_t& hint) { - x300_device_args_t hint_args; - hint_args.parse(hint); + bool use_dpdk = hint.has_key("use_dpdk"); + std::string first_addr = hint.has_key("addr") ? hint["addr"] : ""; udp_simple_factory_t udp_make_broadcast = udp_simple::make_broadcast; - udp_simple_factory_t udp_make_connected = - x300_get_udp_factory(hint_args.get_use_dpdk()); + udp_simple_factory_t udp_make_connected = x300_get_udp_factory(use_dpdk); #ifdef HAVE_DPDK - if (hint_args.get_use_dpdk()) { + if (use_dpdk) { auto dpdk_ctx = uhd::transport::dpdk::dpdk_ctx::get(); if (not dpdk_ctx->is_init_done()) { dpdk_ctx->init(hint); @@ -108,8 +107,8 @@ device_addrs_t eth_manager::find(const device_addr_t& hint) udp_make_broadcast = dpdk_simple::make_broadcast; } #endif - udp_simple::sptr comm = udp_make_broadcast( - hint_args.get_first_addr(), BOOST_STRINGIZE(X300_FW_COMMS_UDP_PORT)); + udp_simple::sptr comm = + udp_make_broadcast(first_addr, BOOST_STRINGIZE(X300_FW_COMMS_UDP_PORT)); // load request struct x300_fw_comms_t request = x300_fw_comms_t(); -- cgit v1.2.3