[V1] framework/crb: fix bug of generating core list on freebsd platform

Message ID 20220429090958.8126-1-junx.dong@intel.com (mailing list archive)
State Accepted
Headers
Series [V1] framework/crb: fix bug of generating core list on freebsd platform |

Checks

Context Check Description
ci/Intel-dts-format-test fail Testing issues
ci/Intel-dts-pylama-test fail Testing issues
ci/Intel-dts-suite-test success Testing OK

Commit Message

Jun Dong April 29, 2022, 9:09 a.m. UTC
  On freebsd platform that supporting Hyper threading, if crb.cfg configured 
support pass core 0, the cores list(Hyper threading) need not only skip thread 0,
but also other threads that on core 0.

Signed-off-by: Jun Dong <junx.dong@intel.com>
---
 framework/crb.py | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)
  

Comments

Tu, Lijuan May 5, 2022, 1:34 a.m. UTC | #1
On Fri, 29 Apr 2022 17:09:58 +0800, Jun Dong <junx.dong@intel.com> wrote:
> On freebsd platform that supporting Hyper threading, if crb.cfg configured 
> support pass core 0, the cores list(Hyper threading) need not only skip thread 0,
> but also other threads that on core 0.
> 
> Signed-off-by: Jun Dong <junx.dong@intel.com>

Reviewed-by: Lijuan Tu <lijuan.tu@intel.com>
Applied, thanks
  

Patch

diff --git a/framework/crb.py b/framework/crb.py
index a15d15e9..0dc82005 100644
--- a/framework/crb.py
+++ b/framework/crb.py
@@ -739,10 +739,11 @@  class Crb(object):
             for core in core_elements:
                 threads = [int(x) for x in core.text.split(",")]
                 for thread in threads:
-                    if thread != 0:
-                        self.cores.append(
-                            {"socket": socket_id, "core": core_id, "thread": thread}
-                        )
+                    if self.crb["bypass core0"] and socket_id == 0 and core_id == 0:
+                        continue
+                    self.cores.append(
+                        {"socket": socket_id, "core": core_id, "thread": thread}
+                    )
                 core_id += 1
             socket_id += 1
         self.number_of_cores = len(self.cores)