test suite reviews and discussions
 help / color / mirror / Atom feed
From: yufengmx <yufengx.mo@intel.com>
To: dts@dpdk.org
Cc: yufengmx <yufengx.mo@intel.com>
Subject: [dts] [PATCH V1 3/4] [next]framework/dut: add check condition for trex port
Date: Mon, 29 Jul 2019 09:48:40 +0800	[thread overview]
Message-ID: <1564364921-33333-4-git-send-email-yufengx.mo@intel.com> (raw)
In-Reply-To: <1564364921-33333-1-git-send-email-yufengx.mo@intel.com>

 mapping

add check condition for trex port mapping and fix indentation issue.

Signed-off-by: yufengmx <yufengx.mo@intel.com>
---
 framework/dut.py | 59 ++++++++++++++++++++++++++++++--------------------------
 1 file changed, 32 insertions(+), 27 deletions(-)

diff --git a/framework/dut.py b/framework/dut.py
index cc36f72..48a5326 100644
--- a/framework/dut.py
+++ b/framework/dut.py
@@ -937,7 +937,12 @@ class Dut(Crb):
             dutpci = self.ports_info[dutPort]['pci']
             if peer is not None:
                 for remotePort in range(len(self.tester.ports_info)):
-                    if self.tester.ports_info[remotePort]['pci'].lower() == peer.lower():
+                    if self.tester.ports_info[remotePort]['type'].lower() == 'trex':
+                        if self.tester.ports_info[remotePort]['intf'].lower() == peer.lower():
+                            hits[remotePort] = True
+                            self.ports_map[dutPort] = remotePort
+                            break
+                    elif self.tester.ports_info[remotePort]['pci'].lower() == peer.lower():
                         hits[remotePort] = True
                         self.ports_map[dutPort] = remotePort
                         break
@@ -959,34 +964,34 @@ class Dut(Crb):
                 ipv6 = self.get_ipv6_address(dutPort)
                 if ipv6 == "Not connected":
                     if self.tester.ports_info[remotePort].has_key('ipv4'):
-			out = self.tester.send_ping(
-				dutPort, self.tester.ports_info[remotePort]['ipv4'],
-				self.get_mac_address(dutPort))
-		    else:
-                    	continue
-		else:
+                        out = self.tester.send_ping(
+                            dutPort, self.tester.ports_info[remotePort]['ipv4'],
+                            self.get_mac_address(dutPort))
+                    else:
+                        continue
+                else:
                     if getattr(self, 'send_ping6', None):
-                    	out = self.send_ping6(
-                        	dutPort, self.tester.ports_info[remotePort]['ipv6'],
-                        	self.get_mac_address(dutPort))
+                        out = self.send_ping6(
+                            dutPort, self.tester.ports_info[remotePort]['ipv6'],
+                            self.get_mac_address(dutPort))
                     else:
-                    	out = self.tester.send_ping6(
-				remotePort, ipv6, self.get_mac_address(dutPort))
-
-                if ('64 bytes from' in out):
-                    self.logger.info("PORT MAP: [dut %d: tester %d]" % (dutPort, remotePort))
-                    self.ports_map[dutPort] = remotePort
-                    hits[remotePort] = True
-                    if self.crb['IP'] == self.crb['tester IP']:
-                        # remove dut port act as tester port
-                        remove_port = self.get_port_info(remotepci)
-                        if remove_port is not None:
-                            remove.append(remove_port)
-                        # skip ping from those port already act as dut port
-                        testerPort = self.tester.get_local_index(dutpci)
-                        if testerPort != -1:
-                            hits[testerPort] = True
-                    break
+                        out = self.tester.send_ping6(
+                            remotePort, ipv6, self.get_mac_address(dutPort))
+
+                    if ('64 bytes from' in out):
+                        self.logger.info("PORT MAP: [dut %d: tester %d]" % (dutPort, remotePort))
+                        self.ports_map[dutPort] = remotePort
+                        hits[remotePort] = True
+                        if self.crb['IP'] == self.crb['tester IP']:
+                            # remove dut port act as tester port
+                            remove_port = self.get_port_info(remotepci)
+                            if remove_port is not None:
+                                remove.append(remove_port)
+                            # skip ping from those port already act as dut port
+                            testerPort = self.tester.get_local_index(dutpci)
+                            if testerPort != -1:
+                                hits[testerPort] = True
+                        break
 
         for port in remove:
             self.ports_info.remove(port)
-- 
1.9.3


  parent reply	other threads:[~2019-07-29  1:47 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-29  1:48 [dts] [PATCH V1 0/4] dts: update suite nic_single_core_perf and ports config yufengmx
2019-07-29  1:48 ` [dts] [PATCH V1 1/4] [next]config/nic_single_core_perf: fix file format issue yufengmx
2019-07-29  1:48 ` [dts] [PATCH V1 2/4] [next]config/ports: add trex format comment yufengmx
2019-08-08  5:41   ` Tu, Lijuan
2019-07-29  1:48 ` yufengmx [this message]
2019-08-08  5:41   ` [dts] [PATCH V1 3/4] [next]framework/dut: add check condition for trex port Tu, Lijuan
2019-07-29  1:48 ` [dts] [PATCH V1 4/4] [next]tests/nic_single_core_perf: update script yufengmx
2019-08-08  5:41   ` 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=1564364921-33333-4-git-send-email-yufengx.mo@intel.com \
    --to=yufengx.mo@intel.com \
    --cc=dts@dpdk.org \
    /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).