diff options
author | michael-west <michael.west@ettus.com> | 2019-01-24 11:00:46 -0800 |
---|---|---|
committer | Ashish Chaudhari <ashish.chaudhari@ettus.com> | 2019-01-31 13:47:03 -0800 |
commit | bbb3aa78836a31e9df847a228c2f87e9e2a15fad (patch) | |
tree | e0a8828719a92c4595c391bd48edcca2f220ab64 /host | |
parent | 1223294e532b9452aef0942feb44389369317c6e (diff) | |
download | uhd-bbb3aa78836a31e9df847a228c2f87e9e2a15fad.tar.gz uhd-bbb3aa78836a31e9df847a228c2f87e9e2a15fad.tar.bz2 uhd-bbb3aa78836a31e9df847a228c2f87e9e2a15fad.zip |
RFNoC: Prevent unnecessary FC ACK packets
Avoid sending flow control ACK packets for lossless transports.
Add 'send_no_fc_acks' device argument to explicitly prevent
flow control ACK packets from being sent.
Signed-off-by: michael-west <michael.west@ettus.com>
Diffstat (limited to 'host')
-rw-r--r-- | host/lib/include/uhdlib/rfnoc/xports.hpp | 5 | ||||
-rw-r--r-- | host/lib/usrp/device3/device3_io_impl.cpp | 11 | ||||
-rw-r--r-- | host/lib/usrp/mpmd/mpmd_xport_ctrl_liberio.cpp | 9 | ||||
-rw-r--r-- | host/lib/usrp/x300/x300_impl.cpp | 1 |
4 files changed, 13 insertions, 13 deletions
diff --git a/host/lib/include/uhdlib/rfnoc/xports.hpp b/host/lib/include/uhdlib/rfnoc/xports.hpp index 06fd4713b..6b30fe5b1 100644 --- a/host/lib/include/uhdlib/rfnoc/xports.hpp +++ b/host/lib/include/uhdlib/rfnoc/xports.hpp @@ -18,7 +18,8 @@ namespace uhd { */ struct both_xports_t { - both_xports_t(): recv_buff_size(0), send_buff_size(0) {} + both_xports_t(): recv_buff_size(0), send_buff_size(0), lossless(false) + {} uhd::transport::zero_copy_if::sptr recv; uhd::transport::zero_copy_if::sptr send; size_t recv_buff_size; @@ -26,9 +27,9 @@ namespace uhd { uhd::sid_t send_sid; uhd::sid_t recv_sid; uhd::endianness_t endianness; + bool lossless; }; }; #endif /* INCLUDED_LIBUHD_XPORTS_HPP */ - diff --git a/host/lib/usrp/device3/device3_io_impl.cpp b/host/lib/usrp/device3/device3_io_impl.cpp index bf527e0ba..d0ec52971 100644 --- a/host/lib/usrp/device3/device3_io_impl.cpp +++ b/host/lib/usrp/device3/device3_io_impl.cpp @@ -731,9 +731,14 @@ tx_streamer::sptr device3_impl::get_tx_stream(const uhd::stream_args_t& args_) // CHDR does not support trailers my_streamer->set_enable_trailer(false); - my_streamer->set_xport_chan_post_send_cb(stream_i, [fc_cache, xport]() { - tx_flow_ctrl_ack(fc_cache, xport.send, xport.send_sid); - }); + // Avoid sending FC ACKs if the transport is lossless or the user + // has explictly requested not to send them + if (not (xport.lossless or tx_hints.has_key("send_no_fc_acks"))) + { + my_streamer->set_xport_chan_post_send_cb(stream_i, [fc_cache, xport]() { + tx_flow_ctrl_ack(fc_cache, xport.send, xport.send_sid); + }); + } } // Notify all blocks in this chain that they are connected to an active streamer diff --git a/host/lib/usrp/mpmd/mpmd_xport_ctrl_liberio.cpp b/host/lib/usrp/mpmd/mpmd_xport_ctrl_liberio.cpp index 139683597..8f3014bc7 100644 --- a/host/lib/usrp/mpmd/mpmd_xport_ctrl_liberio.cpp +++ b/host/lib/usrp/mpmd/mpmd_xport_ctrl_liberio.cpp @@ -79,13 +79,11 @@ uhd::both_xports_t mpmd_xport_ctrl_liberio::make_transport( const std::string rx_dev = xport_info["rx_dev"]; both_xports_t xports; + xports.lossless = true; xports.endianness = uhd::ENDIANNESS_LITTLE; xports.send_sid = sid_t(xport_info["send_sid"]); xports.recv_sid = xports.send_sid.reversed(); - // 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) { @@ -130,11 +128,6 @@ bool mpmd_xport_ctrl_liberio::is_valid( size_t mpmd_xport_ctrl_liberio::get_mtu(const uhd::direction_t dir) const { - /* TODO: this is extremely hacky. We don't know yet what broke liberio. - * Putting a bandaid here to help TXing. Remove this as soon as possible! - */ - if (dir == uhd::TX_DIRECTION) - return getpagesize(); return LIBERIO_PAGES_PER_BUF * getpagesize(); } diff --git a/host/lib/usrp/x300/x300_impl.cpp b/host/lib/usrp/x300/x300_impl.cpp index c42f8dece..d912d66c3 100644 --- a/host/lib/usrp/x300/x300_impl.cpp +++ b/host/lib/usrp/x300/x300_impl.cpp @@ -1277,6 +1277,7 @@ uhd::both_xports_t x300_impl::make_transport(const uhd::sid_t& address, both_xports_t xports; xports.endianness = mb.if_pkt_is_big_endian ? ENDIANNESS_BIG : ENDIANNESS_LITTLE; if (mb.xport_path == "nirio") { + xports.lossless = true; xports.send_sid = this->allocate_sid(mb, address, x300::SRC_ADDR0, x300::XB_DST_PCI); xports.recv_sid = xports.send_sid.reversed(); |