X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=extras%2Fvom%2Fvom%2Finterface.cpp;h=15bc3733ec4a1e0e5037db66a1efcad0483b2f3e;hb=e63325e3ca03c847963863446345e6c80a2c0cfd;hp=97f7776ebc6098d10b28824afdec7ab66ffd4559;hpb=a8ac77f4706b7e40887426c446ebded4555885e4;p=vpp.git diff --git a/extras/vom/vom/interface.cpp b/extras/vom/vom/interface.cpp index 97f7776ebc6..15bc3733ec4 100644 --- a/extras/vom/vom/interface.cpp +++ b/extras/vom/vom/interface.cpp @@ -394,9 +394,7 @@ interface::set(const admin_state_t& state) void interface::set(const l2_address_t& addr) { - assert(rc_t::UNSET == m_l2_address.rc()); - m_l2_address.set(rc_t::NOOP); - m_l2_address.update(addr); + m_l2_address = { addr, rc_t::NOOP }; } void @@ -424,6 +422,8 @@ interface::set(const counter_t& count, const std::string& stat_type) m_stats.m_rx = count; else if ("tx" == stat_type) m_stats.m_tx = count; + else if ("drops" == stat_type) + m_stats.m_drop = count; else if ("rx-unicast" == stat_type) m_stats.m_rx_unicast = count; else if ("tx-unicast" == stat_type) @@ -454,22 +454,12 @@ std::ostream& operator<<(std::ostream& os, const interface::stats_t& stats) { os << "[" - << "rx [packets " << stats.m_rx.packets << ", bytes " << stats.m_rx.bytes - << "]" - << " rx-unicast [packets " << stats.m_rx_unicast.packets << ", bytes " - << stats.m_rx_unicast.bytes << "]" - << " rx-multicast [packets " << stats.m_rx_multicast.packets << ", bytes " - << stats.m_rx_multicast.bytes << "]" - << " rx-broadcast [packets " << stats.m_rx_broadcast.packets << ", bytes " - << stats.m_rx_broadcast.bytes << "]" - << " tx [packets " << stats.m_tx.packets << ", bytes " << stats.m_tx.bytes - << "]" - << " tx-unicast [packets " << stats.m_tx_unicast.packets << ", bytes " - << stats.m_tx_unicast.bytes << "]" - << " tx-multicast [packets " << stats.m_tx_multicast.packets << ", bytes " - << stats.m_tx_multicast.bytes << "]" - << " tx-broadcast [packets " << stats.m_tx_broadcast.packets << ", bytes " - << stats.m_tx_broadcast.bytes << "]]" << std::endl; + << "rx " << stats.m_rx << " rx-unicast " << stats.m_rx_unicast + << " rx-multicast " << stats.m_rx_multicast << " rx-broadcast " + << stats.m_rx_broadcast << " tx " << stats.m_tx << " tx-unicast " + << stats.m_tx_unicast << " tx-multicast " << stats.m_tx_multicast + << " tx-broadcast " << stats.m_tx_broadcast << " drops " << stats.m_drop + << "]" << std::endl; return (os); } @@ -644,8 +634,8 @@ interface::event_handler::handle_populate(const client_db::key_t& key) for (auto& itf_record : *cmd) { auto payload = itf_record.get_payload(); VOM_LOG(log_level_t::DEBUG) << "dump: [" << payload.sw_if_index - << " name:" << (char*)payload.interface_name - << " tag:" << (char*)payload.tag << "]"; + << " name:" << (char*)payload.interface_name.buf + << " tag:" << (char*)payload.tag.buf << "]"; std::shared_ptr itf = interface_factory::new_interface(payload);