aboutsummaryrefslogtreecommitdiffstats
path: root/host/lib/rfnoc/sink_block_ctrl_base.cpp
diff options
context:
space:
mode:
authorSugandha Gupta <sugandha.gupta@ettus.com>2019-01-25 17:36:26 -0800
committerBrent Stapleton <brent.stapleton@ettus.com>2019-05-01 15:17:23 -0700
commitfe3fa1dd31b6da9c90cf181d64d6829313804cdd (patch)
tree2e81322cfe66e3e5cc1cb0ec58b29c7d3199e609 /host/lib/rfnoc/sink_block_ctrl_base.cpp
parent178b35569b1a25180a80a23b945b10b04c9f10f5 (diff)
downloaduhd-fe3fa1dd31b6da9c90cf181d64d6829313804cdd.tar.gz
uhd-fe3fa1dd31b6da9c90cf181d64d6829313804cdd.tar.bz2
uhd-fe3fa1dd31b6da9c90cf181d64d6829313804cdd.zip
device3: Constraint send/recv_frame_size based on down/upstream MTU
We need to properly contraint the send/recv_frame_size based on the minimum MTU of all the down/upstream blocks. This fixes the issue with E310 tx/rx streaming as it has smaller MTU sizes than the other usrps.
Diffstat (limited to 'host/lib/rfnoc/sink_block_ctrl_base.cpp')
-rw-r--r--host/lib/rfnoc/sink_block_ctrl_base.cpp14
1 files changed, 11 insertions, 3 deletions
diff --git a/host/lib/rfnoc/sink_block_ctrl_base.cpp b/host/lib/rfnoc/sink_block_ctrl_base.cpp
index bb81706f9..f1d65350a 100644
--- a/host/lib/rfnoc/sink_block_ctrl_base.cpp
+++ b/host/lib/rfnoc/sink_block_ctrl_base.cpp
@@ -43,11 +43,19 @@ std::vector<size_t> sink_block_ctrl_base::get_input_ports() const
**********************************************************************/
size_t sink_block_ctrl_base::get_fifo_size(size_t block_port) const
{
- if (_tree->exists(
- _root_path / "input_buffer_size" / str(boost::format("%d") % block_port))) {
+ if (_tree->exists(_root_path / "input_buffer_size" / std::to_string(block_port))) {
return _tree
->access<size_t>(
- _root_path / "input_buffer_size" / str(boost::format("%d") % block_port))
+ _root_path / "input_buffer_size" / std::to_string(block_port))
+ .get();
+ }
+ return 0;
+}
+
+size_t sink_block_ctrl_base::get_mtu(size_t block_port) const
+{
+ if (_tree->exists(_root_path / "mtu" / std::to_string(block_port))) {
+ return _tree->access<size_t>(_root_path / "mtu" / std::to_string(block_port))
.get();
}
return 0;