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_impl.hpp | |
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_impl.hpp')
-rw-r--r-- | host/lib/usrp/mpmd/mpmd_impl.hpp | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/host/lib/usrp/mpmd/mpmd_impl.hpp b/host/lib/usrp/mpmd/mpmd_impl.hpp index cf0dad484..f74627afa 100644 --- a/host/lib/usrp/mpmd/mpmd_impl.hpp +++ b/host/lib/usrp/mpmd/mpmd_impl.hpp @@ -130,6 +130,23 @@ public: uhd::device_addr_t get_rx_hints() const; uhd::device_addr_t get_tx_hints() const; + /*! Setting this flag will enable a mode where a reclaim failure is + * acceptable. + * + * The only legitimate time to do this is when a procedure is called that + * can cause communication with the RPC server to be interrupted + * legitimately, but non-critically. For example, when updating the FPGA + * image, the RPC server gets rebooted, but the claim loop is running in a + * separate thread, and needs some kind of flag to be notified that + * something is up. + */ + void allow_claim_failure(const bool allow) { + if (allow) { + _allow_claim_failure_latch = true; + } + _allow_claim_failure_flag = allow; + } + private: /*! Reference to the RPC client that handles claiming */ @@ -171,6 +188,17 @@ private: uhd::mpmd::xport::mpmd_xport_mgr::uptr _xport_mgr; uhd::device_addr_t send_args; uhd::device_addr_t recv_args; + + /*! This flag is only used within the claim() function. Go look there if you + * really need to know what it does. + */ + std::atomic<bool> _allow_claim_failure_flag{false}; + + /*! This flag is only used within the claim() function. Go look there if you + * really need to know what it does. + */ + std::atomic<bool> _allow_claim_failure_latch{false}; + }; |