summaryrefslogtreecommitdiffstats
path: root/src/gtest
diff options
context:
space:
mode:
authorHanoh Haim <hhaim@cisco.com>2016-05-08 20:32:52 +0300
committerHanoh Haim <hhaim@cisco.com>2016-05-08 20:32:52 +0300
commit8b4df27252f317b33e11a626997748971625a47c (patch)
tree9f46d76051e69cf20959199fca83126ef82944cf /src/gtest
parentc2912dfc5ad81e2edcf77b7ee992f92216ed0bad (diff)
add cache to CP
Diffstat (limited to 'src/gtest')
-rw-r--r--src/gtest/trex_stateless_gtest.cpp25
1 files changed, 22 insertions, 3 deletions
diff --git a/src/gtest/trex_stateless_gtest.cpp b/src/gtest/trex_stateless_gtest.cpp
index a33d2d74..11070f5c 100644
--- a/src/gtest/trex_stateless_gtest.cpp
+++ b/src/gtest/trex_stateless_gtest.cpp
@@ -156,7 +156,6 @@ TEST_F(basic_vm, cache_basic) {
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();
@@ -2775,13 +2774,13 @@ TEST_F(basic_stl, multi_pkt1) {
class CEnableVm {
public:
- void run(bool full_packet,double duration );
+ void run(bool full_packet,double duration,uint16_t cache );
public:
std::string m_input_packet; //"cap2/udp_64B.pcap"
std::string m_out_file; //"exp/stl_vm_enable0";
};
-void CEnableVm::run(bool full_packet,double duration=10.0){
+void CEnableVm::run(bool full_packet,double duration=10.0,uint16_t cache=0){
CBasicStl t1;
CParserOption * po =&CGlobalInfo::m_options;
@@ -2797,6 +2796,10 @@ void CEnableVm::run(bool full_packet,double duration=10.0){
TrexStream * stream1 = new TrexStream(TrexStream::stCONTINUOUS,0,0);
+ if ( cache ){
+ stream1->m_cache_size=cache;
+ }
+
stream1->set_rate(TrexStreamRate::RATE_PPS, 1.0);
stream1->m_enabled = true;
@@ -2839,6 +2842,22 @@ void CEnableVm::run(bool full_packet,double duration=10.0){
EXPECT_EQ_UINT32(1, res?1:0)<< "pass";
}
+TEST_F(basic_stl, vm_enable_cache_10) {
+
+ CEnableVm vm_test;
+ vm_test.m_out_file = "exp/stl_vm_enable0_cache_10";
+ vm_test.m_input_packet = "cap2/udp_64B.pcap";
+ vm_test.run(true,10.0,100);
+}
+
+TEST_F(basic_stl, vm_enable_cache_500) {
+ /* multi mbuf cache */
+ CEnableVm vm_test;
+ vm_test.m_out_file = "exp/stl_vm_enable1_cache_500";
+ vm_test.m_input_packet = "stl/yaml/udp_594B_no_crc.pcap";
+ vm_test.run(false,20.0,19);
+}
+
TEST_F(basic_stl, vm_enable0) {