test suite reviews and discussions
 help / color / mirror / Atom feed
* [dts] [PATCH v1 1/3] framework/project_dpdk: add new arguments in setup_modules function
@ 2018-03-07 17:06 Marvin Liu
  2018-03-07 17:06 ` [dts] [PATCH v1 2/3] framework/virt_base: add default kernel driver option Marvin Liu
  2018-03-07 17:06 ` [dts] [PATCH v1 3/3] framework/virt_dut: setup configured kernel module Marvin Liu
  0 siblings, 2 replies; 3+ messages in thread
From: Marvin Liu @ 2018-03-07 17:06 UTC (permalink / raw)
  To: dts; +Cc: Marvin Liu

Add driver name and driver mode arguments in setup_modules function.
For DUT, these two agruments should be stripped from execution file.

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

diff --git a/framework/project_dpdk.py b/framework/project_dpdk.py
index 40c862a..f87fd13 100644
--- a/framework/project_dpdk.py
+++ b/framework/project_dpdk.py
@@ -79,21 +79,23 @@ class DPDKdut(Dut):
             self.build_install_dpdk(target)
 
         self.setup_memory()
-        self.setup_modules(target)
+
+        drivername = load_global_setting(HOST_DRIVER_SETTING)
+        drivermode = load_global_setting(HOST_DRIVER_MODE_SETTING)
+        self.setup_modules(target, drivername, drivermode)
 
         if bind_dev and self.get_os_type() == 'linux':
             self.bind_interfaces_linux(drivername)
         self.extra_nic_setup()
 
-    def setup_modules(self, target):
+    def setup_modules(self, target, drivername, drivermode):
         """
         Install DPDK required kernel module on DUT.
         """
         setup_modules = getattr(self, 'setup_modules_%s' % self.get_os_type())
-        setup_modules(target)
+        setup_modules(target, drivername, drivermode)
 
-    def setup_modules_linux(self, target):
-        drivername = load_global_setting(HOST_DRIVER_SETTING)
+    def setup_modules_linux(self, target, drivername, drivermode):
         if drivername == "vfio-pci":
             self.send_expect("rmmod vfio_pci", "#", 70)
             self.send_expect("rmmod vfio_iommu_type1", "#", 70)
@@ -103,7 +105,6 @@ class DPDKdut(Dut):
             out = self.send_expect("lsmod | grep vfio_iommu_type1", "#")
             assert ("vfio_iommu_type1" in out), "Failed to setup vfio-pci"
 
-            drivermode = load_global_setting(HOST_DRIVER_MODE_SETTING)
             if drivermode == "noiommu":
                 self.send_expect("echo 1 > /sys/module/vfio/parameters/enable_unsafe_noiommu_mode", "#", 70)
 
@@ -113,7 +114,7 @@ class DPDKdut(Dut):
             out = self.send_expect("lsmod | grep uio_pci_generic", "#")
             assert ("uio_pci_generic" in out), "Failed to setup uio_pci_generic"
  
-        else:
+        elif drivername == "igb_uio":
             self.send_expect("modprobe uio", "#", 70)
             out = self.send_expect("lsmod | grep igb_uio", "#")
             if "igb_uio" in out:
@@ -123,7 +124,7 @@ class DPDKdut(Dut):
             out = self.send_expect("lsmod | grep igb_uio", "#")
             assert ("igb_uio" in out), "Failed to insmod igb_uio"
 
-    def setup_modules_freebsd(self, target):
+    def setup_modules_freebsd(self, target, drivername, drivermode):
         """
         Install DPDK required Freebsd kernel module on DUT.
         """
-- 
1.9.3

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

end of thread, other threads:[~2018-03-07  9:16 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-03-07 17:06 [dts] [PATCH v1 1/3] framework/project_dpdk: add new arguments in setup_modules function Marvin Liu
2018-03-07 17:06 ` [dts] [PATCH v1 2/3] framework/virt_base: add default kernel driver option Marvin Liu
2018-03-07 17:06 ` [dts] [PATCH v1 3/3] framework/virt_dut: setup configured kernel module Marvin Liu

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).