summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHanoh Haim <hhaim@cisco.com>2015-09-20 17:33:56 +0300
committerHanoh Haim <hhaim@cisco.com>2015-09-20 17:33:56 +0300
commit588bb20e9c8f8438db4eb3e8db85111f41bd7306 (patch)
tree1a0bdc0524c2e29fcd36aa5e0cac8e3b71eb4a78
parente3cbd70324e3b5616de2aed3fff65ff57135c961 (diff)
fix tuple generator servers count sanity check
-rwxr-xr-xscripts/avl/sfr_branch_profile_delay_10.yaml2
-rwxr-xr-xscripts/avl/sfr_delay_10.yaml2
-rwxr-xr-xscripts/avl/sfr_delay_10_1g.yaml2
-rwxr-xr-xscripts/cap2/per_template_gen5.yaml51
-rwxr-xr-xsrc/bp_sim.cpp32
-rwxr-xr-xsrc/tuple_gen.cpp1
6 files changed, 87 insertions, 3 deletions
diff --git a/scripts/avl/sfr_branch_profile_delay_10.yaml b/scripts/avl/sfr_branch_profile_delay_10.yaml
index 71e69212..04671b3e 100755
--- a/scripts/avl/sfr_branch_profile_delay_10.yaml
+++ b/scripts/avl/sfr_branch_profile_delay_10.yaml
@@ -4,7 +4,7 @@
clients_start : "16.0.0.1"
clients_end : "16.0.1.255"
servers_start : "48.0.0.1"
- servers_end : "48.0.62.255"
+ servers_end : "48.0.63.224"
clients_per_gb : 201
min_clients : 101
dual_port_mask : "1.0.0.0"
diff --git a/scripts/avl/sfr_delay_10.yaml b/scripts/avl/sfr_delay_10.yaml
index 1a3f82c3..2bb70fe4 100755
--- a/scripts/avl/sfr_delay_10.yaml
+++ b/scripts/avl/sfr_delay_10.yaml
@@ -4,7 +4,7 @@
clients_start : "16.0.0.1"
clients_end : "16.0.1.255"
servers_start : "48.0.0.1"
- servers_end : "48.0.20.255"
+ servers_end : "48.0.21.245"
clients_per_gb : 201
min_clients : 101
dual_port_mask : "1.0.0.0"
diff --git a/scripts/avl/sfr_delay_10_1g.yaml b/scripts/avl/sfr_delay_10_1g.yaml
index 925531fd..065fe855 100755
--- a/scripts/avl/sfr_delay_10_1g.yaml
+++ b/scripts/avl/sfr_delay_10_1g.yaml
@@ -4,7 +4,7 @@
clients_start : "16.0.0.1"
clients_end : "16.0.1.255"
servers_start : "48.0.0.1"
- servers_end : "48.0.20.255"
+ servers_end : "48.0.21.245"
clients_per_gb : 201
min_clients : 101
dual_port_mask : "1.0.0.0"
diff --git a/scripts/cap2/per_template_gen5.yaml b/scripts/cap2/per_template_gen5.yaml
new file mode 100755
index 00000000..e29a2bfc
--- /dev/null
+++ b/scripts/cap2/per_template_gen5.yaml
@@ -0,0 +1,51 @@
+- duration : 1.0
+ generator :
+ distribution : "seq"
+ clients_start : "20.0.0.1"
+ clients_end : "20.0.0.255"
+ servers_start : "90.0.0.1"
+ servers_end : "90.0.255.255"
+ clients_per_gb : 201
+ min_clients : 101
+ dual_port_mask : "1.0.0.0"
+ tcp_aging : 0
+ udp_aging : 0
+ generator_clients :
+ - name : "c1"
+ distribution : "seq"
+ ip_start : "26.0.0.1"
+ ip_end : "26.0.1.255"
+ - name : "c2"
+ distribution : "seq"
+ ip_start : "36.0.0.1"
+ ip_end : "36.0.1.254"
+ generator_servers :
+ - name : "s1"
+ distribution : "seq"
+ ip_start : "28.0.0.1"
+ ip_end : "28.0.1.255"
+ track_ports : false
+ - name : "s2"
+ distribution : "seq"
+ ip_start : "38.0.0.1"
+ ip_end : "38.0.3.255"
+ track_ports : false
+ mac : [0x0,0x0,0x0,0x1,0x0,0x00]
+ cap_info :
+ - name: cap2/http_get.pcap
+ client_pool: "c2"
+ server_pool: "s1"
+ cps : 1.0
+ ipg : 100
+ rtt : 10000
+ w : 1
+ - name: avl/delay_10_rtp_160k_full.pcap
+ client_pool: "c1"
+ server_pool: "s2"
+ cps : 0.7
+ ipg : 10000
+ rtt : 10000
+ w : 1
+ one_app_server : false
+ plugin_id : 1
+
diff --git a/src/bp_sim.cpp b/src/bp_sim.cpp
index 47047831..fca517cf 100755
--- a/src/bp_sim.cpp
+++ b/src/bp_sim.cpp
@@ -2716,6 +2716,38 @@ bool CFlowsYamlInfo::verify_correctness(uint32_t num_threads) {
if ( !m_tuple_gen.is_valid(num_threads,is_any_plugin_configured()) ){
return (false);
}
+ /* patch defect trex-54 */
+ if ( is_any_plugin_configured() ){
+ /*Plugin is configured. in that case due to a limitation ( defect trex-54 )
+ the number of servers should be bigger than number of clients */
+
+ int i;
+ for (i=0; i<(int)m_vec.size(); i++) {
+ CFlowYamlInfo * lp=&m_vec[i];
+ if ( lp->m_plugin_id ){
+ uint8_t c_idx = lp->m_client_pool_idx;
+ uint8_t s_idx = lp->m_server_pool_idx;
+ uint32_t total_clients = m_tuple_gen.m_client_pool[c_idx].getTotalIps();
+ uint32_t total_servers = m_tuple_gen.m_server_pool[s_idx].getTotalIps();
+ if ( total_servers < total_clients ){
+ printf(" Plugin is configured. in that case due to a limitation ( defect trex-54 ) \n");
+ printf(" the number of servers should be bigger than number of clients \n");
+ printf(" client_pool_name : %s \n", lp->m_client_pool_name.c_str());
+ printf(" server_pool_name : %s \n", lp->m_server_pool_name.c_str());
+ return (false);
+ }
+ uint32_t mul = total_servers / total_clients;
+ uint32_t new_server_num = mul * total_clients;
+ if ( new_server_num != total_servers ) {
+ printf(" Plugin is configured. in that case due to a limitation ( defect trex-54 ) \n");
+ printf(" the number of servers should be exact multiplication of the number of clients \n");
+ printf(" client_pool_name : %s clients %d \n", lp->m_client_pool_name.c_str(),total_clients);
+ printf(" server_pool_name : %s servers %d should be %d \n", lp->m_server_pool_name.c_str(),total_servers,new_server_num);
+ return (false);
+ }
+ }
+ }
+ }
return(true);
}
diff --git a/src/tuple_gen.cpp b/src/tuple_gen.cpp
index 3d285845..e408f275 100755
--- a/src/tuple_gen.cpp
+++ b/src/tuple_gen.cpp
@@ -359,6 +359,7 @@ bool CTupleGenYamlInfo::is_valid(uint32_t num_threads,bool is_plugins){
if (m_server_pool[i].is_valid(num_threads, is_plugins)==false)
return false;
}
+
return true;
}