summaryrefslogtreecommitdiffstats
path: root/src/vpp-api/vom
diff options
context:
space:
mode:
authorMohsin Kazmi <sykazmi@cisco.com>2018-04-05 14:43:43 +0200
committerDamjan Marion <dmarion.lists@gmail.com>2018-04-12 11:08:07 +0000
commit58c711a196d9b178bfe6190964a7df92145cf949 (patch)
tree8b74a2905be3ee2e452cf4eb3e591616f808c673 /src/vpp-api/vom
parent7fe930b73f28bb62c26a4bfbe3871d684c045706 (diff)
vom: Fix the itf stats replay
Change-Id: Iedc6bbaa1c0a1c3c6e1b8ed6d67db28046a551f4 Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
Diffstat (limited to 'src/vpp-api/vom')
-rw-r--r--src/vpp-api/vom/interface.cpp16
-rw-r--r--src/vpp-api/vom/interface_cmds.cpp12
-rw-r--r--src/vpp-api/vom/interface_cmds.hpp12
3 files changed, 39 insertions, 1 deletions
diff --git a/src/vpp-api/vom/interface.cpp b/src/vpp-api/vom/interface.cpp
index 435002a1067..262d9eaf7b6 100644
--- a/src/vpp-api/vom/interface.cpp
+++ b/src/vpp-api/vom/interface.cpp
@@ -169,6 +169,10 @@ interface::sweep()
}
if (m_stats) {
+ if (stats_type_t::DETAILED == m_stats_type) {
+ HW::enqueue(new interface_cmds::collect_detail_stats_change_cmd(
+ m_stats_type, handle_i(), false));
+ }
HW::enqueue(new interface_cmds::stats_disable_cmd(m_hdl.data()));
m_stats.reset();
}
@@ -198,6 +202,18 @@ interface::replay()
HW::enqueue(new interface_cmds::state_change_cmd(m_state, m_hdl));
}
+ if (m_stats) {
+ if (stats_type_t::DETAILED == m_stats_type) {
+ m_stats_type.set(rc_t::NOOP);
+ HW::enqueue(new interface_cmds::collect_detail_stats_change_cmd(
+ m_stats_type, handle_i(), true));
+ }
+ stat_listener& listener = m_stats->listener();
+ listener.status().set(rc_t::NOOP);
+ m_stats.reset(new interface_cmds::stats_enable_cmd(listener, handle_i()));
+ HW::enqueue(m_stats);
+ }
+
if (m_table_id && (m_table_id.data() != route::DEFAULT_TABLE)) {
HW::enqueue(
new interface_cmds::set_table_cmd(m_table_id, l3_proto_t::IPV4, m_hdl));
diff --git a/src/vpp-api/vom/interface_cmds.cpp b/src/vpp-api/vom/interface_cmds.cpp
index b1decd2bf7c..49a24c1301b 100644
--- a/src/vpp-api/vom/interface_cmds.cpp
+++ b/src/vpp-api/vom/interface_cmds.cpp
@@ -582,6 +582,18 @@ stats_enable_cmd::retire(connection& con)
wait();
}
+interface::stat_listener&
+stats_enable_cmd::listener() const
+{
+ return m_listener;
+}
+
+void
+stats_enable_cmd::set(const rc_t& rc)
+{
+ m_listener.status().set(rc);
+}
+
void
stats_enable_cmd::notify()
{
diff --git a/src/vpp-api/vom/interface_cmds.hpp b/src/vpp-api/vom/interface_cmds.hpp
index 41ec5caf0e3..7a0040deb0a 100644
--- a/src/vpp-api/vom/interface_cmds.hpp
+++ b/src/vpp-api/vom/interface_cmds.hpp
@@ -484,6 +484,16 @@ public:
std::string to_string() const;
/**
+ * (re)set status
+ */
+ void set(const rc_t& rc);
+
+ /**
+ * get listener
+ */
+ interface::stat_listener& listener() const;
+
+ /**
* Comparison operator - only used for UT
*/
bool operator==(const stats_enable_cmd& i) const;
@@ -502,7 +512,7 @@ private:
/**
* The interface on which we are enabling states
*/
- handle_t m_swifindex;
+ const handle_t& m_swifindex;
};
/**