summaryrefslogtreecommitdiffstats
path: root/extras/vom/vom/hw.hpp
diff options
context:
space:
mode:
authorMohsin Kazmi <sykazmi@cisco.com>2018-11-21 19:00:46 +0100
committerNeale Ranns <nranns@cisco.com>2018-12-13 07:46:02 +0000
commit51edc3ab01e0af58d457da97bf6ca9cc3ebc6b8d (patch)
tree61030afdb69ed1952021dad99fa209a280d68a49 /extras/vom/vom/hw.hpp
parenteb6c7999477cfbca77223be3ef7f11528da9f093 (diff)
vom: Add support for new stats
This patch deprecates old stats and adds support for new stats. This implements the PULL design where client will enable stats on objects (i.e. interfaces, etc), register a call back function which will run once stats will be ready for enabled object and call HW::read_stats() periodically to read stats for enabled objects from VPP. Change-Id: I32525a417427be87408d01f8bc93a731602ff690 Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
Diffstat (limited to 'extras/vom/vom/hw.hpp')
-rw-r--r--extras/vom/vom/hw.hpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/extras/vom/vom/hw.hpp b/extras/vom/vom/hw.hpp
index 9ba47505619..d10a93aa59b 100644
--- a/extras/vom/vom/hw.hpp
+++ b/extras/vom/vom/hw.hpp
@@ -29,6 +29,7 @@
namespace VOM {
+class stat_reader;
class cmd;
class HW
{
@@ -287,6 +288,12 @@ public:
static void init(cmd_q* f);
/**
+ * Initialise the HW connection to VPP - the UT version passing
+ * a mock Q.
+ */
+ static void init(cmd_q* f, stat_reader* s);
+
+ /**
* Initialise the HW
*/
static void init();
@@ -326,6 +333,11 @@ public:
*/
static bool poll();
+ /**
+ * read stats from stat segment
+ */
+ static void read_stats();
+
private:
/**
* The command Q toward HW
@@ -333,6 +345,11 @@ private:
static cmd_q* m_cmdQ;
/**
+ * The stat reader toward HW
+ */
+ static stat_reader* m_statReader;
+
+ /**
* HW::item representing the connection state as determined by polling
*/
static HW::item<bool> m_poll_state;