summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'scripts')
-rw-r--r--scripts/automation/trex_control_plane/stf/examples/stf_active_flow.py69
-rw-r--r--scripts/cap2/cur_flow.yaml12
-rw-r--r--scripts/cap2/cur_flow_single_tw_8.yaml26
-rw-r--r--scripts/cfg/trex_08_5mflows.yaml26
4 files changed, 127 insertions, 6 deletions
diff --git a/scripts/automation/trex_control_plane/stf/examples/stf_active_flow.py b/scripts/automation/trex_control_plane/stf/examples/stf_active_flow.py
new file mode 100644
index 00000000..0a72c9ac
--- /dev/null
+++ b/scripts/automation/trex_control_plane/stf/examples/stf_active_flow.py
@@ -0,0 +1,69 @@
+import argparse
+import stf_path
+from trex_stf_lib.trex_client import CTRexClient
+from pprint import pprint
+import csv
+import math
+
+# sample TRex stateful to chnage active-flows and get results
+
+def minimal_stateful_test(server,csv_file,a_active_flows):
+
+ trex_client = CTRexClient(server)
+
+ trex_client.start_trex(
+ c = 7,
+ m = 30000,
+# f = 'cap2/cur_flow_single.yaml',
+ f = 'cap2/cur_flow.yaml',
+ d = 30,
+ l = 1000,
+ p=True,
+ cfg = "cfg/trex_08_5mflows.yaml",
+ active_flows=a_active_flows,
+ nc=True
+ )
+
+ result = trex_client.sample_to_run_finish()
+
+
+ active_flows = result.get_value_list('trex-global.data.m_active_flows')
+
+ cpu_utl = result.get_value_list('trex-global.data.m_cpu_util')
+
+ pps = result.get_value_list('trex-global.data.m_tx_pps')
+
+ queue_full = result.get_value_list('trex-global.data.m_total_queue_full')
+
+ if queue_full[-1]>10000:
+ print("WARNING QUEU WAS FULL");
+
+ tuple=(active_flows[-5],cpu_utl[-5],pps[-5],queue_full[-1])
+ file_writer = csv.writer(test_file)
+ file_writer.writerow(tuple);
+
+
+
+if __name__ == '__main__':
+ test_file = open('tw_2_layers.csv', 'wb');
+ parser = argparse.ArgumentParser(description="active-flow example")
+
+ parser.add_argument('-s', '--server',
+ dest='server',
+ help='Remote trex address',
+ default='127.0.0.1',
+ type = str)
+ args = parser.parse_args()
+
+ max_flows = 8000000;
+ min_flows = 100;
+ active_flow = min_flows;
+ num_point = 10
+ factor = math.exp(math.log(max_flows/min_flows,math.e)/num_point);
+ for i in range(num_point+1):
+ print("<<=====================>>",i,math.floor(active_flow))
+ minimal_stateful_test(args.server,test_file,math.floor(active_flow))
+ active_flow=active_flow*factor
+
+ test_file.close();
+
diff --git a/scripts/cap2/cur_flow.yaml b/scripts/cap2/cur_flow.yaml
index 8f53c0be..dc518a44 100644
--- a/scripts/cap2/cur_flow.yaml
+++ b/scripts/cap2/cur_flow.yaml
@@ -14,13 +14,13 @@
#cap_ipg : true
cap_info :
- name: cap2/udp_10_pkts.pcap
- cps : 1
- ipg : 10000000
- rtt : 10000000
+ cps : 10
+ ipg : 100000
+ rtt : 100000
w : 1
- name: cap2/udp_10_pkts.pcap
- cps : 99
- ipg : 200
- rtt : 200
+ cps : 90
+ ipg : 2
+ rtt : 2
w : 1
diff --git a/scripts/cap2/cur_flow_single_tw_8.yaml b/scripts/cap2/cur_flow_single_tw_8.yaml
new file mode 100644
index 00000000..7652507a
--- /dev/null
+++ b/scripts/cap2/cur_flow_single_tw_8.yaml
@@ -0,0 +1,26 @@
+- duration : 0.1
+ generator :
+ distribution : "seq"
+ clients_start : "16.0.0.1"
+ clients_end : "16.0.0.255"
+ servers_start : "48.0.0.1"
+ servers_end : "48.0.255.255"
+ clients_per_gb : 201
+ min_clients : 101
+ dual_port_mask : "1.0.0.0"
+ tcp_aging : 0
+ udp_aging : 0
+ mac : [0x0,0x0,0x0,0x1,0x0,0x00]
+ #cap_ipg : true
+ tw : # set timer wheel configuration options
+ buckets : 16384
+ levels : 2
+ bucket_time_usec : 20.0
+
+ cap_info :
+ - name: cap2/udp_10_pkts.pcap
+ cps : 100
+ ipg : 200
+ rtt : 200
+ w : 1
+
diff --git a/scripts/cfg/trex_08_5mflows.yaml b/scripts/cfg/trex_08_5mflows.yaml
new file mode 100644
index 00000000..6dc4570a
--- /dev/null
+++ b/scripts/cfg/trex_08_5mflows.yaml
@@ -0,0 +1,26 @@
+- port_limit: 4
+ version: 2
+ interfaces: ['05:00.0', '05:00.1', '84:00.0', '84:00.1']
+ port_info:
+ - ip: 1.1.1.1
+ default_gw: 2.2.2.2
+ - ip: 3.3.3.3
+ default_gw: 4.4.4.4
+
+ - ip: 4.4.4.4
+ default_gw: 3.3.3.3
+ - ip: 2.2.2.2
+ default_gw: 1.1.1.1
+
+ platform:
+ master_thread_id: 0
+ latency_thread_id: 15
+ dual_if:
+ - socket: 0
+ threads: [1,2,3,4,5,6,7]
+
+ - socket: 1
+ threads: [8,9,10,11,12,13,14]
+ memory :
+ dp_flows : 1048576
+