diff options
-rw-r--r-- | host/lib/usrp/mpmd/mpmd_xport_ctrl_liberio.cpp | 18 | ||||
-rw-r--r-- | host/lib/usrp/mpmd/mpmd_xport_ctrl_liberio.hpp | 2 | ||||
-rw-r--r-- | mpm/python/usrp_mpm/xports/xportmgr_liberio.py | 12 |
3 files changed, 27 insertions, 5 deletions
diff --git a/host/lib/usrp/mpmd/mpmd_xport_ctrl_liberio.cpp b/host/lib/usrp/mpmd/mpmd_xport_ctrl_liberio.cpp index 8f3014bc7..78751c94f 100644 --- a/host/lib/usrp/mpmd/mpmd_xport_ctrl_liberio.cpp +++ b/host/lib/usrp/mpmd/mpmd_xport_ctrl_liberio.cpp @@ -107,8 +107,22 @@ uhd::both_xports_t mpmd_xport_ctrl_liberio::make_transport( << "making (muxed) stream with num " << xports.recv_sid.get_dst(); xports.recv = _async_msg_dma_xport->make_stream(xports.recv_sid.get_dst()); } else { - xports.recv = - transport::liberio_zero_copy::make(tx_dev, rx_dev, default_buff_args); + // Create muxed transport in case of less DMA channels + if (xport_info["muxed"] == "True") { + if (not _data_dma_xport) { + _data_dma_xport = + 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") + << "Making (muxed) stream with num " << xports.recv_sid.get_dst(); + xports.recv = _data_dma_xport->make_stream(xports.recv_sid.get_dst()); + } + else { + xports.recv = + transport::liberio_zero_copy::make(tx_dev, rx_dev, default_buff_args); + } } // Finish both_xports_t object and return: diff --git a/host/lib/usrp/mpmd/mpmd_xport_ctrl_liberio.hpp b/host/lib/usrp/mpmd/mpmd_xport_ctrl_liberio.hpp index 5f635e7e7..36f02fe46 100644 --- a/host/lib/usrp/mpmd/mpmd_xport_ctrl_liberio.hpp +++ b/host/lib/usrp/mpmd/mpmd_xport_ctrl_liberio.hpp @@ -45,6 +45,8 @@ private: //! Control transport for one liberio connection uhd::transport::muxed_zero_copy_if::sptr _ctrl_dma_xport; + //! Data transport for one liberio connection + uhd::transport::muxed_zero_copy_if::sptr _data_dma_xport; //! Control transport for one liberio connection uhd::transport::muxed_zero_copy_if::sptr _async_msg_dma_xport; }; diff --git a/mpm/python/usrp_mpm/xports/xportmgr_liberio.py b/mpm/python/usrp_mpm/xports/xportmgr_liberio.py index b035e64fe..c9c5ee0f1 100644 --- a/mpm/python/usrp_mpm/xports/xportmgr_liberio.py +++ b/mpm/python/usrp_mpm/xports/xportmgr_liberio.py @@ -64,12 +64,18 @@ class XportMgrLiberio(object): elif xport_type == 'ASYNC_MSG': chan = 1 else: - chan = 2 + self._data_chan_ctr - self._data_chan_ctr += 1 + if self.max_chan > 4: + chan = 2 + self._data_chan_ctr + self._data_chan_ctr += 1 + else: + if xport_type == 'RX_DATA': + chan = 2 + else: + chan = 3 xport_info = { 'type': 'liberio', 'send_sid': str(sid), - 'muxed': str(xport_type in ('CTRL', 'ASYNC_MSG')), + 'muxed': str(xport_type in ('CTRL', 'ASYNC_MSG')) if (self.max_chan > 4) else 'True', 'dma_chan': str(chan), 'tx_dev': "/dev/tx-dma{}".format(chan), 'rx_dev': "/dev/rx-dma{}".format(chan), |