diff options
Diffstat (limited to 'src/bp_sim.cpp')
-rwxr-xr-x | src/bp_sim.cpp | 28 |
1 files changed, 13 insertions, 15 deletions
diff --git a/src/bp_sim.cpp b/src/bp_sim.cpp index f4eb6f7e..f9e96b6b 100755 --- a/src/bp_sim.cpp +++ b/src/bp_sim.cpp @@ -4991,29 +4991,27 @@ int CErfIFStl::send_sl_node(CGenNodeStateless *node_sl) { bool is_const = false; if (m) { is_const = true; + rte_pktmbuf_refcnt_update(m,1); }else{ m=node_sl->alloc_node_with_vm(); assert(m); } - if (node_sl->is_stat_needed()) { + if (node_sl->is_stat_needed() && (node_sl->get_stat_hw_id() >= MAX_FLOW_STATS) ) { + /* latency packet. flow stat without latency handled like normal packet in simulation */ uint16_t hw_id = node_sl->get_stat_hw_id(); - if (hw_id >= MAX_FLOW_STATS) { - rte_mbuf_t *mi; - struct flow_stat_payload_header *fsp_head; - mi = node_sl->alloc_flow_stat_mbuf(m, fsp_head, is_const); - fsp_head->seq = 0x12345678; - fsp_head->hw_id = hw_id - MAX_FLOW_STATS; - fsp_head->magic = FLOW_STAT_PAYLOAD_MAGIC; - fsp_head->time_stamp = 0x8899aabbccddeeff; - fill_raw_packet(m,(CGenNode *)node_sl,dir); - rte_pktmbuf_free(mi); - } + rte_mbuf_t *mi; + struct flow_stat_payload_header *fsp_head; + mi = node_sl->alloc_flow_stat_mbuf(m, fsp_head, is_const); + fsp_head->seq = 0x12345678; + fsp_head->hw_id = hw_id - MAX_FLOW_STATS; + fsp_head->magic = FLOW_STAT_PAYLOAD_MAGIC; + fsp_head->time_stamp = 0x8899aabbccddeeff; + fill_raw_packet(mi, (CGenNode *)node_sl, dir); + rte_pktmbuf_free(mi); } else { fill_raw_packet(m,(CGenNode *)node_sl,dir); - if (! is_const) { - rte_pktmbuf_free(m); - } + rte_pktmbuf_free(m); } } /* check that we have mbuf */ |