- fix valgrind gtest simulation errors
authorHanoh Haim <[email protected]>
Wed, 2 Sep 2015 17:30:33 +0000 (20:30 +0300)
committerHanoh Haim <[email protected]>
Wed, 2 Sep 2015 17:30:33 +0000 (20:30 +0300)
- remove 32bit sim images for faster dev

linux/ws_main.py
linux_dpdk/ws_main.py
src/bp_gtest.cpp
src/bp_sim.cpp
src/bp_sim.h
src/rx_check.cpp
src/rx_check_header.h
src/timer_wheel_pq.cpp

index dc22be0..5bf9a74 100755 (executable)
@@ -362,9 +362,9 @@ class build_option:
 
 
 build_types = [
-               build_option(name = "bp-sim", src = bp, debug_mode= DEBUG_, platform = PLATFORM_32, is_pie = False),
+               #build_option(name = "bp-sim", src = bp, debug_mode= DEBUG_, platform = PLATFORM_32, is_pie = False),
                build_option(name = "bp-sim", src = bp, debug_mode= DEBUG_, platform = PLATFORM_64, is_pie = False),
-               build_option(name = "bp-sim", src = bp, debug_mode= RELEASE_,platform = PLATFORM_32, is_pie = False),
+               #build_option(name = "bp-sim", src = bp, debug_mode= RELEASE_,platform = PLATFORM_32, is_pie = False),
                build_option(name = "bp-sim", src = bp, debug_mode= RELEASE_,platform = PLATFORM_64, is_pie = False),
 
                build_option(name = "mock-rpc-server", use = ['zmq'], src = rpc_server_mock, debug_mode= DEBUG_,platform = PLATFORM_64, is_pie = False, flags = ['-DTREX_RPC_MOCK_SERVER'],
index e1aa8ea..fc9fc58 100755 (executable)
@@ -740,10 +740,9 @@ files_list=[
             'libzmq.so.3.1.0',
             'libzmq.so.3',
             'trex-cfg',
-            'bp-sim-32',
             'bp-sim-64',
-            'bp-sim-32-debug',
             'bp-sim-64-debug',
+            'mock-rpc-server-64-debug',
             'release_notes.pdf',
             'dpdk_nic_bind.py',
             'dpdk_setup_ports.py',
index 020276c..78efbec 100755 (executable)
@@ -1426,6 +1426,8 @@ TEST_F(rx_check, rx_check_normal) {
 
     for (i=0; i<10; i++) {
         CRx_check_header rxh;
+        rxh.clean();
+
         rxh.m_option_type=RX_CHECK_V4_OPT_TYPE;
         rxh.m_option_len=RX_CHECK_V4_OPT_LEN;
         rxh.m_time_stamp=0;
@@ -1454,6 +1456,8 @@ TEST_F(rx_check, rx_check_drop) {
 
     for (i=0; i<10; i++) {
         CRx_check_header rxh;
+        rxh.clean();
+
         rxh.m_option_type=RX_CHECK_V4_OPT_TYPE;
         rxh.m_option_len=RX_CHECK_V4_OPT_LEN;
         rxh.m_time_stamp=0;
@@ -1490,8 +1494,10 @@ TEST_F(rx_check, rx_check_ooo) {
 
        for (i=0; i<10; i++) {
                CRx_check_header rxh;
-                rxh.m_option_type=RX_CHECK_V4_OPT_TYPE;
-                rxh.m_option_len=RX_CHECK_V4_OPT_LEN;
+        rxh.clean();
+
+        rxh.m_option_type=RX_CHECK_V4_OPT_TYPE;
+        rxh.m_option_len=RX_CHECK_V4_OPT_LEN;
                rxh.m_time_stamp=0;
                rxh.m_magic=RX_CHECK_MAGIC;
         rxh.m_aging_sec=10;
@@ -1531,8 +1537,9 @@ TEST_F(rx_check, rx_check_ooo_1) {
 
        for (i=0; i<10; i++) {
                CRx_check_header rxh;
-                rxh.m_option_type=RX_CHECK_V4_OPT_TYPE;
-                rxh.m_option_len=RX_CHECK_V4_OPT_LEN;
+        rxh.clean();
+        rxh.m_option_type=RX_CHECK_V4_OPT_TYPE;
+        rxh.m_option_len=RX_CHECK_V4_OPT_LEN;
                rxh.m_time_stamp=0;
         rxh.set_dir(0);
         rxh.set_both_dir(0);
@@ -1568,8 +1575,9 @@ TEST_F(rx_check, rx_check_ooo_2) {
 
        for (i=0; i<10; i++) {
                CRx_check_header rxh;
-                rxh.m_option_type=RX_CHECK_V4_OPT_TYPE;
-                rxh.m_option_len=RX_CHECK_V4_OPT_LEN;
+        rxh.clean();
+        rxh.m_option_type=RX_CHECK_V4_OPT_TYPE;
+        rxh.m_option_len=RX_CHECK_V4_OPT_LEN;
                rxh.m_time_stamp=0;
                rxh.m_magic=RX_CHECK_MAGIC;
         rxh.m_aging_sec=10;
@@ -1606,6 +1614,7 @@ TEST_F(rx_check, rx_check_normal_two_dir) {
 
     for (i=0; i<10; i++) {
         CRx_check_header rxh;
+        rxh.clean();
         rxh.m_option_type=RX_CHECK_V4_OPT_TYPE;
         rxh.m_option_len=RX_CHECK_V4_OPT_LEN;
         rxh.m_time_stamp=0;
@@ -1635,6 +1644,7 @@ TEST_F(rx_check, rx_check_normal_two_dir_fails) {
 
     for (i=0; i<10; i++) {
         CRx_check_header rxh;
+        rxh.clean();
         rxh.m_option_type=RX_CHECK_V4_OPT_TYPE;
         rxh.m_option_len=RX_CHECK_V4_OPT_LEN;
         rxh.m_time_stamp=0;
@@ -1661,6 +1671,8 @@ TEST_F(rx_check, rx_check_normal_two_dir_ok) {
     int i;
 
     CRx_check_header rxh;
+    rxh.clean();
+
     rxh.m_option_type=RX_CHECK_V4_OPT_TYPE;
     rxh.m_option_len=RX_CHECK_V4_OPT_LEN;
     rxh.m_time_stamp=0;
@@ -1695,6 +1707,8 @@ TEST_F(rx_check, rx_check_normal_one_pkt_one_dir) {
     int i;
 
     CRx_check_header rxh;
+    rxh.clean();
+
     rxh.m_option_type=RX_CHECK_V4_OPT_TYPE;
     rxh.m_option_len=RX_CHECK_V4_OPT_LEN;
     rxh.m_time_stamp=0;
@@ -1721,6 +1735,8 @@ TEST_F(rx_check, rx_check_normal_one_pkt_one_dir_0) {
     int i;
 
     CRx_check_header rxh;
+    rxh.clean();
+
     rxh.m_option_type=RX_CHECK_V4_OPT_TYPE;
     rxh.m_option_len=RX_CHECK_V4_OPT_LEN;
     rxh.m_time_stamp=0;
@@ -1746,6 +1762,8 @@ TEST_F(rx_check, rx_check_normal_one_pkt_two_dir_0) {
     int i;
 
     CRx_check_header rxh;
+    rxh.clean();
+
     rxh.m_option_type=RX_CHECK_V4_OPT_TYPE;
     rxh.m_option_len=RX_CHECK_V4_OPT_LEN;
     rxh.m_time_stamp=0;
@@ -1778,6 +1796,8 @@ TEST_F(rx_check, rx_check_normal_one_pkt_two_dir_err1) {
     int i;
 
     CRx_check_header rxh;
+    rxh.clean();
+
     rxh.m_option_type=RX_CHECK_V4_OPT_TYPE;
     rxh.m_option_len=RX_CHECK_V4_OPT_LEN;
     rxh.m_time_stamp=0;
@@ -1821,6 +1841,8 @@ TEST_F(rx_check, rx_check_normal_two_dir_oo) {
     int i;
 
     CRx_check_header rxh;
+    rxh.clean();
+
     rxh.m_option_type=RX_CHECK_V4_OPT_TYPE;
     rxh.m_option_len=RX_CHECK_V4_OPT_LEN;
     rxh.m_time_stamp=0;
@@ -1865,6 +1887,8 @@ TEST_F(rx_check, rx_check_normal_aging) {
     int i;
 
     CRx_check_header rxh;
+    rxh.clean();
+
     rxh.m_option_type=RX_CHECK_V4_OPT_TYPE;
     rxh.m_option_len=RX_CHECK_V4_OPT_LEN;
     rxh.m_magic=RX_CHECK_MAGIC;
@@ -1899,6 +1923,7 @@ TEST_F(rx_check, rx_check_normal_no_aging) {
     int i;
 
     CRx_check_header rxh;
+    rxh.clean();
     rxh.m_option_type=RX_CHECK_V4_OPT_TYPE;
     rxh.m_option_len=RX_CHECK_V4_OPT_LEN;
     rxh.m_magic=RX_CHECK_MAGIC;
index b0d493e..1cf70bb 100755 (executable)
@@ -4553,6 +4553,7 @@ void CCPortLatency::reset(){
     m_tx_pkt_err=0;
     m_tx_pkt_ok =0;
     m_pkt_ok=0;
+    m_rx_check=0;
     m_no_magic=0;
     m_unsup_prot=0;
     m_no_id=0;
index 002c9d0..7d659d1 100755 (executable)
@@ -1249,6 +1249,7 @@ struct CFlowYamlInfo {
     CFlowYamlInfo(){
         m_dpPkt=0;
         m_server_addr=0;
+        m_cap_mode=false;
     }
     
     std::string     m_name;
index 67ce89e..3a67ca2 100755 (executable)
@@ -243,6 +243,11 @@ bool RxCheckManager::Create(){
     m_hist.Create();
        m_cur_time=0.00000001;
     m_on_drain=false;
+
+    int i;
+    for (i=0; i<MAX_TEMPLATES_STATS;i++ ) {
+        m_template_info[i].reset();
+    }
        return (true);
 
 }
@@ -277,11 +282,6 @@ void RxCheckManager::handle_packet(CRx_check_header * rxh){
     lf=m_ft.lookup(rxh->m_flow_id);
        m_stats.m_lookup++;
 
-    if ((m_stats.m_lookup & 0xff)==0) {
-        /* handle aging from time to time */
-
-        tw_handle()  ;
-    }
 
     bool any_err=false;
     if ( rxh->is_fif_dir() ) {
@@ -393,6 +393,10 @@ void RxCheckManager::handle_packet(CRx_check_header * rxh){
             on_flow_end(lf);
     }
 
+    if ((m_stats.m_lookup & 0xff)==0) {
+        /* handle aging from time to time */
+        tw_handle()  ;
+    }
 }
 
 void RxCheckManager::update_template_err(uint8_t template_id){
index 3ac5dd1..54af245 100755 (executable)
@@ -85,6 +85,9 @@ public:
     int get_dir(void){
         return (btGetMaskBit8(m_flags,0,0) ? 1:0);
     }
+    void clean(){
+        memset(this,0,sizeof(CRx_check_header));
+    }
 
     /* need to mark if we expect to see both sides of the flow, this is know offline  */
     void set_both_dir(int both){
index 172d061..bb480ab 100755 (executable)
@@ -169,11 +169,14 @@ bool CTimerWheel::handle(){
                 assert(timer->m_flow);
                 CFlowTimerHandle *     flow =timer->m_flow;
                 m_st_handle++;
+
+                timer->m_flow=0;/* stop the timer */
+                flow->m_timer=0;
+
                 if ( flow->m_callback ){
                     flow->m_callback(flow);
                 }
-                timer->m_flow=0;/* stop the timer */
-                flow->m_timer=0;
+
                 m_pq.pop();
                 m_st_free++;
                 delete timer;