From 96dd8f437ec88f3c60e7273d0880347239a91426 Mon Sep 17 00:00:00 2001 From: Martin Braun Date: Tue, 10 Sep 2019 19:45:01 -0700 Subject: rfnoc: radio: Interpret MTU as max payload size This matches the streamer code. --- host/lib/rfnoc/radio_control_impl.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'host/lib') 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(get_mtu({res_source_info::OUTPUT_EDGE, chan})) - 16; + static_cast(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) { -- cgit v1.2.3