test suite reviews and discussions
 help / color / mirror / Atom feed
* [dts] [PATCH V2] tests/unit_tests_pmd_perf:fix the ports and cores were from different sockets
@ 2018-06-12  5:53 lu,peipei
  0 siblings, 0 replies; 5+ messages in thread
From: lu,peipei @ 2018-06-12  5:53 UTC (permalink / raw)
  To: dts; +Cc: lu,peipei

the cases need ports and cores from the same socket.

Signed-off-by: lu,peipei <peipeix.lu@intel.com>
---
 tests/TestSuite_unit_tests_pmd_perf.py | 27 ++++++++++++++++++++++-----
 1 file changed, 22 insertions(+), 5 deletions(-)

diff --git a/tests/TestSuite_unit_tests_pmd_perf.py b/tests/TestSuite_unit_tests_pmd_perf.py
index 7fc200e..9c3d62d 100644
--- a/tests/TestSuite_unit_tests_pmd_perf.py
+++ b/tests/TestSuite_unit_tests_pmd_perf.py
@@ -85,12 +85,28 @@ class TestUnitTestsPmdPerf(TestCase):
         """
         pass
 
+    def get_core_from_socket(self):
+	"""
+	select  the port and lcores from same socket.
+	"""
+	out = self.dut.send_expect("./usertools/cpu_layout.py","#", 10)
+	k = re.search("Core 0 (.*)", out)
+	result = re.findall("(\d+),", k.group())
+	socket_id = self.dut.ports_info[0]['port'].socket
+	if socket_id == 0:
+	   return  int(result[0])
+	elif socket_id == 1:
+	   return  int(result[1])
+	else:
+	   print "socket error"
+
     def test_pmd_burst(self):
         """
         Run pmd stream control mode burst test case.
         """
-
-        self.dut.send_expect("./test/test/test -n 1 -c f", "R.*T.*E.*>.*>", 60)
+	
+	self.core = self.get_core_from_socket()
+	self.dut.send_expect("./test/test/test -n 1 --lcores='%d-%d'" %(self.core, self.core + 6), "R.*T.*E.*>.*>", 60)
         for mode in self.burst_ctlmodes:
             self.dut.send_expect("set_rxtx_sc %s" % mode, "RTE>>", 10)
             out = self.dut.send_expect("pmd_perf_autotest", "RTE>>", 120)
@@ -106,16 +122,17 @@ class TestUnitTestsPmdPerf(TestCase):
         Run pmd stream control mode continues test case.
         """
 
-        self.table_header = ['Mode']
+        self.core = self.get_core_from_socket()
+	self.table_header = ['Mode']
         self.table_header += self.anchors
         self.result_table_create(self.table_header)
         print self.table_header
 
         for mode in self.rxtx_modes:
             if mode is "scalar":
-                self.dut.send_expect("./test/test/test_scalar -n 1 -c f", "R.*T.*E.*>.*>", 60)
+		self.dut.send_expect("./test/test/test_scalar -n 1 --lcores='%d-%d'" %(self.core, self.core + 6), "R.*T.*E.*>.*>", 60)
             else:
-                self.dut.send_expect("./test/test/test -n 1 -c f", "R.*T.*E.*>.*>", 60)
+		self.dut.send_expect("./test/test/test -n 1 --lcores='%d-%d'" %(self.core, self.core + 6), "R.*T.*E.*>.*>", 60)
 
             table_row = [mode]
             self.dut.send_expect("set_rxtx_sc continuous", "RTE>>", 10)
-- 
1.9.3

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [dts] [PATCH V2] tests/unit_tests_pmd_perf: fix the ports and cores were from different sockets
  2018-06-12  8:52 lu,peipei
@ 2018-06-12 16:50 ` Liu, Yong
  0 siblings, 0 replies; 5+ messages in thread
From: Liu, Yong @ 2018-06-12 16:50 UTC (permalink / raw)
  To: lu,peipei, dts

Thanks, peipei. Applied.

On 06/12/2018 04:52 PM, lu,peipei wrote:
> the cases need ports and cores from the same socket.
>
> Signed-off-by: lu,peipei<peipeix.lu@intel.com>

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [dts] [PATCH V2] tests/unit_tests_pmd_perf: fix the ports and cores were from different sockets
@ 2018-06-12  8:52 lu,peipei
  2018-06-12 16:50 ` Liu, Yong
  0 siblings, 1 reply; 5+ messages in thread
From: lu,peipei @ 2018-06-12  8:52 UTC (permalink / raw)
  To: dts; +Cc: lu,peipei

the cases need ports and cores from the same socket.

Signed-off-by: lu,peipei <peipeix.lu@intel.com>
---
 tests/TestSuite_unit_tests_pmd_perf.py | 24 ++++++++++++++++++++----
 1 file changed, 20 insertions(+), 4 deletions(-)

diff --git a/tests/TestSuite_unit_tests_pmd_perf.py b/tests/TestSuite_unit_tests_pmd_perf.py
index 7fc200e..ab67b5d 100644
--- a/tests/TestSuite_unit_tests_pmd_perf.py
+++ b/tests/TestSuite_unit_tests_pmd_perf.py
@@ -85,12 +85,27 @@ class TestUnitTestsPmdPerf(TestCase):
         """
         pass
 
+    def get_core_from_socket(self):
+       """
+       select  the port and lcores from same socket.
+       """
+    
+       out = self.dut.send_expect("./usertools/cpu_layout.py", "#", 10)
+       k = re.search("Core 0 (.*)", out)
+       result = re.findall("(\d+),", k.group())
+       socket_id = self.dut.ports_info[0]['port'].socket
+       if socket_id == 0 or socket_id == -1:
+          return  int(result[0])
+       else:
+          return  int(result[1])
+
     def test_pmd_burst(self):
         """
         Run pmd stream control mode burst test case.
         """
 
-        self.dut.send_expect("./test/test/test -n 1 -c f", "R.*T.*E.*>.*>", 60)
+        self.core = self.get_core_from_socket()
+        self.dut.send_expect("./test/test/test -n 1 --lcores='%d-%d'" % (self.core, self.core + 1), "R.*T.*E.*>.*>", 60)
         for mode in self.burst_ctlmodes:
             self.dut.send_expect("set_rxtx_sc %s" % mode, "RTE>>", 10)
             out = self.dut.send_expect("pmd_perf_autotest", "RTE>>", 120)
@@ -105,7 +120,8 @@ class TestUnitTestsPmdPerf(TestCase):
         """
         Run pmd stream control mode continues test case.
         """
-
+        
+        self.core = self.get_core_from_socket()
         self.table_header = ['Mode']
         self.table_header += self.anchors
         self.result_table_create(self.table_header)
@@ -113,9 +129,9 @@ class TestUnitTestsPmdPerf(TestCase):
 
         for mode in self.rxtx_modes:
             if mode is "scalar":
-                self.dut.send_expect("./test/test/test_scalar -n 1 -c f", "R.*T.*E.*>.*>", 60)
+                self.dut.send_expect("./test/test/test_scalar -n 1 --lcores='%d-%d'" % (self.core, self.core + 1), "R.*T.*E.*>.*>", 60)
             else:
-                self.dut.send_expect("./test/test/test -n 1 -c f", "R.*T.*E.*>.*>", 60)
+                self.dut.send_expect("./test/test/test -n 1 --lcores='%d-%d'" % (self.core, self.core + 1), "R.*T.*E.*>.*>", 60)
 
             table_row = [mode]
             self.dut.send_expect("set_rxtx_sc continuous", "RTE>>", 10)
-- 
1.9.3

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [dts] [PATCH V2] tests/unit_tests_pmd_perf: fix the ports and cores were from different sockets
  2018-06-12  6:28 [dts] [PATCH V2] tests/unit_tests_pmd_perf: fix " lu,peipei
@ 2018-06-12  8:25 ` Liu, Yong
  0 siblings, 0 replies; 5+ messages in thread
From: Liu, Yong @ 2018-06-12  8:25 UTC (permalink / raw)
  To: Lu, PeipeiX, dts; +Cc: Lu, PeipeiX

Peipei,
More comments are inline.

Thanks,
Marvin

> -----Original Message-----
> From: dts [mailto:dts-bounces@dpdk.org] On Behalf Of lu,peipei
> Sent: Tuesday, June 12, 2018 2:29 PM
> To: dts@dpdk.org
> Cc: Lu, PeipeiX <peipeix.lu@intel.com>
> Subject: [dts] [PATCH V2] tests/unit_tests_pmd_perf: fix the ports and
> cores were from different sockets
> 
> the cases need ports and cores from the same socket.
> 
> Signed-off-by: lu,peipei <peipeix.lu@intel.com>
> ---
>  tests/TestSuite_unit_tests_pmd_perf.py | 24 ++++++++++++++++++++----
>  1 file changed, 20 insertions(+), 4 deletions(-)
> 
> diff --git a/tests/TestSuite_unit_tests_pmd_perf.py
> b/tests/TestSuite_unit_tests_pmd_perf.py
> index 7fc200e..ab67b5d 100644
> --- a/tests/TestSuite_unit_tests_pmd_perf.py
> +++ b/tests/TestSuite_unit_tests_pmd_perf.py
> @@ -85,12 +85,27 @@ class TestUnitTestsPmdPerf(TestCase):
>          """
>          pass
> 
> +    def get_core_from_socket(self):
> +       """
> +       select  the port and lcores from same socket.
> +       """
> +
> +       out = self.dut.send_expect("./usertools/cpu_layout.py","#", 10)

Please add space after comma symbol.

> +       k = re.search("Core 0 (.*)", out)
> +       result = re.findall("(\d+),", k.group())
> +       socket_id = self.dut.ports_info[0]['port'].socket
> +       if socket_id == 0 or socket_id == -1:
> +          return  int(result[0])
> +       else:
> +          return  int(result[1])
> +
>      def test_pmd_burst(self):
>          """
>          Run pmd stream control mode burst test case.
>          """
> 
> -        self.dut.send_expect("./test/test/test -n 1 -c f",
> "R.*T.*E.*>.*>", 60)
> +        self.core = self.get_core_from_socket()
> +        self.dut.send_expect("./test/test/test -n 1 --lcores='%d-
> %d'" %(self.core, self.core + 6), "R.*T.*E.*>.*>", 60)

Please add space after percent sign.

>          for mode in self.burst_ctlmodes:
>              self.dut.send_expect("set_rxtx_sc %s" % mode, "RTE>>", 10)
>              out = self.dut.send_expect("pmd_perf_autotest", "RTE>>", 120)
> @@ -105,7 +120,8 @@ class TestUnitTestsPmdPerf(TestCase):
>          """
>          Run pmd stream control mode continues test case.
>          """
> -
> +
> +        self.core = self.get_core_from_socket()
>          self.table_header = ['Mode']
>          self.table_header += self.anchors
>          self.result_table_create(self.table_header)
> @@ -113,9 +129,9 @@ class TestUnitTestsPmdPerf(TestCase):
> 
>          for mode in self.rxtx_modes:
>              if mode is "scalar":
> -                self.dut.send_expect("./test/test/test_scalar -n 1 -c f",
> "R.*T.*E.*>.*>", 60)
> +                self.dut.send_expect("./test/test/test_scalar -n 1 --
> lcores='%d-%d'" %(self.core, self.core + 6), "R.*T.*E.*>.*>", 60)

Please reduce the number of core, if possible please just use 2 cores.

>              else:
> -                self.dut.send_expect("./test/test/test -n 1 -c f",
> "R.*T.*E.*>.*>", 60)
> +                self.dut.send_expect("./test/test/test -n 1 --lcores='%d-
> %d'" %(self.core, self.core + 6), "R.*T.*E.*>.*>", 60)
> 
>              table_row = [mode]
>              self.dut.send_expect("set_rxtx_sc continuous", "RTE>>", 10)
> --
> 1.9.3

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [dts] [PATCH V2] tests/unit_tests_pmd_perf: fix the ports and cores were from different sockets
@ 2018-06-12  6:28 lu,peipei
  2018-06-12  8:25 ` Liu, Yong
  0 siblings, 1 reply; 5+ messages in thread
From: lu,peipei @ 2018-06-12  6:28 UTC (permalink / raw)
  To: dts; +Cc: lu,peipei

the cases need ports and cores from the same socket.

Signed-off-by: lu,peipei <peipeix.lu@intel.com>
---
 tests/TestSuite_unit_tests_pmd_perf.py | 24 ++++++++++++++++++++----
 1 file changed, 20 insertions(+), 4 deletions(-)

diff --git a/tests/TestSuite_unit_tests_pmd_perf.py b/tests/TestSuite_unit_tests_pmd_perf.py
index 7fc200e..ab67b5d 100644
--- a/tests/TestSuite_unit_tests_pmd_perf.py
+++ b/tests/TestSuite_unit_tests_pmd_perf.py
@@ -85,12 +85,27 @@ class TestUnitTestsPmdPerf(TestCase):
         """
         pass
 
+    def get_core_from_socket(self):
+       """
+       select  the port and lcores from same socket.
+       """
+    
+       out = self.dut.send_expect("./usertools/cpu_layout.py","#", 10)
+       k = re.search("Core 0 (.*)", out)
+       result = re.findall("(\d+),", k.group())
+       socket_id = self.dut.ports_info[0]['port'].socket
+       if socket_id == 0 or socket_id == -1:
+          return  int(result[0])
+       else:
+          return  int(result[1])
+
     def test_pmd_burst(self):
         """
         Run pmd stream control mode burst test case.
         """
 
-        self.dut.send_expect("./test/test/test -n 1 -c f", "R.*T.*E.*>.*>", 60)
+        self.core = self.get_core_from_socket()
+        self.dut.send_expect("./test/test/test -n 1 --lcores='%d-%d'" %(self.core, self.core + 6), "R.*T.*E.*>.*>", 60)
         for mode in self.burst_ctlmodes:
             self.dut.send_expect("set_rxtx_sc %s" % mode, "RTE>>", 10)
             out = self.dut.send_expect("pmd_perf_autotest", "RTE>>", 120)
@@ -105,7 +120,8 @@ class TestUnitTestsPmdPerf(TestCase):
         """
         Run pmd stream control mode continues test case.
         """
-
+        
+        self.core = self.get_core_from_socket()
         self.table_header = ['Mode']
         self.table_header += self.anchors
         self.result_table_create(self.table_header)
@@ -113,9 +129,9 @@ class TestUnitTestsPmdPerf(TestCase):
 
         for mode in self.rxtx_modes:
             if mode is "scalar":
-                self.dut.send_expect("./test/test/test_scalar -n 1 -c f", "R.*T.*E.*>.*>", 60)
+                self.dut.send_expect("./test/test/test_scalar -n 1 --lcores='%d-%d'" %(self.core, self.core + 6), "R.*T.*E.*>.*>", 60)
             else:
-                self.dut.send_expect("./test/test/test -n 1 -c f", "R.*T.*E.*>.*>", 60)
+                self.dut.send_expect("./test/test/test -n 1 --lcores='%d-%d'" %(self.core, self.core + 6), "R.*T.*E.*>.*>", 60)
 
             table_row = [mode]
             self.dut.send_expect("set_rxtx_sc continuous", "RTE>>", 10)
-- 
1.9.3

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2018-06-12  9:03 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-06-12  5:53 [dts] [PATCH V2] tests/unit_tests_pmd_perf:fix the ports and cores were from different sockets lu,peipei
2018-06-12  6:28 [dts] [PATCH V2] tests/unit_tests_pmd_perf: fix " lu,peipei
2018-06-12  8:25 ` Liu, Yong
2018-06-12  8:52 lu,peipei
2018-06-12 16:50 ` Liu, Yong

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).