aboutsummaryrefslogtreecommitdiffstats
path: root/host
diff options
context:
space:
mode:
authorAndrej Rode <andrej.rode@ettus.com>2017-01-12 15:44:24 -0800
committerMartin Braun <martin.braun@ettus.com>2017-02-03 15:54:18 +0100
commit9b6b3315afb2afd3d7c2deb74d8275d8515eafb1 (patch)
tree8e11b42ced26f78d43b5afcc04d8bc44e30c319a /host
parentac5575c36ba1e0e0c7e408dac2b5e138ade0a73d (diff)
downloaduhd-9b6b3315afb2afd3d7c2deb74d8275d8515eafb1.tar.gz
uhd-9b6b3315afb2afd3d7c2deb74d8275d8515eafb1.tar.bz2
uhd-9b6b3315afb2afd3d7c2deb74d8275d8515eafb1.zip
legacy_compat: fallback to min(spp) if no user-specified spp value exists
Diffstat (limited to 'host')
-rw-r--r--host/lib/rfnoc/legacy_compat.cpp24
1 files changed, 16 insertions, 8 deletions
diff --git a/host/lib/rfnoc/legacy_compat.cpp b/host/lib/rfnoc/legacy_compat.cpp
index a396fd677..7acaa898c 100644
--- a/host/lib/rfnoc/legacy_compat.cpp
+++ b/host/lib/rfnoc/legacy_compat.cpp
@@ -467,17 +467,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;
@@ -574,10 +582,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
- ));
+ );
}
}
}