summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorIdo Barnea <ibarnea@cisco.com>2016-05-23 15:25:52 +0300
committerIdo Barnea <ibarnea@cisco.com>2016-05-23 15:26:14 +0300
commit131be7a0a855f2c027d28060ab6a42cbeddc69da (patch)
treec9d020e9eb2167d862bf8e235b7bf368f4a092e4 /src
parent0f8e6065f467703b1461e87c3912f8d4bd616807 (diff)
Fixes to latency code + tests
Diffstat (limited to 'src')
-rw-r--r--src/flow_stat.cpp6
-rw-r--r--src/main_dpdk.cpp2
-rw-r--r--src/stateless/dp/trex_stateless_dp_core.cpp3
3 files changed, 10 insertions, 1 deletions
diff --git a/src/flow_stat.cpp b/src/flow_stat.cpp
index 1a3e54aa..2385e03f 100644
--- a/src/flow_stat.cpp
+++ b/src/flow_stat.cpp
@@ -871,6 +871,9 @@ int CFlowStatRuleMgr::stop_stream(TrexStream * stream) {
p_user_id_p->set_latency_json(json);
p_user_id_p->set_seq_err_cnt(rfc2544_info.get_seq_err_cnt());
p_user_id_p->set_ooo_cnt(rfc2544_info.get_ooo_cnt());
+ p_user_id_p->set_dup_cnt(rfc2544_info.get_dup_cnt());
+ p_user_id_p->set_seq_err_big_cnt(rfc2544_info.get_seq_err_ev_big());
+ p_user_id_p->set_seq_err_low_cnt(rfc2544_info.get_seq_err_ev_low());
m_hw_id_map_payload.unmap(hw_id);
}
m_user_id_map.unmap(stream->m_rx_check.m_pg_id);
@@ -1049,6 +1052,9 @@ bool CFlowStatRuleMgr::dump_json(std::string & s_json, std::string & l_json, boo
rfc2544_info[hw_id].get_latency_json(lat_hist);
user_id_info_p->set_seq_err_cnt(rfc2544_info[hw_id].get_seq_err_cnt());
user_id_info_p->set_ooo_cnt(rfc2544_info[hw_id].get_ooo_cnt());
+ user_id_info_p->set_dup_cnt(rfc2544_info[hw_id].get_dup_cnt());
+ user_id_info_p->set_seq_err_big_cnt(rfc2544_info[hw_id].get_seq_err_ev_big());
+ user_id_info_p->set_seq_err_low_cnt(rfc2544_info[hw_id].get_seq_err_ev_low());
l_data_section[str_user_id]["latency"]["h"] = lat_hist;
l_data_section[str_user_id]["latency"]["last_max"] = rfc2544_info[hw_id].get_last_max_usec();
l_data_section[str_user_id]["latency"]["jitter"] = rfc2544_info[hw_id].get_jitter_usec();
diff --git a/src/main_dpdk.cpp b/src/main_dpdk.cpp
index 467b0cad..4b2655a3 100644
--- a/src/main_dpdk.cpp
+++ b/src/main_dpdk.cpp
@@ -2093,7 +2093,7 @@ int CCoreEthIFStateless::send_node(CGenNode * no) {
}
if (unlikely(node_sl->is_stat_needed())) {
- return send_node_flow_stat(m, node_sl, lp_port, lp_stats, node_sl->get_cache_mbuf() ? true:false);
+ return send_node_flow_stat(m, node_sl, lp_port, lp_stats, (node_sl->get_cache_mbuf() || node_sl->is_cache_mbuf_array())? true:false);
} else {
send_pkt(lp_port,m,lp_stats);
}
diff --git a/src/stateless/dp/trex_stateless_dp_core.cpp b/src/stateless/dp/trex_stateless_dp_core.cpp
index 763bf3e2..21334363 100644
--- a/src/stateless/dp/trex_stateless_dp_core.cpp
+++ b/src/stateless/dp/trex_stateless_dp_core.cpp
@@ -235,6 +235,9 @@ rte_mbuf_t * CGenNodeStateless::alloc_flow_stat_mbuf(rte_mbuf_t *m, struct flow_
rte_pktmbuf_attach(m_ret, m);
rte_pktmbuf_trim(m_ret, sizeof(struct flow_stat_payload_header));
utl_rte_pktmbuf_add_after2(m_ret, m_lat);
+ // ref count was updated when we took the (const) mbuf, and again in rte_pktmbuf_attach
+ // so need do decrease now, to avoid leak.
+ rte_pktmbuf_refcnt_update(m, -1);
return m_ret;
} else {
// Short packet. Just copy all bytes.