aboutsummaryrefslogtreecommitdiffstats
path: root/host/lib/include
diff options
context:
space:
mode:
authorMartin Braun <martin.braun@ettus.com>2021-11-24 15:51:29 +0100
committerAaron Rossetto <aaron.rossetto@ni.com>2021-12-03 11:35:04 -0800
commit5df498aeb985b40d72fa5165366e903351369f91 (patch)
tree654ab5906dacb1bd7bc81495b34e5d05d535f474 /host/lib/include
parentb49e4f1eb62081a035c8d2e1d7b50e65e027ad72 (diff)
downloaduhd-5df498aeb985b40d72fa5165366e903351369f91.tar.gz
uhd-5df498aeb985b40d72fa5165366e903351369f91.tar.bz2
uhd-5df498aeb985b40d72fa5165366e903351369f91.zip
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.
Diffstat (limited to 'host/lib/include')
-rw-r--r--host/lib/include/uhdlib/rfnoc/chdr_ctrl_endpoint.hpp5
1 files changed, 5 insertions, 0 deletions
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