summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYaroslav Brustinov <ybrustin@cisco.com>2016-11-10 19:48:15 +0200
committerYaroslav Brustinov <ybrustin@cisco.com>2016-11-10 19:48:15 +0200
commit98dc1571776f4a8538e6ac72ce4e3fd4a2295026 (patch)
treefabef8a7fd3653e450433c196675346862d044dd
parente9b4c74dae5a79a6ad77f0f1328f90795e9cc421 (diff)
Add nicer error if -c is bigger than number of threads in platform config
Signed-off-by: Yaroslav Brustinov <ybrustin@cisco.com>
-rwxr-xr-xscripts/automation/regression/functional_tests/trex_cfg_creator_test.py3
-rwxr-xr-xsrc/bp_sim.cpp7
2 files changed, 9 insertions, 1 deletions
diff --git a/scripts/automation/regression/functional_tests/trex_cfg_creator_test.py b/scripts/automation/regression/functional_tests/trex_cfg_creator_test.py
index 5ff6b318..be94779c 100755
--- a/scripts/automation/regression/functional_tests/trex_cfg_creator_test.py
+++ b/scripts/automation/regression/functional_tests/trex_cfg_creator_test.py
@@ -694,5 +694,6 @@ class TRexCfgCreator_Test:
@classmethod
def tearDownClass(cls):
- sys.path.remove(CTRexScenario.scripts_path)
+ if CTRexScenario.scripts_path in sys.path:
+ sys.path.remove(CTRexScenario.scripts_path)
del sys.modules['dpdk_setup_ports']
diff --git a/src/bp_sim.cpp b/src/bp_sim.cpp
index 734fd1b0..3373c363 100755
--- a/src/bp_sim.cpp
+++ b/src/bp_sim.cpp
@@ -238,6 +238,13 @@ bool CPlatformSocketInfoConfig::init(){
}
}
+ if (m_threads_per_dual_if > m_max_threads_per_dual_if) {
+ printf("ERROR: Maximum threads in platform section of config file is %d, unable to run with -c %d.\n",
+ m_max_threads_per_dual_if, m_threads_per_dual_if);
+ printf("Please increase the pool in config or use lower -c.\n");
+ exit(1);
+ }
+
int j;
for (j=0; j<m_threads_per_dual_if; j++) {