diff options
author | Neale Ranns <nranns@cisco.com> | 2018-03-29 01:28:09 -0700 |
---|---|---|
committer | Dave Barach <openvpp@barachs.net> | 2018-04-04 13:40:39 +0000 |
commit | 871dc4287d8c05ff76106dba4f5f8654c24347fe (patch) | |
tree | 97f6026e284f8cb570855f47512b22a0b58112d1 /src/vpp-api/vom/interface.cpp | |
parent | 6df19030f2bf986f1876c2c46b44c046b9b2c686 (diff) |
Detailed stats collection feature
Use device-input and interface-output feautre arcs to collect unicast, multicast
and broadcast states for RX and TX resp. Since these feature arcs are present only
for 'physical' interfaces (i.e. not su-interfaces) counter collection is supported
only on parent interface types.
Change-Id: I915c235e336b0fc3a3c3de918f95dd674e4e0e4e
Signed-off-by: Neale Ranns <nranns@cisco.com>
Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
Diffstat (limited to 'src/vpp-api/vom/interface.cpp')
-rw-r--r-- | src/vpp-api/vom/interface.cpp | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/src/vpp-api/vom/interface.cpp b/src/vpp-api/vom/interface.cpp index f323727b052..435002a1067 100644 --- a/src/vpp-api/vom/interface.cpp +++ b/src/vpp-api/vom/interface.cpp @@ -49,6 +49,7 @@ interface::interface(const std::string& name, , m_state(itf_state) , m_table_id(route::DEFAULT_TABLE) , m_l2_address(l2_address_t::ZERO, rc_t::UNSET) + , m_stats_type(stats_type_t::NORMAL) , m_oper(oper_state_t::DOWN) , m_tag(tag) { @@ -66,6 +67,7 @@ interface::interface(const std::string& name, , m_state(itf_state) , m_table_id(m_rd->table_id()) , m_l2_address(l2_address_t::ZERO, rc_t::UNSET) + , m_stats_type(stats_type_t::NORMAL) , m_oper(oper_state_t::DOWN) , m_tag(tag) { @@ -79,6 +81,7 @@ interface::interface(const interface& o) , m_state(o.m_state) , m_table_id(o.m_table_id) , m_l2_address(o.m_l2_address) + , m_stats_type(o.m_stats_type) , m_oper(o.m_oper) , m_tag(o.m_tag) { @@ -403,9 +406,14 @@ interface::set(const std::string& tag) } void -interface::enable_stats_i(interface::stat_listener& el) +interface::enable_stats_i(interface::stat_listener& el, const stats_type_t& st) { if (!m_stats) { + if (stats_type_t::DETAILED == st) { + m_stats_type = st; + HW::enqueue(new interface_cmds::collect_detail_stats_change_cmd( + m_stats_type, handle_i(), true)); + } m_stats.reset(new interface_cmds::stats_enable_cmd(el, handle_i())); HW::enqueue(m_stats); HW::write(); @@ -413,9 +421,9 @@ interface::enable_stats_i(interface::stat_listener& el) } void -interface::enable_stats(interface::stat_listener& el) +interface::enable_stats(interface::stat_listener& el, const stats_type_t& st) { - singular()->enable_stats_i(el); + singular()->enable_stats_i(el, st); } std::shared_ptr<interface> |