// last stream associated with the entry stopped transmittig.
// remove user_id <--> hw_id mapping
uint8_t proto = m_user_id_map.l4_proto(stream->m_rx_check.m_user_id);
- uint16_t hw_id = m_user_id_map.unmap(stream->m_rx_check.m_user_id);
+ uint16_t hw_id = m_user_id_map.get_hw_id(stream->m_rx_check.m_user_id);
if (hw_id >= MAX_FLOW_STATS) {
fprintf(stderr, "Error: %s got wrong hw_id %d from unmap\n", __func__, hw_id);
return -1;
p_user_id->set_rx_counter(port, rx_counter);
p_user_id->set_tx_counter(port, tx_counter);
}
+ m_user_id_map.unmap(stream->m_rx_check.m_user_id);
m_hw_id_map.unmap(hw_id);
}
}
Json::Value root;
bool ret = false;
- if (! m_api ) {
+ if (m_user_id_map.is_empty()) {
return false;
}
root["name"] = "rx-stats";
public:
CFlowStatUserIdMap();
friend std::ostream& operator<<(std::ostream& os, const CFlowStatUserIdMap& cf);
+ bool is_empty() {return (m_map.empty() == true);};
uint16_t get_hw_id(uint32_t user_id);
class CFlowStatUserIdInfo * find_user_id(uint32_t user_id);
class CFlowStatUserIdInfo * add_user_id(uint32_t user_id, uint8_t proto);