summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorIdo Barnea <ibarnea@cisco.com>2016-05-08 14:24:37 +0300
committerIdo Barnea <ibarnea@cisco.com>2016-05-18 19:20:22 +0300
commitcb13e66205717a8fcf69185ba350adab3438ffa0 (patch)
treee11ee60f94005936206daba10fb450ec54eb6f79 /src
parent89d643b96d9a86345ef1de8e80c801d1863002e8 (diff)
Latency stat python API work
Diffstat (limited to 'src')
-rw-r--r--src/flow_stat.cpp12
-rw-r--r--src/main_dpdk.cpp77
2 files changed, 4 insertions, 85 deletions
diff --git a/src/flow_stat.cpp b/src/flow_stat.cpp
index d63dc778..b2c3f487 100644
--- a/src/flow_stat.cpp
+++ b/src/flow_stat.cpp
@@ -1048,20 +1048,10 @@ bool CFlowStatRuleMgr::dump_json(std::string & s_json, std::string & l_json, boo
l_data_section[str_user_id]["jitter"] = user_id_info_p->get_jitter();
}
///????? add last 10 samples
- l_data_section[str_user_id]["err_cntrs"]["lost"]
+ l_data_section[str_user_id]["err_cntrs"]["dropped"]
= Json::Value::UInt64(user_id_info_p->get_seq_err_cnt());
l_data_section[str_user_id]["err_cntrs"]["out_of_order"]
= Json::Value::UInt64(user_id_info_p->get_ooo_cnt());
-
- //??? temp - remove
-#if 0
- s_data_section[str_user_id]["tx_bytes"]["0"]
- = Json::Value::UInt64(user_id_info_p->get_seq_err_cnt());
- s_data_section[str_user_id]["tx_bytes"]["1"] = 0;
- s_data_section[str_user_id]["rx_bytes"]["0"]
- = Json::Value::UInt64(user_id_info_p->get_ooo_cnt());
- s_data_section[str_user_id]["rx_bytes"]["1"] = 0;
-#endif
}
}
diff --git a/src/main_dpdk.cpp b/src/main_dpdk.cpp
index ccd1aa8d..b0fd3180 100644
--- a/src/main_dpdk.cpp
+++ b/src/main_dpdk.cpp
@@ -2008,8 +2008,8 @@ void CCoreEthIF::update_mac_addr(CGenNode * node,uint8_t *p){
int CCoreEthIFStateless::send_node_flow_stat(rte_mbuf *m, CGenNodeStateless * node_sl, CCorePerPort * lp_port
, CVirtualIFPerSideStats * lp_stats) {
- //??? remove
-# if 0
+ // Defining this makes 10% percent packet loss. 1% packet reorder.
+# ifdef ERR_CNTRS_TEST
static int temp=1;
temp++;
#endif
@@ -2038,20 +2038,15 @@ int CCoreEthIFStateless::send_node_flow_stat(rte_mbuf *m, CGenNodeStateless * no
lp_stats->m_seq_num[hw_id_payload]++;
- //??? remove
-#if 0
+#ifdef ERR_CNTRS_TEST
if (temp % 10 == 0) {
fsp_head->seq = lp_stats->m_seq_num[hw_id_payload]++;
}
-
if ((temp - 1) % 100 == 0) {
fsp_head->seq = lp_stats->m_seq_num[hw_id_payload] - 4;
- // lp_stats->m_seq_num[hw_id_payload]--;
}
#endif
-
-
if (rte_pktmbuf_is_contiguous(m)) {
// We have only the const mbuf
mi = CGlobalInfo::pktmbuf_alloc_small(get_socket_id());
@@ -2081,72 +2076,6 @@ int CCoreEthIFStateless::send_node_flow_stat(rte_mbuf *m, CGenNodeStateless * no
return 0;
}
-#if 0
-//??? remove
-// Maybe make it part of send_node somehow
-int CCoreEthIFStateless::send_node_flow_stat(CGenNodeStateless * node_sl) {
- //??? remove
- static int temp=1;
- temp++;
-
- uint16_t hw_id = node_sl->get_stat_hw_id();
- tx_per_flow_t *lp_s;
- /* check that we have mbuf */
- rte_mbuf_t *temp_m = node_sl->get_cache_mbuf();
- rte_mbuf_t *m;
-
- if (temp_m) {
- /* cache case */
- m = node_sl->alloc_flow_stat_mbuf(temp_m);
- }else{
- temp_m = node_sl->alloc_node_with_vm();
- assert(temp_m);
- m = node_sl->alloc_flow_stat_mbuf(temp_m);
- rte_pktmbuf_free(temp_m);
- }
-
- pkt_dir_t dir=(pkt_dir_t)node_sl->get_mbuf_cache_dir();
- CCorePerPort * lp_port=&m_ports[dir];
- CVirtualIFPerSideStats * lp_stats = &m_stats[dir];
-
- if (hw_id >= MAX_FLOW_STATS) {
- // payload rule hw_ids are in the range right above ip id rules
- uint16_t hw_id_payload = hw_id - MAX_FLOW_STATS;
- if (hw_id_payload > max_stat_hw_id_seen_payload) {
- max_stat_hw_id_seen_payload = hw_id_payload;
- }
- uint8_t *p = rte_pktmbuf_mtod(m, uint8_t*);
- struct flow_stat_payload_header *fsp_head = (struct flow_stat_payload_header *)
- (p + m->pkt_len - sizeof(struct flow_stat_payload_header));
- fsp_head->seq = lp_stats->m_seq_num[hw_id_payload];
- fsp_head->time_stamp = os_get_hr_tick_64();
- lp_stats->m_seq_num[hw_id_payload]++;
- // remove ???
-
- if (temp % 10 == 0) {
- fsp_head->seq = lp_stats->m_seq_num[hw_id_payload]++;
- }
-#if 1
- if ((temp - 1) % 100 == 0) {
- fsp_head->seq = lp_stats->m_seq_num[hw_id_payload] - 4;
- // lp_stats->m_seq_num[hw_id_payload]--;
- }
-#endif
- } else {
- // ip id rule
- if (hw_id > max_stat_hw_id_seen) {
- max_stat_hw_id_seen = hw_id;
- }
- }
- lp_s = &lp_stats->m_tx_per_flow[hw_id];
- lp_s->add_pkts(1);
- lp_s->add_bytes(m->pkt_len);
-
- send_pkt(lp_port,m,lp_stats);
- return 0;
-}
-#endif
-
int CCoreEthIFStateless::send_node(CGenNode * no) {
/* if a node is marked as slow path - single IF to redirect it to slow path */
if (no->get_is_slow_path()) {