diff options
Diffstat (limited to 'host/lib')
-rw-r--r-- | host/lib/rfnoc/ctrl_iface.cpp | 2 | ||||
-rw-r--r-- | host/lib/transport/muxed_zero_copy_if.cpp | 4 | ||||
-rw-r--r-- | host/lib/usrp/mpmd/mpmd_xport_ctrl_liberio.cpp | 37 | ||||
-rw-r--r-- | host/lib/usrp/x300/x300_impl.cpp | 4 |
4 files changed, 18 insertions, 29 deletions
diff --git a/host/lib/rfnoc/ctrl_iface.cpp b/host/lib/rfnoc/ctrl_iface.cpp index 6204d81f4..e0fc03eab 100644 --- a/host/lib/rfnoc/ctrl_iface.cpp +++ b/host/lib/rfnoc/ctrl_iface.cpp @@ -36,7 +36,7 @@ public: , _name(name) , _seq_out(0) , _max_outstanding_acks( - uhd::rfnoc::CMD_FIFO_SIZE / 3) // Max command packet size is 3 lines + uhd::rfnoc::CMD_FIFO_SIZE / uhd::rfnoc::MAX_CMD_PKT_SIZE) { UHD_ASSERT_THROW(bool(_xports.send)); UHD_ASSERT_THROW(bool(_xports.recv)); diff --git a/host/lib/transport/muxed_zero_copy_if.cpp b/host/lib/transport/muxed_zero_copy_if.cpp index feaa43b70..a3ea4c40d 100644 --- a/host/lib/transport/muxed_zero_copy_if.cpp +++ b/host/lib/transport/muxed_zero_copy_if.cpp @@ -70,8 +70,8 @@ public: stream_impl::sptr stream = boost::make_shared<stream_impl>(this->shared_from_this(), stream_num, - _base_xport->get_num_send_frames() / _max_num_streams, - _base_xport->get_num_recv_frames() / _max_num_streams); + _base_xport->get_num_send_frames(), + _base_xport->get_num_recv_frames()); _streams[stream_num] = stream; return stream; } diff --git a/host/lib/usrp/mpmd/mpmd_xport_ctrl_liberio.cpp b/host/lib/usrp/mpmd/mpmd_xport_ctrl_liberio.cpp index 85d83abc1..d2f36bba3 100644 --- a/host/lib/usrp/mpmd/mpmd_xport_ctrl_liberio.cpp +++ b/host/lib/usrp/mpmd/mpmd_xport_ctrl_liberio.cpp @@ -8,6 +8,7 @@ #include "../transport/liberio_zero_copy.hpp" #include <uhd/transport/udp_zero_copy.hpp> #include <uhd/utils/byteswap.hpp> +#include <uhd/rfnoc/constants.hpp> using namespace uhd; using namespace uhd::mpmd::xport; @@ -61,6 +62,10 @@ uhd::both_xports_t mpmd_xport_ctrl_liberio::make_transport( if (xport_type == usrp::device3_impl::CTRL) { default_buff_args.send_frame_size = LIBERIO_CTRL_FRAME_MAX_SIZE; default_buff_args.recv_frame_size = LIBERIO_CTRL_FRAME_MAX_SIZE; + default_buff_args.num_recv_frames = uhd::rfnoc::CMD_FIFO_SIZE / + uhd::rfnoc::MAX_CMD_PKT_SIZE; + default_buff_args.num_send_frames = uhd::rfnoc::CMD_FIFO_SIZE / + uhd::rfnoc::MAX_CMD_PKT_SIZE; } else if (xport_type == usrp::device3_impl::ASYNC_MSG) { default_buff_args.send_frame_size = LIBERIO_ASYNC_FRAME_MAX_SIZE; default_buff_args.recv_frame_size = LIBERIO_ASYNC_FRAME_MAX_SIZE; @@ -78,25 +83,15 @@ uhd::both_xports_t mpmd_xport_ctrl_liberio::make_transport( xports.send_sid = sid_t(xport_info["send_sid"]); xports.recv_sid = xports.send_sid.reversed(); - // this is kinda ghetto: scale buffer for muxed xports since we share the - // buffer... - float divisor = 1; - if (xport_type == usrp::device3_impl::CTRL) - divisor = 16; - else if (xport_type == usrp::device3_impl::ASYNC_MSG) - divisor = 4; - - // if (xport_info["muxed"] == "True") { //// FIXME tbw //} if (xport_type == usrp::device3_impl::CTRL) { UHD_ASSERT_THROW(xport_info["muxed"] == "True"); if (not _ctrl_dma_xport) { - default_buff_args.send_frame_size = LIBERIO_CTRL_FRAME_MAX_SIZE; - default_buff_args.recv_frame_size = LIBERIO_CTRL_FRAME_MAX_SIZE; _ctrl_dma_xport = - make_muxed_liberio_xport(tx_dev, rx_dev, default_buff_args, int(divisor)); + make_muxed_liberio_xport(tx_dev, rx_dev, default_buff_args, + uhd::rfnoc::MAX_NUM_BLOCKS * uhd::rfnoc::MAX_NUM_PORTS); } UHD_LOGGER_TRACE("MPMD") @@ -105,10 +100,9 @@ uhd::both_xports_t mpmd_xport_ctrl_liberio::make_transport( } else if (xport_type == usrp::device3_impl::ASYNC_MSG) { UHD_ASSERT_THROW(xport_info["muxed"] == "True"); if (not _async_msg_dma_xport) { - default_buff_args.send_frame_size = LIBERIO_ASYNC_FRAME_MAX_SIZE; - default_buff_args.recv_frame_size = LIBERIO_ASYNC_FRAME_MAX_SIZE; _async_msg_dma_xport = - make_muxed_liberio_xport(tx_dev, rx_dev, default_buff_args, int(divisor)); + make_muxed_liberio_xport(tx_dev, rx_dev, default_buff_args, + uhd::rfnoc::MAX_NUM_BLOCKS * uhd::rfnoc::MAX_NUM_PORTS); } UHD_LOGGER_TRACE("MPMD") @@ -119,16 +113,11 @@ uhd::both_xports_t mpmd_xport_ctrl_liberio::make_transport( transport::liberio_zero_copy::make(tx_dev, rx_dev, default_buff_args); } - transport::udp_zero_copy::buff_params buff_params; - buff_params.recv_buff_size = float(default_buff_args.recv_frame_size) - * float(default_buff_args.num_recv_frames) / divisor; - buff_params.send_buff_size = float(default_buff_args.send_frame_size) - * float(default_buff_args.num_send_frames) / divisor; - - // Finish both_xports_t object and return: - xports.recv_buff_size = buff_params.recv_buff_size; - xports.send_buff_size = buff_params.send_buff_size; + xports.recv_buff_size = default_buff_args.recv_frame_size * + default_buff_args.num_recv_frames; + xports.send_buff_size = default_buff_args.send_frame_size * + default_buff_args.num_send_frames; xports.send = xports.recv; return xports; } diff --git a/host/lib/usrp/x300/x300_impl.cpp b/host/lib/usrp/x300/x300_impl.cpp index ed6678761..c42f8dece 100644 --- a/host/lib/usrp/x300/x300_impl.cpp +++ b/host/lib/usrp/x300/x300_impl.cpp @@ -1256,8 +1256,8 @@ static uhd::transport::muxed_zero_copy_if::sptr make_muxed_pcie_msg_xport( zero_copy_xport_params buff_args; buff_args.send_frame_size = x300::PCIE_MSG_FRAME_SIZE; buff_args.recv_frame_size = x300::PCIE_MSG_FRAME_SIZE; - buff_args.num_send_frames = x300::PCIE_MSG_NUM_FRAMES * max_muxed_ports; - buff_args.num_recv_frames = x300::PCIE_MSG_NUM_FRAMES * max_muxed_ports; + buff_args.num_send_frames = x300::PCIE_MSG_NUM_FRAMES; + buff_args.num_recv_frames = x300::PCIE_MSG_NUM_FRAMES; zero_copy_if::sptr base_xport = nirio_zero_copy::make( rio_fpga_interface, dma_channel_num, buff_args, uhd::device_addr_t()); |