From 930fa39c601d1601884ca6ead9f44841f0348f18 Mon Sep 17 00:00:00 2001 From: Martin Braun Date: Wed, 26 Jan 2022 10:12:38 +0100 Subject: rfnoc: Update the MTU forwarding property for some blocks Note that the default MTU forwarding policy is ONE_TO_ONE, therefore, it is only strictly necessary to modify the MTU forwarding policy for blocks that route data in a different manner. However, it may be nice to explicitly state the forwarding policy for the benefit of the reader. The following blocks had their policies updated: - addsub: ONE_TO_FAN - duc: ONE_TO_ONE - dmafifo: ONE_TO_ONE - null block: DROP - replay block: DROP - split stream: ONE_TO_FAN - switchboard: ONE_TO_FAN --- host/lib/rfnoc/addsub_block_control.cpp | 3 +++ host/lib/rfnoc/ddc_block_control.cpp | 2 ++ host/lib/rfnoc/dmafifo_block_control.cpp | 3 +++ host/lib/rfnoc/duc_block_control.cpp | 4 ++++ host/lib/rfnoc/null_block_control.cpp | 3 +++ host/lib/rfnoc/replay_block_control.cpp | 2 ++ host/lib/rfnoc/split_stream_block_control.cpp | 4 ++++ host/lib/rfnoc/switchboard_block_control.cpp | 4 ++++ 8 files changed, 25 insertions(+) (limited to 'host/lib') diff --git a/host/lib/rfnoc/addsub_block_control.cpp b/host/lib/rfnoc/addsub_block_control.cpp index 516b348b1..f91703193 100644 --- a/host/lib/rfnoc/addsub_block_control.cpp +++ b/host/lib/rfnoc/addsub_block_control.cpp @@ -37,6 +37,9 @@ public: // opposite side from which they are received. set_prop_forwarding_policy(forwarding_policy_t::ONE_TO_FAN); set_action_forwarding_policy(forwarding_policy_t::ONE_TO_FAN); + // MTU is also fanned out the same way as we produce output packets the + // same size as input packets. + set_mtu_forwarding_policy(forwarding_policy_t::ONE_TO_FAN); // Register the block's edge type properties. register_property(&_prop_type_in_a); diff --git a/host/lib/rfnoc/ddc_block_control.cpp b/host/lib/rfnoc/ddc_block_control.cpp index 12e89961d..fbc001cc9 100644 --- a/host/lib/rfnoc/ddc_block_control.cpp +++ b/host/lib/rfnoc/ddc_block_control.cpp @@ -74,6 +74,8 @@ public: << " halfbands and " "max CIC decimation " << _cic_max_decim); + // This line is not strictly necessary, as ONE_TO_ONE is the default. + // We set it make it explicit how this block works. set_mtu_forwarding_policy(forwarding_policy_t::ONE_TO_ONE); // Load list of valid decimation values std::set decims{1}; // 1 is always a valid decimation diff --git a/host/lib/rfnoc/dmafifo_block_control.cpp b/host/lib/rfnoc/dmafifo_block_control.cpp index efc8d27cb..cecd9ff3e 100644 --- a/host/lib/rfnoc/dmafifo_block_control.cpp +++ b/host/lib/rfnoc/dmafifo_block_control.cpp @@ -30,6 +30,9 @@ public: UHD_ASSERT_THROW(get_num_input_ports() == get_num_output_ports()); set_action_forwarding_policy(forwarding_policy_t::ONE_TO_ONE); set_prop_forwarding_policy(forwarding_policy_t::ONE_TO_ONE); + // This line is not strictly necessary, as ONE_TO_ONE is the default. + // We set it make it explicit how this block works. + set_mtu_forwarding_policy(forwarding_policy_t::ONE_TO_ONE); // Now init DMA/DRAM control _fifo_cores.reserve(get_num_input_ports()); for (size_t i = 0; i < get_num_input_ports(); i++) { diff --git a/host/lib/rfnoc/duc_block_control.cpp b/host/lib/rfnoc/duc_block_control.cpp index 487e4b8ff..95ab9fa71 100644 --- a/host/lib/rfnoc/duc_block_control.cpp +++ b/host/lib/rfnoc/duc_block_control.cpp @@ -72,6 +72,10 @@ public: << " halfbands and " "max CIC interpolation " << _cic_max_interp); + // This line is not strictly necessary, as ONE_TO_ONE is the default. + // We set it make it explicit how this block works. Output packets have + // the same size as the input packet. + set_mtu_forwarding_policy(forwarding_policy_t::ONE_TO_ONE); // Load list of valid interpolation values std::set interps{1}; // 1 is always a valid interpolation for (size_t hb = 0; hb < _num_halfbands; hb++) { diff --git a/host/lib/rfnoc/null_block_control.cpp b/host/lib/rfnoc/null_block_control.cpp index b51dbb906..1c32ba8b9 100644 --- a/host/lib/rfnoc/null_block_control.cpp +++ b/host/lib/rfnoc/null_block_control.cpp @@ -40,6 +40,9 @@ class null_block_control_impl : public null_block_control public: RFNOC_BLOCK_CONSTRUCTOR(null_block_control) { + // This block doesn't pass through packets, so the MTU can differ on + // input and output. + set_mtu_forwarding_policy(forwarding_policy_t::DROP); uint32_t initial_state = regs().peek32(REG_CTRL_STATUS); _streaming = initial_state & 0x2; _nipc = (initial_state >> 24) & 0xFF; diff --git a/host/lib/rfnoc/replay_block_control.cpp b/host/lib/rfnoc/replay_block_control.cpp index 79e7446e4..ce431ba80 100644 --- a/host/lib/rfnoc/replay_block_control.cpp +++ b/host/lib/rfnoc/replay_block_control.cpp @@ -96,6 +96,8 @@ public: // the graph). set_prop_forwarding_policy(forwarding_policy_t::DROP); set_action_forwarding_policy(forwarding_policy_t::DROP); + // Same for MTU + set_mtu_forwarding_policy(forwarding_policy_t::DROP); // Initialize record properties _record_type.reserve(_num_input_ports); diff --git a/host/lib/rfnoc/split_stream_block_control.cpp b/host/lib/rfnoc/split_stream_block_control.cpp index 17485882a..b98949514 100644 --- a/host/lib/rfnoc/split_stream_block_control.cpp +++ b/host/lib/rfnoc/split_stream_block_control.cpp @@ -41,6 +41,10 @@ public: // the split stream block. set_prop_forwarding_policy(forwarding_policy_t::USE_MAP); set_action_forwarding_policy(forwarding_policy_t::USE_MAP); + // MTU forwarding doesn't allow for USE_MAP, but we assume that packets + // coming in may potentially go to any output port. We thus fan out the + // MTU propagation. + set_mtu_forwarding_policy(forwarding_policy_t::ONE_TO_FAN); // Property propagation scheme (X --> Y means 'Properties received on // X propagate to Y'): diff --git a/host/lib/rfnoc/switchboard_block_control.cpp b/host/lib/rfnoc/switchboard_block_control.cpp index eec7f666f..b577d510d 100644 --- a/host/lib/rfnoc/switchboard_block_control.cpp +++ b/host/lib/rfnoc/switchboard_block_control.cpp @@ -36,6 +36,10 @@ public: // Configure property propagation and action forwarding behavior. set_prop_forwarding_policy(forwarding_policy_t::USE_MAP); set_action_forwarding_policy(forwarding_policy_t::USE_MAP); + // MTU forwarding doesn't allow for USE_MAP, but we assume that packets + // coming in may potentially go to any output port. We thus fan out the + // MTU propagation. + set_mtu_forwarding_policy(forwarding_policy_t::ONE_TO_FAN); _update_forwarding_map(); } -- cgit v1.2.3