test suite reviews and discussions
 help / color / mirror / Atom feed
From: Yong Liu <yong.liu@intel.com>
To: dts@dpdk.org
Subject: [dts] [PATCH 1/3] framework dut: add port stop when execution exit
Date: Wed, 20 Jan 2016 09:47:41 +0800	[thread overview]
Message-ID: <1453254463-11436-1-git-send-email-yong.liu@intel.com> (raw)

Some nic like RRC required additional setup like testpoint start-up. So
when execution done, need call additional stop function.

Signed-off-by: Marvin Liu <yong.liu@intel.com>

diff --git a/framework/dts.py b/framework/dts.py
index 2dd511b..1e60a01 100644
--- a/framework/dts.py
+++ b/framework/dts.py
@@ -341,6 +341,7 @@ def dts_run_target(crbInst, targets, test_suites, nic, scenario):
         scene.destroy_scene()
         scene = None
 
+    dut.stop_ports()
     dut.restore_interfaces()
     tester.restore_interfaces()
 
diff --git a/framework/dut.py b/framework/dut.py
index 178c35f..afb5204 100644
--- a/framework/dut.py
+++ b/framework/dut.py
@@ -225,6 +225,23 @@ class Dut(Crb):
         self.send_expect("kldunload contigmem.ko", "#")
         self.send_expect("kldload if_ixgbe.ko", "#", 20)
 
+    def stop_ports(self):
+        """
+        After all execution done, some special nic like fm10k should be stop
+        """
+        for port in self.ports_info:
+            pci_bus = port['pci']
+            pci_id = port['type']
+            # get device driver
+            driver = settings.get_nic_driver(pci_id)
+            if driver is not None:
+                # unbind device driver
+                addr_array = pci_bus.split(':')
+                bus_id = addr_array[0]
+                devfun_id = addr_array[1]
+                port = GetNicObj(self, bus_id, devfun_id)
+                port.stop()
+
     def restore_interfaces_linux(self):
         """
         Restore Linux interfaces.
@@ -824,7 +841,7 @@ 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'] == peer:
+                    if self.tester.ports_info[remotePort]['pci'].lower() == peer.lower():
                         hits[remotePort] = True
                         self.ports_map[dutPort] = remotePort
                         break
diff --git a/nics/net_device.py b/nics/net_device.py
index 2b0517b..c3b3755 100644
--- a/nics/net_device.py
+++ b/nics/net_device.py
@@ -64,6 +64,9 @@ class NetDevice(object):
         self.get_interface_name()
         self.socket = self.get_nic_socket()
 
+    def stop(self):
+        pass
+
     def close(self):
         pass
 
-- 
2.4.3

             reply	other threads:[~2016-01-20  1:47 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-20  1:47 Yong Liu [this message]
2016-01-20  1:47 ` [dts] [PATCH 2/3] framework packet: support strip packet payload Yong Liu
2016-01-20  1:47 ` [dts] [PATCH 3/3] nics fm10k: support optimize rule and vlan/jumbo setting Yong Liu

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=1453254463-11436-1-git-send-email-yong.liu@intel.com \
    --to=yong.liu@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).