[dts] [PATCH] max_lcores: Fix max lcore value consideration for cavium devices

Phanendra Vukkisala pvukkisala at marvell.com
Thu Jan 10 06:27:44 CET 2019


From: pvukkisala <pvukkisala at marvell.com>

Cavium devices have different number of cores on different boards, so lcores
provided in configuration file may have more number of cores than cores
available on board. So taking which ever value is minimum to avoid failures.

Signed-off-by: phanendra,vukkisala <pvukkisala at marvell.com>
---
 tests/TestSuite_coremask.py    |    2 +-
 tests/TestSuite_hello_world.py |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/tests/TestSuite_coremask.py b/tests/TestSuite_coremask.py
index 1eb9286..921dc31 100644
--- a/tests/TestSuite_coremask.py
+++ b/tests/TestSuite_coremask.py
@@ -54,7 +54,7 @@ class TestCoremask(TestCase):
         config_max_lcore = self.dut.get_def_rte_config('CONFIG_RTE_MAX_LCORE')
 
         if config_max_lcore:
-            available_max_lcore = int(config_max_lcore)
+            available_max_lcore = min(int(config_max_lcore), len(self.all_cores) + 1)
         else:
             available_max_lcore = len(self.all_cores) + 1
 
diff --git a/tests/TestSuite_hello_world.py b/tests/TestSuite_hello_world.py
index d199177..67095e8 100644
--- a/tests/TestSuite_hello_world.py
+++ b/tests/TestSuite_hello_world.py
@@ -81,7 +81,7 @@ class TestHelloWorld(TestCase):
 
         config_max_lcore = self.dut.get_def_rte_config('CONFIG_RTE_MAX_LCORE')
         if config_max_lcore:
-            available_max_lcore = int(config_max_lcore)
+            available_max_lcore = min(int(config_max_lcore), len(cores) + 1)
         else:
             available_max_lcore = len(cores) + 1
 
-- 
1.7.9.5



More information about the dts mailing list