diff options
author | michael-west <michael.west@ettus.com> | 2019-01-30 15:37:57 -0800 |
---|---|---|
committer | Ashish Chaudhari <ashish.chaudhari@ettus.com> | 2019-01-31 13:55:21 -0800 |
commit | ac025ebf40ad9ab6cb9945e25bad87016ae77128 (patch) | |
tree | 864c5d3c9753c7daf3770b506ee2e92783bd93c1 /host/lib/usrp/x300/x300_impl.cpp | |
parent | 73104a90f081c912cc6d700d6db1896e4e23dadf (diff) | |
download | uhd-ac025ebf40ad9ab6cb9945e25bad87016ae77128.tar.gz uhd-ac025ebf40ad9ab6cb9945e25bad87016ae77128.tar.bz2 uhd-ac025ebf40ad9ab6cb9945e25bad87016ae77128.zip |
RFNoC: Limit number of control packets in flight
Limit number of unacknowledged control packets to the number of
receive frames in the transport to prevent the transport from
getting locked up or being overrun by ACK packets.
Signed-off-by: michael-west <michael.west@ettus.com>
Diffstat (limited to 'host/lib/usrp/x300/x300_impl.cpp')
-rw-r--r-- | host/lib/usrp/x300/x300_impl.cpp | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/host/lib/usrp/x300/x300_impl.cpp b/host/lib/usrp/x300/x300_impl.cpp index d912d66c3..24ce7abf4 100644 --- a/host/lib/usrp/x300/x300_impl.cpp +++ b/host/lib/usrp/x300/x300_impl.cpp @@ -1372,12 +1372,24 @@ uhd::both_xports_t x300_impl::make_transport(const uhd::sid_t& address, std::min(system_max_send_frame_size, x300::ETH_MSG_FRAME_SIZE); default_buff_args.recv_frame_size = std::min(system_max_recv_frame_size, x300::ETH_MSG_FRAME_SIZE); + // Buffering is done in the socket buffers, so size them relative to + // the link rate default_buff_args.send_buff_size = conn.link_rate / 50; // 20ms default_buff_args.recv_buff_size = std::max(conn.link_rate / 50, x300::ETH_MSG_NUM_FRAMES * x300::ETH_MSG_FRAME_SIZE); // enough to hold greater of 20ms or number // of msg frames - if (xport_type == TX_DATA) { + // There is no need for more than 1 send and recv frame since the + // buffering is done in the socket buffers + default_buff_args.num_send_frames = 1; + default_buff_args.num_recv_frames = 1; + if (xport_type == CTRL) { + // Increasing number of recv frames here because ctrl_iface uses it + // to determine how many control packets can be in flight before it + // must wait for an ACK + default_buff_args.num_recv_frames = + uhd::rfnoc::CMD_FIFO_SIZE / uhd::rfnoc::MAX_CMD_PKT_SIZE; + } else if (xport_type == TX_DATA) { size_t default_frame_size = conn.link_rate == x300::MAX_RATE_1GIGE ? x300::GE_DATA_FRAME_SEND_SIZE : x300::XGE_DATA_FRAME_SEND_SIZE; |