diff options
author | michael-west <michael.west@ettus.com> | 2019-01-18 18:42:36 -0800 |
---|---|---|
committer | Brent Stapleton <brent.stapleton@ettus.com> | 2019-01-21 16:53:03 -0800 |
commit | 86932606e3fe6b7ec89183e7f63252148047ad42 (patch) | |
tree | d87946fb0e297e379ea48f4eeb9b863d330f317b /host/lib/usrp | |
parent | f25e807f7862b02ede02547424ee11d414279ed9 (diff) | |
download | uhd-86932606e3fe6b7ec89183e7f63252148047ad42.tar.gz uhd-86932606e3fe6b7ec89183e7f63252148047ad42.tar.bz2 uhd-86932606e3fe6b7ec89183e7f63252148047ad42.zip |
transport: muxed_zero_copy_if fixes
Changed muxed_zero_copy_if to make each stream buffer the same number
of frames as the underlying transport and changed the size of the
underlying control transport for X300 and MPMD devices to match the
size of the command FIFO in order to prevent starvation of any single
control transport. Added some constants to remove hard coded values.
Signed-off-by: michael-west <michael.west@ettus.com>
Diffstat (limited to 'host/lib/usrp')
-rw-r--r-- | host/lib/usrp/mpmd/mpmd_xport_ctrl_liberio.cpp | 37 | ||||
-rw-r--r-- | host/lib/usrp/x300/x300_impl.cpp | 4 |
2 files changed, 15 insertions, 26 deletions
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()); |