diff options
author | Ido Barnea <ibarnea@cisco.com> | 2016-04-24 14:43:28 +0300 |
---|---|---|
committer | Ido Barnea <ibarnea@cisco.com> | 2016-05-18 19:20:21 +0300 |
commit | a53f6be0617721b535086298095ad49057a7be69 (patch) | |
tree | 3ccd8de6108cc3d769d25447cb39640bd2b2940d /src/stateless/dp/trex_stateless_dp_core.cpp | |
parent | d3b66fddf9840272b367f42e26ce16198eeadaf6 (diff) |
Working version. temporary send_node that duplicates the mbuf data
Diffstat (limited to 'src/stateless/dp/trex_stateless_dp_core.cpp')
-rw-r--r-- | src/stateless/dp/trex_stateless_dp_core.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
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(){ |