[dts] [PATCH] framework/crb: Add new option in crbs to identify dut arch

Phil Yang phil.yang at arm.com
Mon Aug 13 10:20:59 CEST 2018


The SOCKET IDs on some arm64 servers are incorrect which listed by lscpu
on Linux. This defect will causes DTS failures.

0,0,0,0
1,1,0,0
2,2,0,0
3,3,0,0
4,4,1,0
5,5,1,0
6,6,1,0
7,7,1,0
8,8,2,0
9,9,2,0
10,10,2,0
11,11,2,0
12,12,3,0
13,13,3,0
14,14,3,0
15,15,3,0
16,16,4,1
17,17,4,1
18,18,4,1
19,19,4,1
20,20,5,1
21,21,5,1
22,22,5,1
23,23,5,1
...

However, the NUMA NODE ID is correct and the NUMA NODE ID is the
equivalence of SOCKET ID on arm server.
By replacing the SOCKET ID with the NUMA NODE ID on the arm64
platform can solve this issue.

Signed-off-by: Phil Yang <phil.yang at arm.com>
Tested-by: Liang JiangWang <liangjiang.wang at arm.com>
---
 conf/crbs.cfg       |  2 ++
 framework/config.py |  2 ++
 framework/crb.py    | 12 ++++++++----
 3 files changed, 12 insertions(+), 4 deletions(-)

diff --git a/conf/crbs.cfg b/conf/crbs.cfg
index 0a17c35..f8676e6 100644
--- a/conf/crbs.cfg
+++ b/conf/crbs.cfg
@@ -14,6 +14,7 @@ dut_ip=xxx.xxx.xxx.xxx
 dut_user=root
 dut_passwd=
 os=linux
+dut_arch=
 tester_ip=xxx.xxx.xxx.xxx
 tester_passwd=
 ixia_group=
@@ -24,6 +25,7 @@ dut_ip=yyy.yyy.yyy.yyy
 dut_user=root
 dut_passwd=
 os=linux
+dut_arch=
 tester_ip=yyy.yyy.yyy.yyy
 tester_passwd=
 ixia_group=
diff --git a/framework/config.py b/framework/config.py
index 71b1c37..46c6ffb 100644
--- a/framework/config.py
+++ b/framework/config.py
@@ -301,6 +301,8 @@ class CrbsConf(UserConf):
                         crb['bypass core0'] = False
                 elif key == 'board':
                     crb['board'] = value
+                elif key == 'dut_arch':
+                    crb['dut arch'] = value
 
             self.crbs_cfg.append(crb)
         return self.crbs_cfg
diff --git a/framework/crb.py b/framework/crb.py
index 0885539..5c555db 100644
--- a/framework/crb.py
+++ b/framework/crb.py
@@ -545,7 +545,7 @@ class Crb(object):
 
         cpuinfo = \
             self.send_expect(
-                "lscpu -p|grep -v \#",
+                "lscpu -p=CPU,CORE,SOCKET,NODE|grep -v \#",
                 "#", alt_session=True)
 
         cpuinfo = cpuinfo.split()
@@ -554,7 +554,7 @@ class Crb(object):
         core_id = 0
         coremap = {}
         for line in cpuinfo:
-            (thread, core, socket, unused) = line.split(',')[0:4]
+            (thread, core, socket, node) = line.split(',')[0:4]
 
             if core not in coremap.keys():
                 coremap[core] = core_id
@@ -563,8 +563,12 @@ class Crb(object):
             if self.crb['bypass core0'] and core == '0' and socket == '0':
                 self.logger.info("Core0 bypassed")
                 continue
-            self.cores.append(
-                    {'thread': thread, 'socket': socket, 'core': coremap[core]})
+            if self.crb['dut arch'] == "arm64":
+                self.cores.append(
+                        {'thread': thread, 'socket': node, 'core': coremap[core]})
+            else:
+                self.cores.append(
+                        {'thread': thread, 'socket': socket, 'core': coremap[core]})
 
         self.number_of_cores = len(self.cores)
 
-- 
2.7.4



More information about the dts mailing list