From: Marvin Liu <yong.liu@intel.com>
To: dts@dpdk.org
Cc: Marvin Liu <yong.liu@intel.com>
Subject: [dts] [PATCH v1 1/3] framework/project_dpdk: add new arguments in setup_modules function
Date: Thu, 8 Mar 2018 01:06:06 +0800 [thread overview]
Message-ID: <1520442368-77344-1-git-send-email-yong.liu@intel.com> (raw)
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
next reply other threads:[~2018-03-07 9:16 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-03-07 17:06 Marvin Liu [this message]
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
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=1520442368-77344-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).