diff options
Diffstat (limited to 'src/main_dpdk.cpp')
-rw-r--r-- | src/main_dpdk.cpp | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/src/main_dpdk.cpp b/src/main_dpdk.cpp index 05d89f9d..092bd133 100644 --- a/src/main_dpdk.cpp +++ b/src/main_dpdk.cpp @@ -1946,13 +1946,6 @@ int CCoreEthIF::send_pkt(CCorePerPort * lp_port, CVirtualIFPerSideStats * lp_stats ){ - //printf(" %lu \n",(ulong)rte_pktmbuf_pkt_len(m)); - //rte_pktmbuf_dump(stdout,m, rte_pktmbuf_pkt_len(m)); - - /* too expensive remove this for now */ - //lp_stats->m_tx_pkt +=1; - //lp_stats->m_tx_bytes += (rte_pktmbuf_pkt_len(m)+4); - uint16_t len = lp_port->m_len; lp_port->m_table[len]=m; len++; @@ -2011,16 +2004,23 @@ int CCoreEthIFStateless::send_node(CGenNode * no) { CGenNodeStateless * node_sl=(CGenNodeStateless *) no; /* check that we have mbuf */ - rte_mbuf_t * m=node_sl->get_cache_mbuf(); + rte_mbuf_t * 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 (m) { - /* cache case */ - rte_pktmbuf_refcnt_update(m,1); + if ( likely(node_sl->is_cache_mbuf_array()) ) { + m=node_sl->cache_mbuf_array_get_cur(); }else{ - m=node_sl->alloc_node_with_vm(); - assert(m); + m=node_sl->get_cache_mbuf(); + + if (m) { + /* cache case */ + rte_pktmbuf_refcnt_update(m,1); + }else{ + m=node_sl->alloc_node_with_vm(); + assert(m); + } } if (unlikely(node_sl->is_stat_needed())) { |