summaryrefslogtreecommitdiffstats
path: root/src/main_dpdk.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/main_dpdk.cpp')
-rwxr-xr-xsrc/main_dpdk.cpp19
1 files changed, 11 insertions, 8 deletions
diff --git a/src/main_dpdk.cpp b/src/main_dpdk.cpp
index 3e5418b9..c17f32f3 100755
--- a/src/main_dpdk.cpp
+++ b/src/main_dpdk.cpp
@@ -1875,7 +1875,7 @@ public:
bool process_rx_pkt(pkt_dir_t dir,rte_mbuf_t * m);
- virtual int update_mac_addr_from_global_cfg(pkt_dir_t dir, rte_mbuf_t *m);
+ virtual int update_mac_addr_from_global_cfg(pkt_dir_t dir, uint8_t * p);
virtual pkt_dir_t port_id_to_dir(uint8_t port_id);
@@ -2186,12 +2186,18 @@ int CCoreEthIFStateless::send_node(CGenNode * no){
/* check that we have mbuf */
rte_mbuf_t * m=node_sl->get_cache_mbuf();
- assert( 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];
- rte_pktmbuf_refcnt_update(m,1);
+ if (m) {
+ /* cache case */
+ rte_pktmbuf_refcnt_update(m,1);
+ }else{
+ m=node_sl->alloc_node_with_vm();
+ assert(m);
+ }
send_pkt(lp_port,m,lp_stats);
+
return (0);
};
@@ -2290,14 +2296,11 @@ int CCoreEthIF::send_node(CGenNode * node){
}
-int CCoreEthIF::update_mac_addr_from_global_cfg(pkt_dir_t dir,
- rte_mbuf_t *m){
- assert(m);
+int CCoreEthIF::update_mac_addr_from_global_cfg(pkt_dir_t dir, uint8_t * p){
+ assert(p);
assert(dir<2);
CCorePerPort * lp_port=&m_ports[dir];
- uint8_t *p=rte_pktmbuf_mtod(m, uint8_t*);
uint8_t p_id=lp_port->m_port->get_port_id();
-
memcpy(p,CGlobalInfo::m_options.get_dst_src_mac_addr(p_id),12);
return (0);
}