Small flow stat fix
authorIdo Barnea <[email protected]>
Thu, 3 Mar 2016 14:12:36 +0000 (16:12 +0200)
committerIdo Barnea <[email protected]>
Thu, 3 Mar 2016 14:12:36 +0000 (16:12 +0200)
src/flow_stat.cpp
src/main_dpdk.cpp

index cb5c7e0..7f9df8c 100644 (file)
@@ -649,7 +649,7 @@ bool CFlowStatRuleMgr::dump_json(std::string & json) {
         for (uint8_t port = 0; port < m_num_ports; port++) {
             std::string str_port = static_cast<std::ostringstream*>( &(std::ostringstream() << port) )->str();
             if (user_id_info->get_rx_counter(port) != 0) {
-                data_section[str_user_id]["rx"][str_port] = Json::Value::UInt64(user_id_info->get_rx_counter(port));
+                data_section[str_user_id]["rx-pkts"][str_port] = Json::Value::UInt64(user_id_info->get_rx_counter(port));
                 ret = true;
             }
             if (user_id_info->get_tx_counter(port).get_pkts() != 0) {
index 77e186b..57b3719 100644 (file)
@@ -3897,7 +3897,7 @@ static CGlobalTRex g_trex;
 int CPhyEthIF::reset_hw_flow_stats() {
     uint32_t diff_stats[MAX_FLOW_STATS];
 
-    if (get_ex_drv()->get_rx_stats(this, diff_stats, m_stats.m_fdir_prev_stats, 0, MAX_FLOW_STATS) < 0) {
+    if (get_ex_drv()->get_rx_stats(this, diff_stats, m_stats.m_fdir_prev_stats, 0, MAX_FLOW_STATS - 1) < 0) {
         return -1;
     }