[V2] tests/vf_single_core_perf: support IO forwarding mode

Message ID 20230525053637.23947-1-yingyax.han@intel.com (mailing list archive)
State Accepted
Headers
Series [V2] tests/vf_single_core_perf: support IO forwarding mode |

Checks

Context Check Description
ci/Intel-dts-format-test success Testing OK
ci/Intel-dts-pylama-test success Testing OK
ci/Intel-dts-suite-test warning SKIPPED

Commit Message

Yingya Han May 25, 2023, 5:36 a.m. UTC
  Signed-off-by: Yingya Han <yingyax.han@intel.com>
---
 conf/vf_single_core_perf.cfg           |  4 ++++
 tests/TestSuite_vf_single_core_perf.py | 11 ++++++++---
 2 files changed, 12 insertions(+), 3 deletions(-)
  

Comments

Tu, Lijuan June 7, 2023, 5:50 a.m. UTC | #1
On Thu, 25 May 2023 05:36:37 +0000, Yingya Han <yingyax.han@intel.com> wrote:
> Signed-off-by: Yingya Han <yingyax.han@intel.com>


Applied, thanks
  

Patch

diff --git a/conf/vf_single_core_perf.cfg b/conf/vf_single_core_perf.cfg
index b0546f48..ccdde983 100644
--- a/conf/vf_single_core_perf.cfg
+++ b/conf/vf_single_core_perf.cfg
@@ -8,6 +8,9 @@ 
 #  - test_duration is how many seconds each combination performance will
 #  be recorded.
 #
+#  - forwarding_mode:
+#	testpmd set the packet forwarding mode, support 'io'/'mac'
+#
 #  - accepted_tolerance defines the accepted tolerance between test
 # results and expected numbers.
 #
@@ -33,6 +36,7 @@  update_expected = True
 test_parameters = {'1C/1T': {64: [512, 2048]},
                    '1C/2T': {64: [512, 2048]}}
 test_duration = 60
+forwarding_mode = 'io'
 accepted_tolerance = 1
 expected_throughput = {
     'I40E_40G-QSFP_A': {
diff --git a/tests/TestSuite_vf_single_core_perf.py b/tests/TestSuite_vf_single_core_perf.py
index 7101e4b9..85bd0d46 100644
--- a/tests/TestSuite_vf_single_core_perf.py
+++ b/tests/TestSuite_vf_single_core_perf.py
@@ -56,6 +56,7 @@  class TestVfSingleCorePerf(TestCase):
         """
         # test parameters include: frames size, descriptor numbers
         self.test_parameters = self.get_suite_cfg()["test_parameters"]
+        self.forwarding_mode = self.get_suite_cfg()["forwarding_mode"]
 
         # traffic duraion in second
         self.test_duration = self.get_suite_cfg()["test_duration"]
@@ -99,6 +100,9 @@  class TestVfSingleCorePerf(TestCase):
             self.dut.send_expect(
                 "ip link set %s vf 0 mac %s" % (pf_intf, self.vfs_mac[i]), "#"
             )
+            if self.forwarding_mode == "io":
+                self.dut.send_expect("ip link set %s vf 0 trust on" % pf_intf, "#")
+                self.dut.send_expect("ip link set %s vf 0 spoofchk off" % pf_intf, "#")
 
         # bind vf to vf driver
         try:
@@ -223,10 +227,10 @@  class TestVfSingleCorePerf(TestCase):
         for i in range(port_num):
             eal_para += " -a " + self.sriov_vfs_port[i][0].pci
         port_mask = utils.create_mask(self.dut_ports)
-        # parameters for application/testpmd
-        param = " --portmask=%s" % (port_mask)
 
         for fwd_config in list(self.test_parameters.keys()):
+            # parameters for application/testpmd
+            param = " --portmask=%s" % (port_mask)
             # the fwd_config just the config for fwd core
             # to start testpmd should add 1C to it
             core_config = "1S/%s" % fwd_config
@@ -279,7 +283,8 @@  class TestVfSingleCorePerf(TestCase):
                     self.pmdout.start_testpmd(
                         core_list, parameter, eal_para, socket=self.socket
                     )
-                    self.dut.send_expect("set fwd mac", "testpmd> ", 15)
+                    if self.forwarding_mode == "mac":
+                        self.dut.send_expect("set fwd mac", "testpmd> ", 15)
                     self.dut.send_expect("start", "testpmd> ", 15)
 
                     vm_config = self.set_fields()