From: Yuwei Zhang <yuwei1.zhang@intel.com>
To: dts@dpdk.org
Cc: Yuwei Zhang <yuwei1.zhang@intel.com>
Subject: [dts] [PATCH V1] add vfio-pci assign method to vf_packet_rxtx test suite
Date: Thu, 21 Sep 2017 22:50:36 +0800 [thread overview]
Message-ID: <20170921145036.1320-1-yuwei1.zhang@intel.com> (raw)
Signed-off-by: Yuwei Zhang <yuwei1.zhang@intel.com>
---
conf/vf_packet_rxtx.cfg | 5 +++++
tests/TestSuite_vf_packet_rxtx.py | 21 +++++++++++++++++----
2 files changed, 22 insertions(+), 4 deletions(-)
diff --git a/conf/vf_packet_rxtx.cfg b/conf/vf_packet_rxtx.cfg
index 20db90c..6eb9c40 100644
--- a/conf/vf_packet_rxtx.cfg
+++ b/conf/vf_packet_rxtx.cfg
@@ -122,3 +122,8 @@ vnc =
displayNum=2;
daemon =
enable=yes;
+
+# suite conf
+# vf_assign_method only support vfio-pci and pci-assign method for now
+[suite]
+vf_assign_method=
\ No newline at end of file
diff --git a/tests/TestSuite_vf_packet_rxtx.py b/tests/TestSuite_vf_packet_rxtx.py
index 50451f6..d88506d 100644
--- a/tests/TestSuite_vf_packet_rxtx.py
+++ b/tests/TestSuite_vf_packet_rxtx.py
@@ -19,6 +19,19 @@ class TestVfPacketRxtx(TestCase):
self.vm0 = None
self.vm1 = None
+ suite_conf = SuiteConf('vf_packet_rxtx')
+ self.vf_assign_method = suite_conf.load_case_config()['vf_assign_method']
+ if self.vf_assign_method.strip() == '':
+ self.vf_assign_method = 'pci-assign'
+ self.verify(self.vf_assign_method in ['pci-assign', 'vfio-pci'],
+ "not supported vf assign method")
+ if self.vf_assign_method == 'vfio-pci':
+ self.dut.send_expect('modprobe vfio', '#')
+ self.dut.send_expect('modprobe vfio-pci', '#')
+ self.vf_driver = 'vfio-pci'
+ else:
+ self.vf_driver = 'pci-stub'
+
def set_up(self):
self.setup_2pf_2vf_1vm_env_flag = 0
@@ -37,10 +50,10 @@ class TestVfPacketRxtx(TestCase):
try:
for port in self.sriov_vfs_port_0:
- port.bind_driver('pci-stub')
+ port.bind_driver(self.vf_driver)
for port in self.sriov_vfs_port_1:
- port.bind_driver('pci-stub')
+ port.bind_driver(self.vf_driver)
time.sleep(1)
vf0_prop = {'opt_host': self.sriov_vfs_port_0[0].pci}
@@ -59,8 +72,8 @@ class TestVfPacketRxtx(TestCase):
# set up VM0 ENV
self.vm0 = QEMUKvm(self.dut, 'vm0', 'vf_packet_rxtx')
- self.vm0.set_vm_device(driver='pci-assign', **vf0_prop)
- self.vm0.set_vm_device(driver='pci-assign', **vf1_prop)
+ self.vm0.set_vm_device(driver=self.vf_assign_method, **vf0_prop)
+ self.vm0.set_vm_device(driver=self.vf_assign_method, **vf1_prop)
self.vm_dut_0 = self.vm0.start()
if self.vm_dut_0 is None:
raise Exception("Set up VM0 ENV failed!")
--
2.14.1.windows.1
reply other threads:[~2017-09-21 14:50 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20170921145036.1320-1-yuwei1.zhang@intel.com \
--to=yuwei1.zhang@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).