diff options
author | Martin Braun <martin.braun@ettus.com> | 2017-02-10 16:41:50 -0800 |
---|---|---|
committer | Martin Braun <martin.braun@ettus.com> | 2017-02-10 16:41:50 -0800 |
commit | cc769d1b532df2c636edca0bda951b3c5e919de2 (patch) | |
tree | 40322d9dbb0875e7fcd888aa375b2c7a6c5feb39 /host/lib/rfnoc | |
parent | 0e7c61ec6818232ffcb68b79e54d8ffbe7431d75 (diff) | |
parent | d5d3e5a7cc4a8a5cbb1685f2e00d6301a9a9781f (diff) | |
download | uhd-cc769d1b532df2c636edca0bda951b3c5e919de2.tar.gz uhd-cc769d1b532df2c636edca0bda951b3c5e919de2.tar.bz2 uhd-cc769d1b532df2c636edca0bda951b3c5e919de2.zip |
Merge branch 'maint'
Diffstat (limited to 'host/lib/rfnoc')
-rw-r--r-- | host/lib/rfnoc/legacy_compat.cpp | 24 |
1 files changed, 16 insertions, 8 deletions
diff --git a/host/lib/rfnoc/legacy_compat.cpp b/host/lib/rfnoc/legacy_compat.cpp index a8b6d4f68..4060c62ae 100644 --- a/host/lib/rfnoc/legacy_compat.cpp +++ b/host/lib/rfnoc/legacy_compat.cpp @@ -458,17 +458,25 @@ private: // methods // If it's not provided, we provide our own spp value. const size_t args_spp = args.args.cast<size_t>("spp", 0); if (dir == uhd::RX_DIRECTION) { + size_t target_spp = _rx_spp; if (args.args.has_key("spp") and args_spp != _rx_spp) { + target_spp = args_spp; + // TODO: Update flow control on the blocks + } else { for (size_t mboard = 0; mboard < _num_mboards; mboard++) { for (size_t radio = 0; radio < _num_radios_per_board; radio++) { - get_block_ctrl<radio_ctrl>(mboard, RADIO_BLOCK_NAME, radio)->set_arg<int>("spp", args_spp); + const size_t this_spp = get_block_ctrl<radio_ctrl>(mboard, RADIO_BLOCK_NAME, radio)->get_arg<int>("spp"); + target_spp = std::min(this_spp, target_spp); } } - _rx_spp = args_spp; - // TODO: Update flow control on the blocks - } else { - args.args["spp"] = str(boost::format("%d") % _rx_spp); } + for (size_t mboard = 0; mboard < _num_mboards; mboard++) { + for (size_t radio = 0; radio < _num_radios_per_board; radio++) { + get_block_ctrl<radio_ctrl>(mboard, RADIO_BLOCK_NAME, radio)->set_arg<int>("spp", target_spp); + } + } + _rx_spp = target_spp; + args.args["spp"] = str(boost::format("%d") % _rx_spp); } else { if (args.args.has_key("spp") and args_spp != _tx_spp) { _tx_spp = args_spp; @@ -565,10 +573,10 @@ private: // methods const size_t this_spp = get_block_ctrl<radio_ctrl>(i, RADIO_BLOCK_NAME, k)->get_arg<int>("spp"); if (this_spp != _rx_spp) { - throw uhd::runtime_error(str( - boost::format("[legacy compat] Radios have differing spp values: %s has %d, others have %d") + UHD_LOG << str( + boost::format("[legacy compat] Radios have differing spp values: %s has %d, others have %d. UHD will use smaller spp value for all connections. Performance might be not optimal.") % radio_block_id.to_string() % this_spp % _rx_spp - )); + ); } } } |