From 4dd85e0b4141cfaa3020affa824f83d1e28f4ae6 Mon Sep 17 00:00:00 2001 From: Aaron Rossetto Date: Wed, 12 May 2021 16:24:28 -0500 Subject: rfnoc: noc_block_base: Throw if set_mtu_forwarding_policy() called multiply --- host/include/uhd/rfnoc/noc_block_base.hpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'host/include') 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> _mtu_props; -- cgit v1.2.3