diff options
author | Hanoh Haim <hhaim@cisco.com> | 2016-05-08 13:50:57 +0300 |
---|---|---|
committer | Hanoh Haim <hhaim@cisco.com> | 2016-05-08 13:50:57 +0300 |
commit | c2912dfc5ad81e2edcf77b7ee992f92216ed0bad (patch) | |
tree | 4676234974ed4de8c804047b2e4463b893518932 /src/gtest | |
parent | f27bfbab72f9221b221a7f36f4063e9ff8e9d307 (diff) |
add cache capability to stateless node object
Diffstat (limited to 'src/gtest')
-rw-r--r-- | src/gtest/trex_stateless_gtest.cpp | 27 |
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(); } + + + + |