From fe3fa1dd31b6da9c90cf181d64d6829313804cdd Mon Sep 17 00:00:00 2001 From: Sugandha Gupta Date: Fri, 25 Jan 2019 17:36:26 -0800 Subject: 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. --- host/lib/rfnoc/block_ctrl_base.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'host/lib/rfnoc/block_ctrl_base.cpp') diff --git a/host/lib/rfnoc/block_ctrl_base.cpp b/host/lib/rfnoc/block_ctrl_base.cpp index ed8068b5b..e70267b96 100644 --- a/host/lib/rfnoc/block_ctrl_base.cpp +++ b/host/lib/rfnoc/block_ctrl_base.cpp @@ -94,12 +94,16 @@ block_ctrl_base::block_ctrl_base(const make_args_t& make_args) // Set source addresses: sr_write(SR_BLOCK_SID, get_address(ctrl_port), ctrl_port); // Set sink buffer sizes: - settingsbus_reg_t reg = SR_READBACK_REG_FIFOSIZE; - size_t buf_size_bytes = size_t(sr_read64(reg, ctrl_port)); + settingsbus_reg_t reg_fifo = SR_READBACK_REG_FIFOSIZE; + size_t buf_size_bytes = size_t(sr_read64(reg_fifo, ctrl_port)); if (buf_size_bytes > 0) n_valid_input_buffers++; _tree->create(_root_path / "input_buffer_size" / ctrl_port) .set(buf_size_bytes); + // Set MTU size and convert to bytes: + settingsbus_reg_t reg_mtu = SR_READBACK_REG_MTU; + size_t mtu = 8 * (1 << size_t(sr_read64(reg_mtu, ctrl_port))); + _tree->create(_root_path / "mtu" / ctrl_port).set(mtu); // Set default destination SIDs // Otherwise, the default is someone else's SID, which we don't want sr_write(SR_RESP_IN_DST_SID, 0xFFFF, ctrl_port); -- cgit v1.2.3