aboutsummaryrefslogtreecommitdiffstats
path: root/host/lib/rfnoc
diff options
context:
space:
mode:
authorMartin Braun <martin.braun@ettus.com>2019-09-10 19:45:01 -0700
committerMartin Braun <martin.braun@ettus.com>2019-11-26 11:49:46 -0800
commit96dd8f437ec88f3c60e7273d0880347239a91426 (patch)
tree2bdcbf06581988954bc30cb82d8b3acf63fe3d64 /host/lib/rfnoc
parentebef8c34191ce3f26b62776f35f7da32a34cc660 (diff)
downloaduhd-96dd8f437ec88f3c60e7273d0880347239a91426.tar.gz
uhd-96dd8f437ec88f3c60e7273d0880347239a91426.tar.bz2
uhd-96dd8f437ec88f3c60e7273d0880347239a91426.zip
rfnoc: radio: Interpret MTU as max payload size
This matches the streamer code.
Diffstat (limited to 'host/lib/rfnoc')
-rw-r--r--host/lib/rfnoc/radio_control_impl.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/host/lib/rfnoc/radio_control_impl.cpp b/host/lib/rfnoc/radio_control_impl.cpp
index b5907cf03..758f9be6c 100644
--- a/host/lib/rfnoc/radio_control_impl.cpp
+++ b/host/lib/rfnoc/radio_control_impl.cpp
@@ -168,10 +168,10 @@ radio_control_impl::radio_control_impl(make_args_ptr make_args)
{&_spp_prop.back()},
[this, chan, &spp = _spp_prop.back()]() {
RFNOC_LOG_TRACE("Calling resolver for spp@" << chan);
- // TODO: Replace the magic number 16 (the protocol overhead)
- // with something else that is calculated based on the CHDR width
+ // MTU is max payload size, header with timestamp is already
+ // accounted for
const int mtu =
- static_cast<int>(get_mtu({res_source_info::OUTPUT_EDGE, chan})) - 16;
+ static_cast<int>(get_mtu({res_source_info::OUTPUT_EDGE, chan}));
const int mtu_samps = mtu / (_samp_width / 8);
const int max_spp_per_mtu = mtu_samps - (mtu_samps % _spc);
if (spp.get() > max_spp_per_mtu) {