summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHanoh Haim <hhaim@cisco.com>2015-09-02 20:30:33 +0300
committerHanoh Haim <hhaim@cisco.com>2015-09-02 20:30:33 +0300
commit4ad6ed1716dc917a0b80ddfbbefc43c734eeaab6 (patch)
treed4b215558ff4c3507a7ba2cda45e5afc3574bb66
parent83a53d61c3e7db90637cde90f241f3272ccf3e5a (diff)
- fix valgrind gtest simulation errors
- remove 32bit sim images for faster dev
-rwxr-xr-xlinux/ws_main.py4
-rwxr-xr-xlinux_dpdk/ws_main.py3
-rwxr-xr-xsrc/bp_gtest.cpp37
-rwxr-xr-xsrc/bp_sim.cpp1
-rwxr-xr-xsrc/bp_sim.h1
-rwxr-xr-xsrc/rx_check.cpp14
-rwxr-xr-xsrc/rx_check_header.h3
-rwxr-xr-xsrc/timer_wheel_pq.cpp7
8 files changed, 53 insertions, 17 deletions
diff --git a/linux/ws_main.py b/linux/ws_main.py
index dc22be07..5bf9a743 100755
--- a/linux/ws_main.py
+++ b/linux/ws_main.py
@@ -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'],
diff --git a/linux_dpdk/ws_main.py b/linux_dpdk/ws_main.py
index e1aa8eaf..fc9fc587 100755
--- a/linux_dpdk/ws_main.py
+++ b/linux_dpdk/ws_main.py
@@ -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',
diff --git a/src/bp_gtest.cpp b/src/bp_gtest.cpp
index 020276cf..78efbecb 100755
--- a/src/bp_gtest.cpp
+++ b/src/bp_gtest.cpp
@@ -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;
diff --git a/src/bp_sim.cpp b/src/bp_sim.cpp
index b0d493e1..1cf70bba 100755
--- a/src/bp_sim.cpp
+++ b/src/bp_sim.cpp
@@ -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;
diff --git a/src/bp_sim.h b/src/bp_sim.h
index 002c9d0a..7d659d1c 100755
--- a/src/bp_sim.h
+++ b/src/bp_sim.h
@@ -1249,6 +1249,7 @@ struct CFlowYamlInfo {
CFlowYamlInfo(){
m_dpPkt=0;
m_server_addr=0;
+ m_cap_mode=false;
}
std::string m_name;
diff --git a/src/rx_check.cpp b/src/rx_check.cpp
index 67ce89e1..3a67ca23 100755
--- a/src/rx_check.cpp
+++ b/src/rx_check.cpp
@@ -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){
diff --git a/src/rx_check_header.h b/src/rx_check_header.h
index 3ac5dd1f..54af2451 100755
--- a/src/rx_check_header.h
+++ b/src/rx_check_header.h
@@ -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){
diff --git a/src/timer_wheel_pq.cpp b/src/timer_wheel_pq.cpp
index 172d061e..bb480abd 100755
--- a/src/timer_wheel_pq.cpp
+++ b/src/timer_wheel_pq.cpp
@@ -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;