From f9f7b34d546a79bec55cf9d0e48ef3876f0f67d7 Mon Sep 17 00:00:00 2001 From: Michael West Date: Wed, 13 Feb 2019 16:29:18 -0800 Subject: RFNoC: Disable FC ACK packets for lossless links FC ACK packets are unnecessary on lossless links and degrade overall performance. This change disables those packets on all lossless links. Signed-off-by: Michael West --- fpga-src | 2 +- host/include/uhd/rfnoc/constants.hpp | 2 +- host/include/uhd/rfnoc/source_block_ctrl_base.hpp | 14 ++++++++------ host/lib/rfnoc/graph_impl.cpp | 17 +++++++++++------ host/lib/rfnoc/source_block_ctrl_base.cpp | 6 ++++-- host/lib/usrp/device3/device3_io_impl.cpp | 1 + images/manifest.txt | 14 +++++++------- 7 files changed, 33 insertions(+), 23 deletions(-) diff --git a/fpga-src b/fpga-src index e57dfe075..4bc2c6fc6 160000 --- a/fpga-src +++ b/fpga-src @@ -1 +1 @@ -Subproject commit e57dfe075c8056a5afe5528c1bc21e92b5149379 +Subproject commit 4bc2c6fc62481452033463ce354ca1ab0343342f diff --git a/host/include/uhd/rfnoc/constants.hpp b/host/include/uhd/rfnoc/constants.hpp index 3e67a3cae..2bef70a75 100644 --- a/host/include/uhd/rfnoc/constants.hpp +++ b/host/include/uhd/rfnoc/constants.hpp @@ -25,7 +25,7 @@ static const std::string XML_PATH_ENV = "UHD_RFNOC_DIR"; static const std::string DEFAULT_BLOCK_NAME = "Block"; static const uint64_t DEFAULT_NOC_ID = 0xFFFFFFFFFFFFFFFF; static const size_t NOC_SHELL_COMPAT_MAJOR = 5; -static const size_t NOC_SHELL_COMPAT_MINOR = 0; +static const size_t NOC_SHELL_COMPAT_MINOR = 1; static const size_t MAX_PACKET_SIZE = 8000; // bytes static const size_t DEFAULT_PACKET_SIZE = 1456; // bytes diff --git a/host/include/uhd/rfnoc/source_block_ctrl_base.hpp b/host/include/uhd/rfnoc/source_block_ctrl_base.hpp index c0a8494c1..a22a19da9 100644 --- a/host/include/uhd/rfnoc/source_block_ctrl_base.hpp +++ b/host/include/uhd/rfnoc/source_block_ctrl_base.hpp @@ -102,15 +102,17 @@ public: * disables byte based flow control. If both byte based flow control and the packet * limit are set to zero, the block will then produce data as fast as it can. \b * Warning: This can cause head-of-line blocking, and potentially lock up your device! - * \param pkt_limit Limit the maximum number of packets in flight. Setting this to - * zero disables packet limiting. Usually kept disabled except for special case - * connections (such as DMA) that support only a finite number of packets in flight. - * \param block_port Specify on which outgoing port this setting is valid. - * \param sid The SID for which this is valid. This is meant for cases where the - * outgoing block port is not sufficient to set the flow control, and as such is + * \param lossless_link The link for the connection is lossless. Periodic sync + * packets will be disabled. \param pkt_limit Limit the maximum number of packets in + * flight. Setting this to zero disables packet limiting. Usually kept disabled except + * for special case connections (such as DMA) that support only a finite number of + * packets in flight. \param block_port Specify on which outgoing port this setting is + * valid. \param sid The SID for which this is valid. This is meant for cases where + * the outgoing block port is not sufficient to set the flow control, and as such is * rarely used. */ virtual void configure_flow_control_out(const bool enable_output, + const bool lossless_link, const size_t buf_size_bytes, const size_t pkt_limit = 0, const size_t block_port = 0, diff --git a/host/lib/rfnoc/graph_impl.cpp b/host/lib/rfnoc/graph_impl.cpp index 989bcb0c4..326e9205d 100644 --- a/host/lib/rfnoc/graph_impl.cpp +++ b/host/lib/rfnoc/graph_impl.cpp @@ -120,17 +120,17 @@ void graph_impl::connect(const block_id_t& src_block, % dst->get_block_id().get() % (dst->get_fifo_size(dst_block_port) / 1024) % (pkt_size / 1024) % src->get_block_id().get())); } + const bool same_xbar = sid.get_src_addr() == sid.get_dst_addr(); src->configure_flow_control_out(true, /* enable output */ + same_xbar, // Lossless link if on same crossbar buf_size_bytes, 0, /* no packet limit. We need to revisit this at some point. */ src_block_port); // On the same crossbar, use lots of FC packets - 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 = buf_size_bytes / uhd::rfnoc::DEFAULT_FC_TX_RESPONSE_FREQ; - } + const size_t bytes_per_response = + same_xbar ? buf_size_bytes / uhd::rfnoc::DEFAULT_FC_XBAR_RESPONSE_FREQ + : 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); @@ -189,7 +189,12 @@ void graph_impl::connect_src(const block_id_t& src_block, % (buf_size_dst_bytes / 1024) % (pkt_size / 1024) % src->get_block_id().get())); } - src->configure_flow_control_out(buf_size_pkts, src_block_port); + + src->configure_flow_control_out(true, /* enable output */ + (dst_sid.get_src_addr() == dst_sid.get_dst_addr()), + buf_size_dst_bytes, + 0, /* no packet limit. We need to revisit this at some point. */ + src_block_port); } void graph_impl::connect_sink( diff --git a/host/lib/rfnoc/source_block_ctrl_base.cpp b/host/lib/rfnoc/source_block_ctrl_base.cpp index 6c41fae14..656ab26af 100644 --- a/host/lib/rfnoc/source_block_ctrl_base.cpp +++ b/host/lib/rfnoc/source_block_ctrl_base.cpp @@ -86,6 +86,7 @@ void source_block_ctrl_base::set_destination( } void source_block_ctrl_base::configure_flow_control_out(const bool enable_fc_output, + const bool lossless_link, const size_t buf_size_bytes, const size_t pkt_limit, const size_t block_port, @@ -124,8 +125,9 @@ void source_block_ctrl_base::configure_flow_control_out(const bool enable_fc_out // count based flow control const bool enable_byte_fc = (buf_size_bytes != 0); const bool enable_pkt_cnt_fc = (pkt_limit != 0); - const uint32_t config = (enable_fc_output ? 1 : 0) | (enable_byte_fc << 1) - | (enable_pkt_cnt_fc << 2); + const uint32_t config = (enable_fc_output ? 1 : 0) | ((enable_byte_fc ? 1 : 0) << 1) + | ((enable_pkt_cnt_fc ? 1 : 0) << 2) + | ((lossless_link ? 1 : 0) << 3); // Resize the FC window. // Precondition: No data can be buffered upstream. diff --git a/host/lib/usrp/device3/device3_io_impl.cpp b/host/lib/usrp/device3/device3_io_impl.cpp index 2bc59f1a8..ce8ff2cbf 100644 --- a/host/lib/usrp/device3/device3_io_impl.cpp +++ b/host/lib/usrp/device3/device3_io_impl.cpp @@ -357,6 +357,7 @@ rx_streamer::sptr device3_impl::get_rx_stream(const stream_args_t& args_) UHD_RX_STREAMER_LOG() << "Flow Control Window = " << (fc_window) << ", Flow Control Handler Window = " << fc_handle_window; blk_ctrl->configure_flow_control_out(true, + xport.lossless, fc_window, rx_hints.cast("recv_pkt_limit", 0), // On rfnoc-devel, update e300_impl::get_rx_hints() to set this to 32 diff --git a/images/manifest.txt b/images/manifest.txt index 86ee95209..86f0d11a9 100644 --- a/images/manifest.txt +++ b/images/manifest.txt @@ -1,24 +1,24 @@ # UHD Image Manifest File # Target hash url SHA256 # X300-Series -x3xx_x310_fpga_default fpga-e57dfe0 x3xx/fpga-e57dfe0/x3xx_x310_fpga_default-ge57dfe0.zip 97d225bbe686179aa674caf25ecdd8198c7b4301b1e0368ab9f40f09d69e6169 -x3xx_x300_fpga_default fpga-e57dfe0 x3xx/fpga-e57dfe0/x3xx_x300_fpga_default-ge57dfe0.zip 37db8ecbcb20a1d11323e0f68b78fd8443ff4006da6add9090f53b71e5464989 +x3xx_x310_fpga_default fpga-4bc2c6f x3xx/fpga-4bc2c6f/x3xx_x310_fpga_default-g4bc2c6f.zip 6da3dd72b8d409c085c4124cca9e2f84f42f3fbd91adba8bae2e5ddfa9138cb1 +x3xx_x300_fpga_default fpga-4bc2c6f x3xx/fpga-4bc2c6f/x3xx_x300_fpga_default-g4bc2c6f.zip dcf969eda4da765b7d3cf30fcde31fa592cc2c2fdbb2246f56b39c28ae8d0822 # Example daughterboard targets (none currently exist) #x3xx_twinrx_cpld_default example_target #dboard_ubx_cpld_default example_target # E-Series -e3xx_e310_fpga_default fpga-e57dfe0 e3xx/fpga-e57dfe0/e3xx_e310_fpga_default-ge57dfe0.zip 4cd3444c99681dbe3da4f2466c11f9572324a733eb4fddc3293db16a63e4e4a7 +e3xx_e310_fpga_default fpga-4bc2c6f e3xx/fpga-4bc2c6f/e3xx_e310_fpga_default-g4bc2c6f.zip be090f7cd187eb020e0cc8a8a7094b9691c4b7fa3dde82ca242030287a577475 e3xx_e310_fpga_rfnoc fpga-d6a878b e3xx/fpga-d6a878b/e3xx_e310_fpga_rfnoc-gd6a878b.zip 5c9b89fb6293423644868c22e914de386a9af39ff031da6800a1cf39a90ea73b -e3xx_e320_fpga_default fpga-e57dfe0 e3xx/fpga-e57dfe0/e3xx_e320_fpga_default-ge57dfe0.zip 5d263e734e55658c1cee01717d45e6a26c03f73a221d1babc93937a9e1cc10cb +e3xx_e320_fpga_default fpga-4bc2c6f e3xx/fpga-4bc2c6f/e3xx_e320_fpga_default-g4bc2c6f.zip 0def19fda1041866273c09d3bacc7e2dba916b8848c8a17a85fecd04009bab73 # E320 Filesystems, etc e3xx_e320_sdk_default meta-ettus-v3.14.0.0-rc1 e3xx/meta-ettus-v3.14.0.0-rc1/e3xx_e320_sdk_default-v3.14.0.0-rc1.zip 0 e3xx_e320_mender_default meta-ettus-v3.14.0.0-rc1 e3xx/meta-ettus-v3.14.0.0-rc1/e3xx_e320_mender_default-v3.14.0.0-rc1.zip 0 e3xx_e320_sdimg_default meta-ettus-v3.14.0.0-rc1 e3xx/meta-ettus-v3.14.0.0-rc1/e3xx_e320_sdimg_default-v3.14.0.0-rc1.zip 0 # N300-Series -n3xx_n310_fpga_default fpga-e57dfe0 n3xx/fpga-e57dfe0/n3xx_n310_fpga_default-ge57dfe0.zip 70d7af1261a77545b611f6ffd00e4c3507791ee07e0e6a7ec0e92f98be64c419 -n3xx_n300_fpga_default fpga-e57dfe0 n3xx/fpga-e57dfe0/n3xx_n300_fpga_default-ge57dfe0.zip 13f81bf7c22763fe814fee3d2c592d1c11360a42bfe9b133d0f5f3f4c5f9edad -n3xx_n320_fpga_default fpga-e57dfe0 n3xx/fpga-e57dfe0/n3xx_n320_fpga_default-ge57dfe0.zip 3139b39f80ad1eb87c16f6cb8bcc4090b8bd4d547fb943d71405c001532d84d4 +n3xx_n310_fpga_default fpga-4bc2c6f n3xx/fpga-4bc2c6f/n3xx_n310_fpga_default-g4bc2c6f.zip bbe7d43c098aa847fa656d22a2c0f0d6d8e499e3d2267842d1a01591645b1472 +n3xx_n300_fpga_default fpga-4bc2c6f n3xx/fpga-4bc2c6f/n3xx_n300_fpga_default-g4bc2c6f.zip 1d192a5a07601eb9b229ee604cf9ba7b32ea4fefe7b6e218a18d31f4c1f07b0a +n3xx_n320_fpga_default fpga-4bc2c6f n3xx/fpga-4bc2c6f/n3xx_n320_fpga_default-g4bc2c6f.zip 18c78f42ecd4350fadc0988694a0ee5c60aeb0e5e91aa6fe35a29549260a4199 n3xx_n310_cpld_default fpga-6bea23d n3xx/fpga-6bea23d/n3xx_n310_cpld_default-g6bea23d.zip ef128dcd265ee8615b673021d4ee84c39357012ffe8b28c8ad7f893f9dcb94cb n3xx_n320_cpld_default fpga-5688c09d n3xx/fpga-5688c09d/n3xx_n320_cpld_default-g5688c09d.zip 9a9746f470623c8a4ec9e104fecd227e001786492d2a5f056198a743f055811b # N3XX Mykonos firmware -- cgit v1.2.3