test suite reviews and discussions
 help / color / mirror / Atom feed
From: Ding Heng <hengx.ding@intel.com>
To: dts@dpdk.org
Cc: Ding Heng <hengx.ding@intel.com>
Subject: [dts] [PATCH] dut.py: sort port list to ensure RRC nics will be configured correctly
Date: Tue, 12 Apr 2016 09:38:01 +0800	[thread overview]
Message-ID: <1460425081-7185-1-git-send-email-hengx.ding@intel.com> (raw)

Signed-off-by: Ding Heng <hengx.ding@intel.com>

diff --git a/framework/dut.py b/framework/dut.py
index bd437cb..291fef0 100644
--- a/framework/dut.py
+++ b/framework/dut.py
@@ -627,6 +627,20 @@ class Dut(Crb):
         """
         Scan ports information or just read it from cache file.
         """
+        #sort ports and ensure that first port of RRC nics will be
+        #initialized first
+        sorted_ports = []
+        ports_cfg = self.conf.get_ports_config()
+        for port_cfg_all in ports_cfg.keys():
+            if 'tp_path' in ports_cfg[port_cfg_all].keys():
+                for port in self.pci_devices_info:
+                    sorted_port = [port]
+                    if port_cfg_all in port:
+                        self.pci_devices_info.remove(port)
+                        for i in self.pci_devices_info:
+                            sorted_port.append(i)
+        self.pci_devices_info = sorted_port
+
         if self.read_cache:
             self.load_serializer_ports()
             self.scan_ports_cached()
-- 
1.9.3

             reply	other threads:[~2016-04-12  1:38 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-12  1:38 Ding Heng [this message]
2016-04-12  3:41 ` Liu, Yong

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=1460425081-7185-1-git-send-email-hengx.ding@intel.com \
    --to=hengx.ding@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).