summaryrefslogtreecommitdiffstats
path: root/src/gtest
diff options
context:
space:
mode:
authorHanoh Haim <hhaim@cisco.com>2016-05-08 13:50:57 +0300
committerHanoh Haim <hhaim@cisco.com>2016-05-08 13:50:57 +0300
commitc2912dfc5ad81e2edcf77b7ee992f92216ed0bad (patch)
tree4676234974ed4de8c804047b2e4463b893518932 /src/gtest
parentf27bfbab72f9221b221a7f36f4063e9ff8e9d307 (diff)
add cache capability to stateless node object
Diffstat (limited to 'src/gtest')
-rw-r--r--src/gtest/trex_stateless_gtest.cpp27
1 files changed, 27 insertions, 0 deletions
diff --git a/src/gtest/trex_stateless_gtest.cpp b/src/gtest/trex_stateless_gtest.cpp
index a5cf3307..a33d2d74 100644
--- a/src/gtest/trex_stateless_gtest.cpp
+++ b/src/gtest/trex_stateless_gtest.cpp
@@ -140,6 +140,29 @@ class basic_vm : public testing::Test {
};
+TEST_F(basic_vm, cache_basic) {
+
+ CGenNodeStateless *node = new CGenNodeStateless();
+
+ node->cache_mbuf_array_init();
+ int i;
+ node->cache_mbuf_array_alloc(10);
+ for (i=0; i<10; i++) {
+ rte_mbuf_t * m =CGlobalInfo::pktmbuf_alloc_small(0);
+ m->data_off=i;
+ node->cache_mbuf_array_set(i,(rte_mbuf_t *) m);
+ }
+
+ for (i=0; i<10; i++) {
+ rte_mbuf_t * m =node->cache_mbuf_array_get_cur();
+ printf(" %d \n",m->data_off);
+ //rte_pktmbuf_refcnt_update(m,1); /* both */
+ }
+
+ node->cache_mbuf_array_free();
+
+ delete node;
+}
TEST_F(basic_vm, pkt_size) {
@@ -3585,3 +3608,7 @@ TEST_F(rx_stat_pkt_parse, x710_parser) {
parser.test();
}
+
+
+
+