test suite reviews and discussions
 help / color / Atom feed
* [dts] [PATCH V1 0/2] l3fwd: support set test ports in cfg file
@ 2020-01-17  2:29 yufengmx
  2020-01-17  2:29 ` [dts] [PATCH V1 1/2] conf/l3fwd: " yufengmx
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: yufengmx @ 2020-01-17  2:29 UTC (permalink / raw)
  To: dts, lijuan.tu; +Cc: yufengmx

add a key to select custom dut ports to run testing. If not set this key in cfg file, 
use default dut port list of dts framework. 

yufengmx (2):
  conf/l3fwd: support set test ports in cfg file
  tests/l3fwd: support set test ports in cfg file

 conf/l3fwd.cfg      |  4 ++++
 tests/l3fwd_base.py | 26 ++++++++++++++++++++++++++
 2 files changed, 30 insertions(+)

-- 
2.21.0


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

* [dts] [PATCH V1 1/2] conf/l3fwd: support set test ports in cfg file
  2020-01-17  2:29 [dts] [PATCH V1 0/2] l3fwd: support set test ports in cfg file yufengmx
@ 2020-01-17  2:29 ` " yufengmx
  2020-01-17  2:29 ` [dts] [PATCH V1 2/2] tests/l3fwd: " yufengmx
  2020-01-17  3:12 ` [dts] [PATCH V1 0/2] l3fwd: " Mo, YufengX
  2 siblings, 0 replies; 4+ messages in thread
From: yufengmx @ 2020-01-17  2:29 UTC (permalink / raw)
  To: dts, lijuan.tu; +Cc: yufengmx


add a key to select custom dut ports to run testing. If not set this key in cfg file,
use default dut port list of dts framework.

Signed-off-by: yufengmx <yufengx.mo@intel.com>
---
 conf/l3fwd.cfg | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/conf/l3fwd.cfg b/conf/l3fwd.cfg
index e566aff..a8a9af4 100644
--- a/conf/l3fwd.cfg
+++ b/conf/l3fwd.cfg
@@ -1,6 +1,9 @@
 # Throughput numbers vary in different environment.
 # Users could change these configuration on demand:
 #
+#  - port_list defines which ports are used to run testing If not set this key,
+#  use default dut port list of dts framework.
+#    port_list=[1,2,...]
 #  - test_parameters defines the combination of frame size and descriptor
 # numbers, and the pattern is
 #   {
@@ -52,6 +55,7 @@
 [suite]
 update_expected = True
 
+port_list=None
 test_duration = 12
 accepted_tolerance = 1
 test_parameters = {
-- 
2.21.0


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

* [dts] [PATCH V1 2/2] tests/l3fwd: support set test ports in cfg file
  2020-01-17  2:29 [dts] [PATCH V1 0/2] l3fwd: support set test ports in cfg file yufengmx
  2020-01-17  2:29 ` [dts] [PATCH V1 1/2] conf/l3fwd: " yufengmx
@ 2020-01-17  2:29 ` " yufengmx
  2020-01-17  3:12 ` [dts] [PATCH V1 0/2] l3fwd: " Mo, YufengX
  2 siblings, 0 replies; 4+ messages in thread
From: yufengmx @ 2020-01-17  2:29 UTC (permalink / raw)
  To: dts, lijuan.tu; +Cc: yufengmx


add a key to select custom dut ports to run testing. If not set this key in cfg file,
use default dut port list of dts framework.

Signed-off-by: yufengmx <yufengx.mo@intel.com>
---
 tests/l3fwd_base.py | 26 ++++++++++++++++++++++++++
 1 file changed, 26 insertions(+)

diff --git a/tests/l3fwd_base.py b/tests/l3fwd_base.py
index 3fbf71f..0e51418 100644
--- a/tests/l3fwd_base.py
+++ b/tests/l3fwd_base.py
@@ -63,6 +63,7 @@ class L3fwdBase(object):
 
     def l3fwd_init(self, valports, socket):
         self.__valports = valports
+        self.__white_list = None
         self.__socket = socket
         self.__nic_name = self.nic
         self.__pkt_typ = 'udp'
@@ -384,6 +385,7 @@ class L3fwdBase(object):
             "{bin} "
             "-c {cores} "
             "-n {channel} "
+            "{whitelist}"
             "-- "
             "-p {port_mask} "
             "--config '{config}'"
@@ -391,6 +393,7 @@ class L3fwdBase(object):
                 'bin': bin,
                 'cores': core_mask,
                 'channel': self.dut.get_memory_channels(),
+                'whitelist': self.__white_list if self.__white_list else '',
                 'port_mask': utils.create_mask(self.__valports),
                 'config': config, })
         if self.nic == "niantic":
@@ -701,7 +704,30 @@ class L3fwdBase(object):
 
         return test_content
 
+    def __get_whitelist(self, port_list):
+        white_list = ''
+        for port_index in port_list:
+            pci = self.dut.ports_info[port_index].get('pci')
+            if not pci:
+                continue
+            white_list += '-w {} '.format(pci)
+        return white_list
+    
+    def __preset_port_list(self, test_content):
+        port_list = test_content.get('port_list')
+        if port_list:
+            if not set(port_list).issubset(set(self.__valports)):
+                msg = 'total ports are {}, select ports are wrong'.format(pformat(self.__valports))
+                raise VerifyFailure(msg)
+            else:
+                msg = 'current using {} for testing'.format(pformat(port_list))
+                self.logger.warning(msg)
+            self.__valports = port_list
+            self.__white_list = self.__get_whitelist(port_list)
+
     def l3fwd_preset_test_environment(self, test_content):
+        # if user set port list in cfg file, use
+        self.__preset_port_list(test_content)
         # get test content
         self.__test_content = self.__get_test_content_from_cfg(test_content)
         # binary process flag
-- 
2.21.0


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

* Re: [dts] [PATCH V1 0/2] l3fwd: support set test ports in cfg file
  2020-01-17  2:29 [dts] [PATCH V1 0/2] l3fwd: support set test ports in cfg file yufengmx
  2020-01-17  2:29 ` [dts] [PATCH V1 1/2] conf/l3fwd: " yufengmx
  2020-01-17  2:29 ` [dts] [PATCH V1 2/2] tests/l3fwd: " yufengmx
@ 2020-01-17  3:12 ` " Mo, YufengX
  2 siblings, 0 replies; 4+ messages in thread
From: Mo, YufengX @ 2020-01-17  3:12 UTC (permalink / raw)
  To: dts, Tu, Lijuan

cancel this series.


> -----Original Message-----
> From: Mo, YufengX
> Sent: Friday, January 17, 2020 10:30 AM
> To: dts@dpdk.org; Tu, Lijuan <lijuan.tu@intel.com>
> Cc: Mo, YufengX <yufengx.mo@intel.com>
> Subject: [dts][PATCH V1 0/2] l3fwd: support set test ports in cfg file
> 
> add a key to select custom dut ports to run testing. If not set this key in cfg file,
> use default dut port list of dts framework.
> 
> yufengmx (2):
>   conf/l3fwd: support set test ports in cfg file
>   tests/l3fwd: support set test ports in cfg file
> 
>  conf/l3fwd.cfg      |  4 ++++
>  tests/l3fwd_base.py | 26 ++++++++++++++++++++++++++
>  2 files changed, 30 insertions(+)
> 
> --
> 2.21.0


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

end of thread, back to index

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-01-17  2:29 [dts] [PATCH V1 0/2] l3fwd: support set test ports in cfg file yufengmx
2020-01-17  2:29 ` [dts] [PATCH V1 1/2] conf/l3fwd: " yufengmx
2020-01-17  2:29 ` [dts] [PATCH V1 2/2] tests/l3fwd: " yufengmx
2020-01-17  3:12 ` [dts] [PATCH V1 0/2] l3fwd: " Mo, YufengX

test suite reviews and discussions

Archives are clonable:
	git clone --mirror http://inbox.dpdk.org/dts/0 dts/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 dts dts/ http://inbox.dpdk.org/dts \
		dts@dpdk.org
	public-inbox-index dts


Newsgroup available over NNTP:
	nntp://inbox.dpdk.org/inbox.dpdk.dts


AGPL code for this site: git clone https://public-inbox.org/ public-inbox