From cb9c97d643ac51279e61439c4e7caae9b1212c7d Mon Sep 17 00:00:00 2001 From: Michael West Date: Thu, 16 Nov 2017 11:59:45 -0800 Subject: X300: Change Ethernet buffering Ethernet buffering is now done so that most of the buffering is done in the socket buffers and multiple frames are only used to support the receive side offload of the socket I/O. Eliminates dropped packets at high full duplex rates. --- host/lib/rfnoc/graph_impl.cpp | 5 +++-- host/lib/rfnoc/sink_block_ctrl_base.cpp | 4 ++-- host/lib/rfnoc/source_block_ctrl_base.cpp | 10 +++++----- 3 files changed, 10 insertions(+), 9 deletions(-) (limited to 'host/lib/rfnoc') diff --git a/host/lib/rfnoc/graph_impl.cpp b/host/lib/rfnoc/graph_impl.cpp index a2e0e64f4..d9e069993 100644 --- a/host/lib/rfnoc/graph_impl.cpp +++ b/host/lib/rfnoc/graph_impl.cpp @@ -139,11 +139,12 @@ void graph_impl::connect( src_block_port ); // On the same crossbar, use lots of FC packets - size_t bytes_per_response = std::ceil(buf_size_bytes / uhd::rfnoc::DEFAULT_FC_XBAR_RESPONSE_FREQ); + size_t bytes_per_response = buf_size_bytes / uhd::rfnoc::DEFAULT_FC_XBAR_RESPONSE_FREQ; // Over the network, use less or we'd flood the transport if (sid.get_src_addr() != sid.get_dst_addr()) { - bytes_per_response = std::ceil(buf_size_bytes / uhd::rfnoc::DEFAULT_FC_TX_RESPONSE_FREQ); + bytes_per_response = buf_size_bytes / uhd::rfnoc::DEFAULT_FC_TX_RESPONSE_FREQ; } + UHD_ASSERT_THROW(bytes_per_response != 0); dst->configure_flow_control_in( bytes_per_response, dst_block_port diff --git a/host/lib/rfnoc/sink_block_ctrl_base.cpp b/host/lib/rfnoc/sink_block_ctrl_base.cpp index 1562e134b..d14fe2f38 100644 --- a/host/lib/rfnoc/sink_block_ctrl_base.cpp +++ b/host/lib/rfnoc/sink_block_ctrl_base.cpp @@ -52,8 +52,8 @@ size_t sink_block_ctrl_base::get_fifo_size(size_t block_port) const { } void sink_block_ctrl_base::configure_flow_control_in( - size_t bytes, - size_t block_port + const size_t bytes, + const size_t block_port ) { UHD_RFNOC_BLOCK_TRACE() << boost::format("sink_block_ctrl_base::configure_flow_control_in(bytes=%d)") % bytes; diff --git a/host/lib/rfnoc/source_block_ctrl_base.cpp b/host/lib/rfnoc/source_block_ctrl_base.cpp index afec6ba1b..0f1c31e4f 100644 --- a/host/lib/rfnoc/source_block_ctrl_base.cpp +++ b/host/lib/rfnoc/source_block_ctrl_base.cpp @@ -77,10 +77,10 @@ void source_block_ctrl_base::set_destination( } void source_block_ctrl_base::configure_flow_control_out( - bool enable_fc_output, - size_t buf_size_bytes, - size_t pkt_limit, - size_t block_port, + const bool enable_fc_output, + const size_t buf_size_bytes, + const size_t pkt_limit, + const size_t block_port, UHD_UNUSED(const uhd::sid_t &sid) ) { UHD_RFNOC_BLOCK_TRACE() << "source_block_ctrl_base::configure_flow_control_out() buf_size_bytes==" << buf_size_bytes; @@ -113,7 +113,7 @@ void source_block_ctrl_base::configure_flow_control_out( //based flow control const bool enable_byte_fc = (buf_size_bytes != 0); const bool enable_pkt_cnt_fc = (pkt_limit != 0); - const size_t config = enable_fc_output + (enable_byte_fc << 1) + (enable_pkt_cnt_fc << 2); + const uint32_t config = (enable_fc_output ? 1 : 0) | (enable_byte_fc << 1) | (enable_pkt_cnt_fc << 2); //Resize the FC window. //Precondition: No data can be buffered upstream. -- cgit v1.2.3