test suite reviews and discussions
 help / color / mirror / Atom feed
From: Phil Yang <phil.yang@arm.com>
To: dts@dpdk.org
Cc: nd@arm.com, phil.yang@arm.com, yong.liu@intel.com
Subject: [dts] [PATCH] framework/crb: Add new option in crbs to identify dut arch
Date: Mon, 13 Aug 2018 16:20:59 +0800	[thread overview]
Message-ID: <1534148459-10206-1-git-send-email-phil.yang@arm.com> (raw)

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@arm.com>
Tested-by: Liang JiangWang <liangjiang.wang@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

             reply	other threads:[~2018-08-13  8:21 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-13  8:20 Phil Yang [this message]
2018-08-18 10:29 ` Lijuan Tu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1534148459-10206-1-git-send-email-phil.yang@arm.com \
    --to=phil.yang@arm.com \
    --cc=dts@dpdk.org \
    --cc=nd@arm.com \
    --cc=yong.liu@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).