test suite reviews and discussions
 help / color / mirror / Atom feed
From: yufengmx <yufengx.mo@intel.com>
To: dts@dpdk.org, lihongx.ma@intel.com, zhaoyan.chen@intel.com
Cc: yufengmx <yufengx.mo@intel.com>
Subject: [dts] [PATCH V1 1/1] framework/pktgen: add tester port mapping
Date: Tue, 25 Feb 2020 15:43:07 +0800	[thread overview]
Message-ID: <20200225074307.17136-2-yufengx.mo@intel.com> (raw)
In-Reply-To: <20200225074307.17136-1-yufengx.mo@intel.com>


Since tester port scanning work flow change, non-functional port mapping config will be ignored.
Add tester port mapping if no port in ports info.

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

diff --git a/framework/tester.py b/framework/tester.py
index a858081..6e92847 100644
--- a/framework/tester.py
+++ b/framework/tester.py
@@ -366,6 +366,7 @@ class Tester(Crb):
         ''' packet generator port setting 
         Currently, trex run on tester node
         '''
+        new_ports_info = []
         pktgen_ports_info = self.pktgen.get_ports()
         for pktgen_port_info in pktgen_ports_info:
             pktgen_port_type = pktgen_port_info['type']
@@ -383,6 +384,22 @@ class Tester(Crb):
                 port_info['type'] = pktgen_port_type
                 port_info['mac'] = pktgen_mac
                 break
+            # Since tester port scanning work flow change, non-functional port 
+            # mapping config will be ignored. Add tester port mapping if no
+            # port in ports info 
+            else:
+                addr_array = pktgen_pci.split(':')
+                port = GetNicObj(self, addr_array[0], addr_array[1], addr_array[2])
+                new_ports_info.append({
+                    'port': port,
+                    'intf': pktgen_port_name,
+                    'type': pktgen_port_type,
+                    'pci': pktgen_pci,
+                    'mac': pktgen_mac,
+                    'ipv4': None,
+                    'ipv6': None })
+        if new_ports_info:
+            self.ports_info = self.ports_info + new_ports_info
 
     def scan_ports(self):
         """
-- 
2.21.0


  reply	other threads:[~2020-02-25  7:39 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-25  7:43 [dts] [PATCH V1 0/1] " yufengmx
2020-02-25  7:43 ` yufengmx [this message]
2020-02-25  9:07   ` [dts] [PATCH V1 1/1] " Tu, Lijuan

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=20200225074307.17136-2-yufengx.mo@intel.com \
    --to=yufengx.mo@intel.com \
    --cc=dts@dpdk.org \
    --cc=lihongx.ma@intel.com \
    --cc=zhaoyan.chen@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).