diff options
author | Alex Williams <alex.williams@ni.com> | 2020-01-22 15:04:12 -0800 |
---|---|---|
committer | Martin Braun <martin.braun@ettus.com> | 2020-01-22 17:06:27 -0800 |
commit | ea5a19c418673a8939360757c5adc08788c87496 (patch) | |
tree | c7af960e1838bcb05fd47e3ca8a7666ffee53fd1 | |
parent | 608c8a3ab33db629596c37fc8b00902a77900e20 (diff) | |
download | uhd-ea5a19c418673a8939360757c5adc08788c87496.tar.gz uhd-ea5a19c418673a8939360757c5adc08788c87496.tar.bz2 uhd-ea5a19c418673a8939360757c5adc08788c87496.zip |
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.
-rw-r--r-- | host/lib/usrp/x300/x300_eth_mgr.cpp | 13 |
1 files changed, 6 insertions, 7 deletions
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(); |