aboutsummaryrefslogtreecommitdiffstats
path: root/host/include
diff options
context:
space:
mode:
authorAaron Rossetto <aaron.rossetto@ni.com>2021-05-12 16:24:28 -0500
committerAaron Rossetto <aaron.rossetto@ni.com>2021-05-18 09:15:22 -0500
commit4dd85e0b4141cfaa3020affa824f83d1e28f4ae6 (patch)
treeaf6b74ec50d616cd6f1d8e7e911a797223a24799 /host/include
parent073574e24c777afcab40205b506d76ab29aa2309 (diff)
downloaduhd-4dd85e0b4141cfaa3020affa824f83d1e28f4ae6.tar.gz
uhd-4dd85e0b4141cfaa3020affa824f83d1e28f4ae6.tar.bz2
uhd-4dd85e0b4141cfaa3020affa824f83d1e28f4ae6.zip
rfnoc: noc_block_base: Throw if set_mtu_forwarding_policy() called multiply
Diffstat (limited to 'host/include')
-rw-r--r--host/include/uhd/rfnoc/noc_block_base.hpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/host/include/uhd/rfnoc/noc_block_base.hpp b/host/include/uhd/rfnoc/noc_block_base.hpp
index 0514849c4..dbb20b8d2 100644
--- a/host/include/uhd/rfnoc/noc_block_base.hpp
+++ b/host/include/uhd/rfnoc/noc_block_base.hpp
@@ -204,7 +204,9 @@ protected:
* noc_block_base. If an RFNoC block subclassing noc_block_base wants to
* modify the MTU forwarding policy, it would typically call this function
* in its constructor. Once set, however, the MTU forwarding policy cannot
- * be changed.
+ * be changed. This represents a change in behaviour from UHD 4.0.
+ * Violations of this restriction will result in a uhd::runtime_error being
+ * thrown.
*/
void set_mtu_forwarding_policy(const forwarding_policy_t policy);
@@ -294,6 +296,9 @@ private:
//! Forwarding policy for the MTU properties
forwarding_policy_t _mtu_fwd_policy = forwarding_policy_t::DROP;
+ //! Flag indicating if MTU forwarding property has been set yet
+ bool _mtu_fwd_policy_set = false;
+
//! Container for the 'mtu' property. This will hold one edge property
// for all in- and output edges.
std::vector<property_t<size_t>> _mtu_props;