fix tuple generator servers count sanity check
authorHanoh Haim <[email protected]>
Sun, 20 Sep 2015 14:33:56 +0000 (17:33 +0300)
committerHanoh Haim <[email protected]>
Sun, 20 Sep 2015 14:33:56 +0000 (17:33 +0300)
scripts/avl/sfr_branch_profile_delay_10.yaml
scripts/avl/sfr_delay_10.yaml
scripts/avl/sfr_delay_10_1g.yaml
scripts/cap2/per_template_gen5.yaml [new file with mode: 0755]
src/bp_sim.cpp
src/tuple_gen.cpp

index 71e6921..04671b3 100755 (executable)
@@ -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" 
index 1a3f82c..2bb70fe 100755 (executable)
@@ -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" 
index 925531f..065fe85 100755 (executable)
@@ -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 (executable)
index 0000000..e29a2bf
--- /dev/null
@@ -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
+       
index 4704783..fca517c 100755 (executable)
@@ -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);
 }
index 3d28584..e408f27 100755 (executable)
@@ -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;
 }