diff options
| -rw-r--r-- | host/include/uhd/rfnoc/noc_block_base.hpp | 18 | ||||
| -rw-r--r-- | host/lib/rfnoc/noc_block_base.cpp | 7 | 
2 files changed, 15 insertions, 10 deletions
| diff --git a/host/include/uhd/rfnoc/noc_block_base.hpp b/host/include/uhd/rfnoc/noc_block_base.hpp index b18de41fc..454fb288b 100644 --- a/host/include/uhd/rfnoc/noc_block_base.hpp +++ b/host/include/uhd/rfnoc/noc_block_base.hpp @@ -261,15 +261,15 @@ protected:       *   all opposite side ports. This is an appropriate policy for the       *   split-stream block.       * -     * The default policy is DROP. +     * The default policy is ONE_TO_ONE.       * -     * Note: The MTU forwarding policy can only be set ONCE per instance of a -     * 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. This represents a change in behaviour from UHD 4.0. -     * Violations of this restriction will result in a uhd::runtime_error being -     * thrown. +     * Note: The MTU forwarding policy can only be set once, and only during +     * construction of a noc_block_base. If an RFNoC block subclassing +     * noc_block_base wants to modify the MTU forwarding policy, it must call +     * this function in its constructor. Once set, however, the MTU forwarding +     * policy cannot 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); @@ -358,7 +358,7 @@ private:      std::vector<property_t<double>> _tick_rate_props;      //! Forwarding policy for the MTU properties -    forwarding_policy_t _mtu_fwd_policy = forwarding_policy_t::DROP; +    forwarding_policy_t _mtu_fwd_policy = forwarding_policy_t::ONE_TO_ONE;      //! Flag indicating if MTU forwarding property has been set yet      bool _mtu_fwd_policy_set = false; diff --git a/host/lib/rfnoc/noc_block_base.cpp b/host/lib/rfnoc/noc_block_base.cpp index f854ca8d4..a43249e47 100644 --- a/host/lib/rfnoc/noc_block_base.cpp +++ b/host/lib/rfnoc/noc_block_base.cpp @@ -352,7 +352,12 @@ void noc_block_base::shutdown()  void noc_block_base::post_init()  { -    // nop +    // Verify the block set its MTU forwarding policy. If not, set it to the +    // default value. +    if (!_mtu_fwd_policy_set) { +        RFNOC_LOG_INFO("Setting default MTU forward policy."); +        set_mtu_forwarding_policy(_mtu_fwd_policy); +    }  }  std::shared_ptr<mb_controller> noc_block_base::get_mb_controller() | 
