test suite reviews and discussions
 help / color / mirror / Atom feed
* [dts][PATCH V1]tests/vf_single_core_perf: support IO forwarding mode
@ 2023-05-18  2:37 Yingya Han
  0 siblings, 0 replies; only message in thread
From: Yingya Han @ 2023-05-18  2:37 UTC (permalink / raw)
  To: dts; +Cc: Yingya Han

Signed-off-by: Yingya Han <yingyax.han@intel.com>
---
 conf/vf_single_core_perf.cfg           |  4 ++++
 tests/TestSuite_vf_single_core_perf.py | 15 ++++++++++++---
 2 files changed, 16 insertions(+), 3 deletions(-)

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..de68f334 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,13 @@ 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 +231,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 +287,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()
-- 
2.34.1


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2023-05-18  2:37 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-05-18  2:37 [dts][PATCH V1]tests/vf_single_core_perf: support IO forwarding mode Yingya Han

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