summaryrefslogtreecommitdiffstats
path: root/src/stateless/dp
diff options
context:
space:
mode:
authorIdo Barnea <ibarnea@cisco.com>2016-04-24 14:43:28 +0300
committerIdo Barnea <ibarnea@cisco.com>2016-05-18 19:20:21 +0300
commita53f6be0617721b535086298095ad49057a7be69 (patch)
tree3ccd8de6108cc3d769d25447cb39640bd2b2940d /src/stateless/dp
parentd3b66fddf9840272b367f42e26ce16198eeadaf6 (diff)
Working version. temporary send_node that duplicates the mbuf data
Diffstat (limited to 'src/stateless/dp')
-rw-r--r--src/stateless/dp/trex_stateless_dp_core.cpp12
-rw-r--r--src/stateless/dp/trex_stream_node.h2
2 files changed, 13 insertions, 1 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(){
diff --git a/src/stateless/dp/trex_stream_node.h b/src/stateless/dp/trex_stream_node.h
index b5395e78..4edf3a06 100644
--- a/src/stateless/dp/trex_stream_node.h
+++ b/src/stateless/dp/trex_stream_node.h
@@ -390,7 +390,7 @@ public:
return (m_src_port);
}
-
+ rte_mbuf_t * alloc_flow_stat_mbuf(rte_mbuf_t *); //temp ???
rte_mbuf_t * alloc_node_with_vm();
void free_stl_node();