diff options
author | mattprost <matt.prost@ni.com> | 2021-03-31 11:33:33 -0500 |
---|---|---|
committer | Aaron Rossetto <aaron.rossetto@ni.com> | 2021-04-29 14:35:26 -0500 |
commit | d689df23fb4bf38e1abc23b06767fc26aa27c163 (patch) | |
tree | b89a640a8e86ec572958d7602cc2c9d834f68fdf /host/lib/usrp/x300/x300_mb_iface.cpp | |
parent | 99e5230e4bf26166ee1accce1e57ff24b0629826 (diff) | |
download | uhd-d689df23fb4bf38e1abc23b06767fc26aa27c163.tar.gz uhd-d689df23fb4bf38e1abc23b06767fc26aa27c163.tar.bz2 uhd-d689df23fb4bf38e1abc23b06767fc26aa27c163.zip |
rfnoc: Add option to disable flow control on rx streaming
Disabling this feature will allow the USRP to send a continuous stream
of Rx data to a host machine without throttling due to lack of flow
control credits. This is unnecessary overhead on lossless transports
such as pcie or aurora.
Usage: add 'enable_fc=false' to stream_args.args
Signed-off-by: mattprost <matt.prost@ni.com>
Diffstat (limited to 'host/lib/usrp/x300/x300_mb_iface.cpp')
-rw-r--r-- | host/lib/usrp/x300/x300_mb_iface.cpp | 70 |
1 files changed, 45 insertions, 25 deletions
diff --git a/host/lib/usrp/x300/x300_mb_iface.cpp b/host/lib/usrp/x300/x300_mb_iface.cpp index c89374f82..a351864df 100644 --- a/host/lib/usrp/x300/x300_mb_iface.cpp +++ b/host/lib/usrp/x300/x300_mb_iface.cpp @@ -98,12 +98,17 @@ uhd::rfnoc::chdr_ctrl_xport::sptr x300_impl::x300_mb_iface::make_ctrl_transport( send_link_if::sptr send_link; recv_link_if::sptr recv_link; bool lossy_xport; - std::tie(send_link, std::ignore, recv_link, std::ignore, lossy_xport, std::ignore) = - _conn_mgr->get_links(link_type_t::CTRL, - local_device_id, - local_epid, - uhd::rfnoc::sep_id_t(), - uhd::device_addr_t()); + std::tie(send_link, + std::ignore, + recv_link, + std::ignore, + lossy_xport, + std::ignore, + std::ignore) = _conn_mgr->get_links(link_type_t::CTRL, + local_device_id, + local_epid, + uhd::rfnoc::sep_id_t(), + uhd::device_addr_t()); /* Associate local device ID with the adapter */ _adapter_map[local_device_id] = send_link->get_send_adapter_id(); @@ -142,13 +147,18 @@ uhd::rfnoc::chdr_rx_data_xport::uptr x300_impl::x300_mb_iface::make_rx_data_tran send_link_if::sptr send_link; recv_link_if::sptr recv_link; size_t recv_buff_size; - bool lossy_xport, packet_fc; - std::tie(send_link, std::ignore, recv_link, recv_buff_size, lossy_xport, packet_fc) = - _conn_mgr->get_links(link_type_t::RX_DATA, - local_sep_addr.first, - local_epid, - remote_epid, - xport_args); + bool lossy_xport, packet_fc, enable_fc; + std::tie(send_link, + std::ignore, + recv_link, + recv_buff_size, + lossy_xport, + packet_fc, + enable_fc) = _conn_mgr->get_links(link_type_t::RX_DATA, + local_sep_addr.first, + local_epid, + remote_epid, + xport_args); /* Associate local device ID with the adapter */ _adapter_map[local_sep_addr.first] = send_link->get_send_adapter_id(); @@ -159,14 +169,19 @@ uhd::rfnoc::chdr_rx_data_xport::uptr x300_impl::x300_mb_iface::make_rx_data_tran const double ratio = 1.0 / 32; - // Configure flow control frequency to use either bytes only or packets only uhd::rfnoc::stream_buff_params_t fc_freq; - if (packet_fc) { - fc_freq = {uhd::rfnoc::MAX_FC_FREQ_BYTES, - static_cast<uint32_t>(std::ceil(recv_link->get_num_recv_frames() * ratio))}; + if (enable_fc) { + // Configure flow control frequency to use either bytes only or packets only + if (packet_fc) { + fc_freq = {uhd::rfnoc::MAX_FC_FREQ_BYTES, + static_cast<uint32_t>( + std::ceil(recv_link->get_num_recv_frames() * ratio))}; + } else { + fc_freq = {static_cast<uint64_t>(std::ceil(double(recv_buff_size) * ratio)), + uhd::rfnoc::MAX_FC_FREQ_PKTS}; + } } else { - fc_freq = {static_cast<uint64_t>(std::ceil(double(recv_buff_size) * ratio)), - uhd::rfnoc::MAX_FC_FREQ_PKTS}; + fc_freq = {0, 0}; } uhd::rfnoc::stream_buff_params_t fc_headroom = {0, 0}; @@ -235,12 +250,17 @@ uhd::rfnoc::chdr_tx_data_xport::uptr x300_impl::x300_mb_iface::make_tx_data_tran send_link_if::sptr send_link; recv_link_if::sptr recv_link; bool lossy_xport; - std::tie(send_link, std::ignore, recv_link, std::ignore, lossy_xport, std::ignore) = - _conn_mgr->get_links(link_type_t::TX_DATA, - local_sep_addr.first, - local_epid, - remote_epid, - xport_args); + std::tie(send_link, + std::ignore, + recv_link, + std::ignore, + lossy_xport, + std::ignore, + std::ignore) = _conn_mgr->get_links(link_type_t::TX_DATA, + local_sep_addr.first, + local_epid, + remote_epid, + xport_args); /* Associate local device ID with the adapter */ _adapter_map[local_sep_addr.first] = send_link->get_send_adapter_id(); |