From 78be3d548be78ffd871a0563499a6df0bfdf14b4 Mon Sep 17 00:00:00 2001 From: Moritz Fischer Date: Mon, 23 Feb 2015 13:30:17 -0800 Subject: e300: fc: This should fix the RX flow control. Two issues: - Call the correct overflow handler e300_impl vs rx_vita - Don't lie about buffer sizes and window sizes Signed-off-by: Moritz Fischer --- host/lib/usrp/e300/e300_impl.hpp | 1 + 1 file changed, 1 insertion(+) (limited to 'host/lib/usrp/e300/e300_impl.hpp') diff --git a/host/lib/usrp/e300/e300_impl.hpp b/host/lib/usrp/e300/e300_impl.hpp index a4170ee42..59e0d59ce 100644 --- a/host/lib/usrp/e300/e300_impl.hpp +++ b/host/lib/usrp/e300/e300_impl.hpp @@ -70,6 +70,7 @@ static std::string E300_SERVER_I2C_PORT = "21761"; static std::string E300_SERVER_SENSOR_PORT = "21762"; static const double E300_RX_SW_BUFF_FULLNESS = 0.9; //Buffer should be half full +static const size_t E300_RX_FC_REQUEST_FREQ = 32; // per flow ctrl window // crossbar settings static const boost::uint8_t E300_RADIO_DEST_PREFIX_TX = 0; -- cgit v1.2.3 From 963dcaa6a75862aec9ee4924dd88fa0901b39934 Mon Sep 17 00:00:00 2001 From: Moritz Fischer Date: Mon, 23 Feb 2015 14:12:59 -0800 Subject: e300: fc: Clean up the TX flowcontrol setup a bit. Use named constant instant of magic constant for response frequency. Signed-off-by: Moritz Fischer --- host/lib/usrp/e300/e300_impl.hpp | 1 + host/lib/usrp/e300/e300_io_impl.cpp | 8 +++++++- 2 files changed, 8 insertions(+), 1 deletion(-) (limited to 'host/lib/usrp/e300/e300_impl.hpp') diff --git a/host/lib/usrp/e300/e300_impl.hpp b/host/lib/usrp/e300/e300_impl.hpp index 59e0d59ce..c7d683f58 100644 --- a/host/lib/usrp/e300/e300_impl.hpp +++ b/host/lib/usrp/e300/e300_impl.hpp @@ -71,6 +71,7 @@ static std::string E300_SERVER_SENSOR_PORT = "21762"; static const double E300_RX_SW_BUFF_FULLNESS = 0.9; //Buffer should be half full static const size_t E300_RX_FC_REQUEST_FREQ = 32; // per flow ctrl window +static const size_t E300_TX_FC_RESPONSE_FREQ = 8; // per flow ctrl window // crossbar settings static const boost::uint8_t E300_RADIO_DEST_PREFIX_TX = 0; diff --git a/host/lib/usrp/e300/e300_io_impl.cpp b/host/lib/usrp/e300/e300_io_impl.cpp index a1d0a8da1..fa4915ed1 100644 --- a/host/lib/usrp/e300/e300_io_impl.cpp +++ b/host/lib/usrp/e300/e300_io_impl.cpp @@ -590,7 +590,13 @@ tx_streamer::sptr e300_impl::get_tx_stream(const uhd::stream_args_t &args_) //flow control setup const size_t fc_window = data_xports.send->get_num_send_frames(); - perif.deframer->configure_flow_control(0/*cycs off*/, fc_window/8/*pkts*/); + const size_t fc_handle_window = std::max(1, fc_window/E300_TX_FC_RESPONSE_FREQ); + + UHD_LOG << "TX Flow Control Window = " << fc_window + << ", TX Flow Control Handler Window = " + << fc_handle_window << std::endl; + + perif.deframer->configure_flow_control(0/*cycs off*/, fc_handle_window/*pkts*/); boost::shared_ptr fc_cache(new e300_tx_fc_cache_t()); fc_cache->stream_channel = stream_i; fc_cache->device_channel = args.channels[stream_i]; -- cgit v1.2.3