diff options
author | Martin Braun <martin.braun@ettus.com> | 2019-02-21 15:58:04 -0800 |
---|---|---|
committer | Martin Braun <martin.braun@ettus.com> | 2019-02-22 16:12:23 -0800 |
commit | a272da1d65d7c3dd3da0180c10064d55db2a52dc (patch) | |
tree | 3f926cc4a79f46dd15bfc947f6567daefd1601c2 /host/lib/usrp/mpmd/mpmd_prop_tree.cpp | |
parent | 0c658067bd1f75bd6f6175cec556d8384b647953 (diff) | |
download | uhd-a272da1d65d7c3dd3da0180c10064d55db2a52dc.tar.gz uhd-a272da1d65d7c3dd3da0180c10064d55db2a52dc.tar.bz2 uhd-a272da1d65d7c3dd3da0180c10064d55db2a52dc.zip |
mpmd: Allow reclaim failures on component updates
MPM has a flag that identifies component reloads as requiring to restart
the RPC server. This change honours that flag, and doesn't cause a fatal
failure when reclaims fail to ack for certain operations.
For example, running uhd_image_loader on an N310 could fail after the
FPGA was reloaded because the communication to the RPC server was
temporarily interrupted. This is not always avoidable, since the RPC
server does actually go down, and Ethernet connections might also be
lost. So, we cut our losses and accept failures in that case.
Diffstat (limited to 'host/lib/usrp/mpmd/mpmd_prop_tree.cpp')
-rw-r--r-- | host/lib/usrp/mpmd/mpmd_prop_tree.cpp | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/host/lib/usrp/mpmd/mpmd_prop_tree.cpp b/host/lib/usrp/mpmd/mpmd_prop_tree.cpp index e1b5d43cb..f00008971 100644 --- a/host/lib/usrp/mpmd/mpmd_prop_tree.cpp +++ b/host/lib/usrp/mpmd/mpmd_prop_tree.cpp @@ -1,5 +1,6 @@ // // Copyright 2018 Ettus Research, a National Instruments Company +// Copyright 2019 Ettus Research, a National Instruments Brand // // SPDX-License-Identifier: GPL-3.0-or-later // @@ -178,8 +179,16 @@ void mpmd_impl::init_property_tree( for (const auto& comp_name : updateable_components) { UHD_LOG_TRACE("MPMD", "Adding motherboard component: " << comp_name); tree->create<uhd::usrp::component_files_t>(mb_path / "components" / comp_name) - .set_coercer([mb](const uhd::usrp::component_files_t& comp_files) { - return _update_component(comp_files, mb); + .set_coercer([mb, comp_name](const uhd::usrp::component_files_t& comp_files) { + auto comp_info = _get_component_info(comp_name, mb)[0]; + if (comp_info.metadata.get("reset", "") == "True") { + UHD_LOG_DEBUG( + "MPMD", "Bracing for potential loss of RPC server connection."); + mb->allow_claim_failure(true); + } + auto result = _update_component(comp_files, mb); + mb->allow_claim_failure(false); + return result; }) .set_publisher([mb, comp_name]() { return _get_component_info(comp_name, mb); |