summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorimarom <imarom@cisco.com>2016-10-26 15:00:50 +0200
committerimarom <imarom@cisco.com>2016-10-26 15:22:47 +0200
commit7d129c00303a5df1d6af331781139dc2d447d0d8 (patch)
treeb606ea8a8bde53a69a27d128f55b349a55e20a9b
parent270cf64af087f110fd69064017edc311ddf82025 (diff)
fixed performance issue (moved STRECH case to low priority cases)
Signed-off-by: imarom <imarom@cisco.com>
-rwxr-xr-x[-rw-r--r--]linux_dpdk/d0
-rw-r--r--scripts/automation/regression/setups/trex09/benchmark.yaml14
-rw-r--r--scripts/automation/regression/stateless_tests/stl_performance_test.py14
-rwxr-xr-xsrc/bp_sim.cpp66
-rwxr-xr-xsrc/bp_sim.h14
5 files changed, 72 insertions, 36 deletions
diff --git a/linux_dpdk/d b/linux_dpdk/d
index 8e511bbf..8e511bbf 100644..100755
--- a/linux_dpdk/d
+++ b/linux_dpdk/d
diff --git a/scripts/automation/regression/setups/trex09/benchmark.yaml b/scripts/automation/regression/setups/trex09/benchmark.yaml
index ed51a46c..f157d8f2 100644
--- a/scripts/automation/regression/setups/trex09/benchmark.yaml
+++ b/scripts/automation/regression/setups/trex09/benchmark.yaml
@@ -209,24 +209,24 @@ test_performance_syn_attack_single_cpu:
test_performance_vm_multi_cpus:
cfg:
- core_count : 3
+ core_count : 2
mult : "90%"
mpps_per_core_golden :
- min: 15.9
- max: 16.5
+ min: 15.7
+ max: 16.3
test_performance_vm_multi_cpus_cached:
cfg:
- core_count : 3
+ core_count : 2
mult : "90%"
mpps_per_core_golden :
- min: 29.6
- max: 30.5
+ min: 28.8
+ max: 29.5
test_performance_syn_attack_multi_cpus:
cfg:
- core_count : 3
+ core_count : 2
mult : "90%"
mpps_per_core_golden :
min: 13.0
diff --git a/scripts/automation/regression/stateless_tests/stl_performance_test.py b/scripts/automation/regression/stateless_tests/stl_performance_test.py
index a77c5c27..27c61cc0 100644
--- a/scripts/automation/regression/stateless_tests/stl_performance_test.py
+++ b/scripts/automation/regression/stateless_tests/stl_performance_test.py
@@ -180,7 +180,7 @@ class STLPerformance_Test(CStlGeneral_Test):
setup_cfg = self.get_benchmark_param('cfg')
scenario_cfg = {}
- scenario_cfg['name'] = "VM - 64 bytes, two CPUs"
+ scenario_cfg['name'] = "VM - 64 bytes, multi CPUs"
scenario_cfg['streams'] = self.build_perf_profile_vm(64)
scenario_cfg['core_count'] = setup_cfg['core_count']
@@ -191,12 +191,12 @@ class STLPerformance_Test(CStlGeneral_Test):
- # two CPUs, VM, cached, 64 bytes
+ # multi CPUs, VM, cached, 64 bytes
def test_performance_vm_multi_cpus_cached (self):
setup_cfg = self.get_benchmark_param('cfg')
scenario_cfg = {}
- scenario_cfg['name'] = "VM - 64 bytes, single CPU, cache size 1024"
+ scenario_cfg['name'] = "VM - 64 bytes, multi CPU, cache size 1024"
scenario_cfg['streams'] = self.build_perf_profile_vm(64, cache_size = 1024)
@@ -207,12 +207,12 @@ class STLPerformance_Test(CStlGeneral_Test):
self.execute_single_scenario(scenario_cfg)
- # two CPUs, syn attack, 64 bytes
+ # multi CPUs, syn attack, 64 bytes
def test_performance_syn_attack_multi_cpus (self):
setup_cfg = self.get_benchmark_param('cfg')
scenario_cfg = {}
- scenario_cfg['name'] = "syn attack - 64 bytes, two CPUs"
+ scenario_cfg['name'] = "syn attack - 64 bytes, multi CPUs"
scenario_cfg['streams'] = self.build_perf_profile_syn_attack(64)
scenario_cfg['core_count'] = setup_cfg['core_count']
@@ -254,6 +254,10 @@ class STLPerformance_Test(CStlGeneral_Test):
self.c.add_streams(ports = [0], streams = scenario_cfg['streams'])
# use one core
+ cores_per_port = self.c.system_info.get('dp_core_count_per_port', 0)
+ if cores_per_port < scenario_cfg['core_count']:
+ assert 0, "test configuration requires {0} cores but only {1} per port are available".format(scenario_cfg['core_count'], cores_per_port)
+
core_mask = (2 ** scenario_cfg['core_count']) - 1
self.c.start(ports = [0], mult = scenario_cfg['mult'], core_mask = [core_mask])
diff --git a/src/bp_sim.cpp b/src/bp_sim.cpp
index c4cb0927..db273b18 100755
--- a/src/bp_sim.cpp
+++ b/src/bp_sim.cpp
@@ -3787,22 +3787,6 @@ inline int CNodeGenerator::flush_file_realtime(dsec_t max_time,
}
break;
- /* a case called when a time strech happens */
- case scSTRECH:
- {
- dsec_t dt = cur_time - n_time;
- handle_time_strech(cur_time, dt, offset, thread);
-
- /* re-read the top of the queue - it might have changed with messaging */
- node = m_p_queue.top();
- n_time = node->m_time + offset;
-
- /* go back to INIT */
- state = scINIT;
-
- }
- break;
-
case scWORK:
{
int node_count = 0;
@@ -3831,14 +3815,42 @@ inline int CNodeGenerator::flush_file_realtime(dsec_t max_time,
do_sleep(cur_time,thread,n_time); // estimate loop
state=scWORK;
break;
+
+
default:
- assert(0);
+ handle_slow_operations(state, node, cur_time, n_time, offset, thread);
+ break;
} /* switch */
+
}/* while*/
return (teardown(thread,always,old_offset,offset));
}
+
+FORCE_NO_INLINE void CNodeGenerator::handle_slow_operations(sch_state_t &state,
+ CGenNode * &node,
+ dsec_t &cur_time,
+ dsec_t &n_time,
+ dsec_t &offset,
+ CFlowGenListPerThread *thread) {
+ switch (state) {
+ case scSTRECH:
+ {
+ handle_time_strech(node, cur_time, n_time, offset, thread);
+
+ /* go back to work */
+ state = scWORK;
+
+ }
+ break;
+
+ default:
+ assert(0);
+ }
+
+}
+
/**
* when time is streched - the flow_sync node
* might be postpond too much
@@ -3849,18 +3861,26 @@ inline int CNodeGenerator::flush_file_realtime(dsec_t max_time,
* @author imarom (7/31/2016)
*
*/
-FORCE_NO_INLINE void CNodeGenerator::handle_time_strech(dsec_t cur_time,
- dsec_t dt,
- dsec_t &offset,
- CFlowGenListPerThread *thread) {
+void CNodeGenerator::handle_time_strech(CGenNode * &node,
+ dsec_t &cur_time,
+ dsec_t &n_time,
+ dsec_t &offset,
+ CFlowGenListPerThread *thread) {
+
+
+ /* fix the time offset */
+ dsec_t dt = cur_time - n_time;
+ offset += dt;
/* check if flow sync message was delayed too much */
if ( (cur_time - m_last_sync_time_sec) > SYNC_TIME_OUT ) {
handle_maintenance(thread);
+
+ /* re-read the top of the queue - it might have changed with messaging */
+ node = m_p_queue.top();
+ n_time = node->m_time + offset;
}
- /* fix the time offset */
- offset += dt;
}
int CNodeGenerator::flush_file_sim(dsec_t max_time,
diff --git a/src/bp_sim.h b/src/bp_sim.h
index 0af27b95..f7a1e73c 100755
--- a/src/bp_sim.h
+++ b/src/bp_sim.h
@@ -2142,7 +2142,19 @@ private:
CFlowGenListPerThread * thread,
double &old_offset);
- FORCE_NO_INLINE void handle_time_strech(dsec_t cur_time, dsec_t dt, dsec_t &offset, CFlowGenListPerThread * thread);
+ FORCE_NO_INLINE void handle_slow_operations(sch_state_t &state,
+ CGenNode * &node,
+ dsec_t &cur_time,
+ dsec_t &n_time,
+ dsec_t &offset,
+ CFlowGenListPerThread *thread);
+
+ void handle_time_strech(CGenNode * &node,
+ dsec_t &cur_time,
+ dsec_t &n_time,
+ dsec_t &offset,
+ CFlowGenListPerThread *thread);
+
private:
void handle_command(CGenNode *node, CFlowGenListPerThread *thread, bool &exit_scheduler);