test suite reviews and discussions
 help / color / mirror / Atom feed
From: Lijuan Tu <lijuan.tu@intel.com>
To: dts@dpdk.org
Cc: Lijuan Tu <lijuan.tu@intel.com>
Subject: [dts]  [PATCH] tests/vf_l3fwd: fix mapping of pf and vf driver.
Date: Wed, 19 Feb 2020 00:14:04 +0800	[thread overview]
Message-ID: <1582042444-25234-1-git-send-email-lijuan.tu@intel.com> (raw)

* pf: kernel driver, vf: vfio-pci
* pf: kernel driver, vf: igb_uio
* pf: igb_uio, vf: igb_uio

Signed-off-by: Lijuan Tu <lijuan.tu@intel.com>
---
 tests/TestSuite_vf_l3fwd.py | 29 ++++++++++++++++++-----------
 1 file changed, 18 insertions(+), 11 deletions(-)

diff --git a/tests/TestSuite_vf_l3fwd.py b/tests/TestSuite_vf_l3fwd.py
index 760b920..a2e872d 100644
--- a/tests/TestSuite_vf_l3fwd.py
+++ b/tests/TestSuite_vf_l3fwd.py
@@ -107,27 +107,26 @@ class TestVfL3fwd(TestCase):
         """
         self.setup_vf_env_flag = 0
 
-    def setup_vf_env(self, host_driver='default'):
+    def setup_vf_env(self, host_driver='default', vf_driver='vfio-pci'):
         """
         require enough PF ports,using kernel or dpdk driver, create 1 VF from each PF.
         """
+        if host_driver != "default" and host_driver != "igb_uio":
+            self.logger.error("only support kernel driver and igb_uio!")
         self.used_dut_port = [port for port in self.dut_ports]
         self.sriov_vfs_port = []
         for i in valports:
-            if host_driver != '':
-                self.dut.generate_sriov_vfs_by_port(self.used_dut_port[i], 1)
-            else:
-                self.dut.generate_sriov_vfs_by_port(self.used_dut_port[i], 1, host_driver)
+            self.dut.generate_sriov_vfs_by_port(self.used_dut_port[i], 1, host_driver)
             sriov_vfs_port = self.dut.ports_info[self.used_dut_port[i]]['vfs_port']
             self.sriov_vfs_port.append(sriov_vfs_port)
         # bind vf to vf driver
         try:
             for i in valports:
                 for port in self.sriov_vfs_port[i]:
-                    port.bind_driver(self.vf_driver)
+                    port.bind_driver(vf_driver)
             time.sleep(1)
             # set vf mac address.
-            if host_driver == '':
+            if host_driver == 'default':
                 for i in valports:
                     pf_intf = self.dut.ports_info[i]['port'].get_interface_name()
                     self.dut.send_expect("ip link set %s vf 0 mac %s" % (pf_intf, self.vfs_mac[i]), "#")
@@ -260,11 +259,11 @@ class TestVfL3fwd(TestCase):
         self.dut.close_session(l3fwd_session)
         self.result_table_print()
 
-    def measure_vf_performance(self, host_driver='default'):
+    def measure_vf_performance(self, host_driver='default', vf_driver='vfio-pci'):
         """
         start l3fwd and run the perf test
         """
-        self.setup_vf_env(host_driver)
+        self.setup_vf_env(host_driver, vf_driver)
         eal_param = ""
         for i in valports:
             eal_param += " -w " + self.sriov_vfs_port[i][0].pci
@@ -286,12 +285,20 @@ class TestVfL3fwd(TestCase):
         self.perf_test(cmdline)
 
     def test_perf_kernel_pf_dpdk_vf_perf_host_only(self):
+        if self.vf_driver == "igb_uio" or self.vf_driver == "vfio-pci":
+            vf_driver = self.vf_driver
+        elif self.drivername == "igb_uio" or self.drivername == "vfio-pci":
+            vf_driver = self.drivername
+        else:
+            vf_driver = "vfio-pci"
 
-        self.measure_vf_performance(host_driver='')
+        self.measure_vf_performance(host_driver='default', vf_driver=vf_driver)
 
     def test_perf_dpdk_pf_dpdk_vf_perf_host_only(self):
+        if self.drivername != "igb_uio":
+            self.logger.warning("Use igb_uio as host driver for testing instead of %s" % self.drivername)
 
-        self.measure_vf_performance(host_driver=self.vf_driver)
+        self.measure_vf_performance(host_driver='igb_uio', vf_driver='igb_uio')
 
     def set_fields(self):
         """
-- 
1.8.3.1


                 reply	other threads:[~2020-02-18  8:05 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=1582042444-25234-1-git-send-email-lijuan.tu@intel.com \
    --to=lijuan.tu@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).