From 5df498aeb985b40d72fa5165366e903351369f91 Mon Sep 17 00:00:00 2001 From: Martin Braun Date: Wed, 24 Nov 2021 15:51:29 +0100 Subject: rfnoc: Enable drop counter on chdr_ctrl_endpoint This class has a member _num_drops, which can be read out using the get_num_drops() API call. However, when dropping packets, this counter was not incremented, which is fixed now. This also includes a very minor optimization from 2 map<> lookups to 1 lookup (they are in O(log N)). Since there are usually a small two-digit number of endpoints connected to the async message receiver, this change is not expected to yield major improvements, but the lookup *is* in a hot loop. --- host/lib/include/uhdlib/rfnoc/chdr_ctrl_endpoint.hpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'host/lib/include') diff --git a/host/lib/include/uhdlib/rfnoc/chdr_ctrl_endpoint.hpp b/host/lib/include/uhdlib/rfnoc/chdr_ctrl_endpoint.hpp index 61358fa2f..65db20e5a 100644 --- a/host/lib/include/uhdlib/rfnoc/chdr_ctrl_endpoint.hpp +++ b/host/lib/include/uhdlib/rfnoc/chdr_ctrl_endpoint.hpp @@ -42,6 +42,11 @@ public: const clock_iface& timebase_clk) = 0; //! Returns the number of dropped packets due to misclassification + // + // This includes packets that are not valid CHDR as well as packets that + // are valid CHDR, but have no known/valid endpoint. Correctly classified + // packets may still be invalid, but they don't get counted here, they are + // handled in ctrlport_endpoint. virtual size_t get_num_drops() const = 0; //! Creates a control endpoint object -- cgit v1.2.3