From e0443c37dff2a087f2ba4155f103e8c4d5cf4869 Mon Sep 17 00:00:00 2001 From: Steven Koo Date: Mon, 3 Aug 2020 21:10:33 -0500 Subject: mpmd: Assume mgmt interface can route CHDR packets The e31x devices don't advertise CHDR interface availability when the low power FPGA is loaded. Since the e3xx and n3xx all route CHDR packets with Virtual NIC forwarding, it's safe to assume that if we can communicate with the mgmt_addr, we can communicate via CHDR too. We can then correctly set the reachability for the e31x from this assumption. --- host/lib/usrp/mpmd/mpmd_mboard_impl.cpp | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'host/lib/usrp') diff --git a/host/lib/usrp/mpmd/mpmd_mboard_impl.cpp b/host/lib/usrp/mpmd/mpmd_mboard_impl.cpp index ecf503f28..852ece5d3 100644 --- a/host/lib/usrp/mpmd/mpmd_mboard_impl.cpp +++ b/host/lib/usrp/mpmd/mpmd_mboard_impl.cpp @@ -207,11 +207,13 @@ boost::optional mpmd_mboard_impl::is_device_reachable( // 3) Check for network-reachable device // Note: This makes the assumption that devices will always allow RPC // connections on their CHDR addresses. - const std::vector addr_keys = {"second_addr", "addr"}; + const std::vector addr_keys = {"second_addr", "addr", "third_addr", "fourth_addr"}; + bool addr_key_found = false; for (const auto& addr_key : addr_keys) { if (not device_info_dict.count(addr_key)) { continue; } + addr_key_found = true; const std::string chdr_addr = device_info_dict.at(addr_key); UHD_LOG_TRACE("MPMD", "Checking reachability via network addr " << chdr_addr); try { @@ -247,6 +249,18 @@ boost::optional mpmd_mboard_impl::is_device_reachable( "MPMD", "Failed to reach device on network addr " << chdr_addr << "."); } } + if(!addr_key_found) + { + // 4) get_device_info didn't give us CHDR info + // This could be because the device isn't fully + // initialized (e.g. e31x with a power save FPGA). + // For UHD 4.0+, the mgmt interface will always + // route CHDR packets when fully initialized + // via Virtual NIC packet fowarding. + device_addr_t device_addr_copy = device_addr; + device_addr_copy["addr"] = rpc_addr; + return boost::optional(device_addr_copy); + } // If everything fails, we probably can't talk to this chap. UHD_LOG_TRACE( "MPMD", "All reachability checks failed -- assuming device is not reachable."); -- cgit v1.2.3