aboutsummaryrefslogtreecommitdiffstats
path: root/host/lib/usrp/mpmd
diff options
context:
space:
mode:
authorSteven Koo <steven.koo@ni.com>2020-08-03 21:10:33 -0500
committerAaron Rossetto <aaron.rossetto@ni.com>2020-08-04 15:47:17 -0500
commite0443c37dff2a087f2ba4155f103e8c4d5cf4869 (patch)
tree69231214f62cb16a7007ccf0cfd585735832d0b3 /host/lib/usrp/mpmd
parentc13ba0d21f80fee022f31e13cad0c5b0aa712aaf (diff)
downloaduhd-e0443c37dff2a087f2ba4155f103e8c4d5cf4869.tar.gz
uhd-e0443c37dff2a087f2ba4155f103e8c4d5cf4869.tar.bz2
uhd-e0443c37dff2a087f2ba4155f103e8c4d5cf4869.zip
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.
Diffstat (limited to 'host/lib/usrp/mpmd')
-rw-r--r--host/lib/usrp/mpmd/mpmd_mboard_impl.cpp16
1 files changed, 15 insertions, 1 deletions
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<device_addr_t> 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<std::string> addr_keys = {"second_addr", "addr"};
+ const std::vector<std::string> 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<device_addr_t> 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_t>(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.");