From a53f6be0617721b535086298095ad49057a7be69 Mon Sep 17 00:00:00 2001 From: Ido Barnea Date: Sun, 24 Apr 2016 14:43:28 +0300 Subject: Working version. temporary send_node that duplicates the mbuf data --- src/stateless/dp/trex_stateless_dp_core.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/stateless/dp/trex_stateless_dp_core.cpp') diff --git a/src/stateless/dp/trex_stateless_dp_core.cpp b/src/stateless/dp/trex_stateless_dp_core.cpp index 833fb6e1..9c05c16b 100644 --- a/src/stateless/dp/trex_stateless_dp_core.cpp +++ b/src/stateless/dp/trex_stateless_dp_core.cpp @@ -211,6 +211,18 @@ std::string CGenNodeStateless::get_stream_state_str(stream_state_t stream_state) return(res); } +rte_mbuf_t * CGenNodeStateless::alloc_flow_stat_mbuf(rte_mbuf_t *m) { + //????????? + // temp implementation. Just copy the entire mbuf + rte_mbuf_t *m_new = CGlobalInfo::pktmbuf_alloc( get_socket_id(), m->data_len ); + /* TBD remove this, should handle cases of error */ + assert(m_new); + char *p = rte_pktmbuf_mtod(m, char*); + char *p_new = rte_pktmbuf_append(m_new, m->data_len); + memcpy(p_new , p, m->data_len); + + return m_new; +} rte_mbuf_t * CGenNodeStateless::alloc_node_with_vm(){ -- cgit 1.2.3-korg