test suite reviews and discussions
 help / color / mirror / Atom feed
* [dts] [PATCH V3] smoke test support config different queue
@ 2021-10-26 17:19 Lewei Yang
  0 siblings, 0 replies; only message in thread
From: Lewei Yang @ 2021-10-26 17:19 UTC (permalink / raw)
  To: dts; +Cc: Qin Sun, Lewei Yang

From: Qin Sun <qinx.sun@intel.com>

smoke test support config different queue

Signed-off-by: Lewei Yang <leweix.yang@intel.com>
---
 test_plans/pf_smoke_test_plan.rst | 20 +++++++++--
 test_plans/vf_smoke_test_plan.rst | 17 ++++++++--
 tests/TestSuite_pf_smoke.py       |  2 +-
 tests/TestSuite_vf_smoke.py       |  4 +--
 tests/smoke_base.py               | 56 ++++++++++++++++++++-----------
 5 files changed, 71 insertions(+), 28 deletions(-)

diff --git a/test_plans/pf_smoke_test_plan.rst b/test_plans/pf_smoke_test_plan.rst
index 2b6c6128..d94fb5a0 100644
--- a/test_plans/pf_smoke_test_plan.rst
+++ b/test_plans/pf_smoke_test_plan.rst
@@ -150,14 +150,28 @@ Test Case 3: test reset RX/TX queues
 ====================================================
 1. Run ``port stop all`` to stop all ports.
 
-2. Run ``port config all rxq 2`` to change the number of receiving queues to two.
+2. Run ``port config all rxq 16`` to change the number of receiving queues to 16.
 
-3. Run ``port config all txq 2`` to change the number of transmitting queues to two.
+3. Run ``port config all txq 16`` to change the number of transmitting queues to 16.
+.. note:According to DPDK code limitation: drivers/net/igc/igc_ethdev.c:1495: dev_info->max_rx_queues = IGC_QUEUE_PAIRS_NUM;
+      Intel Corporation Device 15f2 NIC does not support change rxq/txq value greater than max_rx/tx_queue.
+      So foxville  config txq and rxq to 2.
 
 4. Run ``port start all`` to restart all ports.
 
 5. Check with ``show config rxtx`` that the configuration for these parameters changed.
 
-6. Run ``start`` again to restart the forwarding, then start packet generator to transmit
+6. Run ``start`` again to restart the forwarding, then Send different hash types' packets
+   with different keywords, then check rx port could receive packets by different queues.
+
+7. Run ``port stop all`` to stop all ports.
+
+8. Run ``port config 0 rx_offload rss_hash off`` to stop rss_hash
+
+9. Run ``port config all rxq 1`` to change the number of receiving queues to 1.
+
+10. Run ``port config all txq 1`` to change the number of transmitting queues to 1.
+
+11. Run ``start`` again to restart the forwarding, then start packet generator to transmit
    and receive packets, and check if testpmd is able to receive and forward packets
    successfully.
diff --git a/test_plans/vf_smoke_test_plan.rst b/test_plans/vf_smoke_test_plan.rst
index 650f759c..5c45a652 100644
--- a/test_plans/vf_smoke_test_plan.rst
+++ b/test_plans/vf_smoke_test_plan.rst
@@ -163,14 +163,25 @@ Test Case 3: test reset RX/TX queues
 ====================================================
 1. Run ``port stop all`` to stop all ports.
 
-2. Run ``port config all rxq 2`` to change the number of receiving queues to two.
+2. Run ``port config all rxq 16`` to change the number of receiving queues to 16.
 
-3. Run ``port config all txq 2`` to change the number of transmitting queues to two.
+3. Run ``port config all txq 16`` to change the number of transmitting queues to 16.
 
 4. Run ``port start all`` to restart all ports.
 
 5. Check with ``show config rxtx`` that the configuration for these parameters changed.
 
-6. Run ``start`` again to restart the forwarding, then start packet generator to transmit
+6. Run ``start`` again to restart the forwarding, then Send different hash types' packets
+   with different keywords, then check rx port could receive packets by different queues.
+
+7. Run ``port stop all`` to stop all ports.
+
+8. Run ``port config 0 rx_offload rss_hash off`` to stop rss_hash
+
+9. Run ``port config all rxq 1`` to change the number of receiving queues to 1.
+
+10. Run ``port config all txq 1`` to change the number of transmitting queues to 1.
+
+11. Run ``start`` again to restart the forwarding, then start packet generator to transmit
    and receive packets, and check if testpmd is able to receive and forward packets
    successfully.
diff --git a/tests/TestSuite_pf_smoke.py b/tests/TestSuite_pf_smoke.py
index 63eb2c7e..12838e24 100644
--- a/tests/TestSuite_pf_smoke.py
+++ b/tests/TestSuite_pf_smoke.py
@@ -58,7 +58,7 @@ class TestPfSmoke(TestCase):
         self.smoke_tester_nic = self.tester.get_interface(self.smoke_tester_port)
         self.smoke_tester_mac = self.tester.get_mac(self.smoke_dut_ports[0])
         self.smoke_dut_mac = self.dut.get_mac_address(self.smoke_dut_ports[0])
-
+        self.smoke_dut_nic_name = self.nic
         # Verify that enough core
         self.cores = self.dut.get_core_list("1S/4C/1T")
         self.verify(self.cores is not None, "Insufficient cores for speed testing")
diff --git a/tests/TestSuite_vf_smoke.py b/tests/TestSuite_vf_smoke.py
index ac627aa3..c62ff8e2 100644
--- a/tests/TestSuite_vf_smoke.py
+++ b/tests/TestSuite_vf_smoke.py
@@ -62,7 +62,7 @@ class TestVfSmoke(TestCase):
         self.smoke_tester_nic = self.tester.get_interface(self.smoke_tester_port)
         self.smoke_tester_mac = self.tester.get_mac(self.smoke_dut_ports[0])
         self.smoke_dut_mac = VF_MAC_ADDR
-
+        self.smoke_dut_nic_name = self.nic
         # Verify that enough core
         self.cores = self.dut.get_core_list("1S/4C/1T")
         self.verify(self.cores is not None, "Insufficient cores for speed testing")
@@ -152,7 +152,7 @@ class TestVfSmoke(TestCase):
         # set tester mtu to default value
         self.pmd_out.execute_cmd("stop")
         if self._suite_result.test_case == "test_vf_jumbo_frames":
-            self.tester.send_expect("ifconfig {} mtu {}".format(self.smoke_tester_nic, DEFAULT_PKG_LEN), '# ')
+            self.tester.send_expect("ifconfig {} mtu {}".format(self.smoke_tester_nic, DEFAULT_MTU_VALUE), '# ')
 
         # set dpdk queues to launch value
         if self._suite_result.test_case == "test_vf_tx_rx_queue":
diff --git a/tests/smoke_base.py b/tests/smoke_base.py
index 0d7046b0..8e52069c 100644
--- a/tests/smoke_base.py
+++ b/tests/smoke_base.py
@@ -40,7 +40,7 @@ JUMBO_FRAME_LENGTH = 9000
 IPV4_SRC = '192.168.0.11'
 IPV4_DST = '192.168.0.12'
 LAUNCH_QUEUE = 4
-PACKAGE_COUNT = 32
+PACKAGE_COUNT = 256
 
 
 class SmokeTest(object):
@@ -79,8 +79,10 @@ class SmokeTest(object):
         # wait package update
         time.sleep(1)
         self.test_case.pkt.send_pkt(crb=self.test_case.tester, tx_port=self.test_case.smoke_tester_nic)
-        time.sleep(.5)
-        out = self.test_case.pmd_out.get_output(timeout=1)
+        time.sleep(3)
+
+        out = self.test_case.pmd_out.get_output(timeout=10)
+        time.sleep(3)
         queue_pattern = re.compile(r'Receive\squeue=(\w+)')
         # collect all queues
         queues = queue_pattern.findall(out)
@@ -137,12 +139,32 @@ class SmokeTest(object):
         hash_values = list(set(hash_values))
 
         # verify that each queue has packets, verify hash value are not equal, and hash flag exists.
-        if LAUNCH_QUEUE != len(queues) or 1 == hash_values or hash_flag is False:
+        if LAUNCH_QUEUE != len(queues) or 1 == len(hash_values) or hash_flag is False:
             self.test_case.logger.info("rss the hash flag [{}] [{}] error".format(queues, hash_values))
             return False
 
         return True
 
+    def config_tx_rx_queue(self, queues_rss, disable_rss=False):
+        self.test_case.dut.send_expect("stop", "testpmd> ")
+        self.test_case.dut.send_expect("port stop all", "testpmd> ")
+        if disable_rss:
+            self.test_case.dut.send_expect("port config 0 rx_offload rss_hash off", "testpmd> ")
+        self.test_case.dut.send_expect("port config all rxq {}".format(queues_rss), "testpmd> ")
+        self.test_case.dut.send_expect("port config all txq {}".format(queues_rss), "testpmd> ")
+        out = self.test_case.dut.send_expect("show config rxtx", "testpmd> ")
+        if 'RX queue number: {}'.format(queues_rss) not in out:
+            self.test_case.logger.info("RX queue number {} no display".format(queues_rss))
+            return False
+        if 'Tx queue number: {}'.format(queues_rss) not in out:
+            self.test_case.logger.info("Tx queue number {} no display".format(queues_rss))
+            return False
+        self.test_case.dut.send_expect("port start all", "testpmd> ")
+        self.test_case.dut.send_expect("start", "testpmd> ")
+        self.test_case.pmd_out.wait_link_status_up(self.test_case.smoke_dut_ports[0])
+
+        return queues_rss
+
     def check_tx_rx_queue(self):
         """
         Test configuration queue function can work.
@@ -152,24 +174,20 @@ class SmokeTest(object):
         if queues is None:
             self.test_case.logger.info("txq rxq the queues[{}] error".format(queues))
             return False
-
-        self.test_case.dut.send_expect("stop", "testpmd> ")
-        self.test_case.dut.send_expect("port stop all", "testpmd> ")
-        self.test_case.dut.send_expect("port config all rxq 1", "testpmd> ")
-        self.test_case.dut.send_expect("port config all txq 1", "testpmd> ")
-        out = self.test_case.dut.send_expect("show config rxtx", "testpmd> ")
-        if 'RX queue number: 1' not in out:
-            self.test_case.logger.info("RX queue number 1 no display")
-            return False
-        if 'Tx queue number: 1' not in out:
-            self.test_case.logger.info("Tx queue number 1 no display")
+        if self.test_case.smoke_dut_nic_name in 'foxville':
+            queues_rss = self.config_tx_rx_queue(queues_rss=2)
+        else:
+            queues_rss = self.config_tx_rx_queue(queues_rss=16)
+        hash_flag, queues, hash_values = self.send_pkg_return_stats(rss=True)
+        queues = list(set(queues))
+        hash_values = list(set(hash_values))
+        # verify that each queue has packets, verify hash value are not equal, and hash flag exists.
+        if queues_rss != len(queues) or 1 == len(hash_values) or hash_flag is False:
+            self.test_case.logger.info("rss the hash flag [{}] [{}] error".format(queues, hash_values))
             return False
 
-        self.test_case.dut.send_expect("port start all", "testpmd> ")
-        self.test_case.dut.send_expect("start", "testpmd> ")
-        self.test_case.pmd_out.wait_link_status_up(self.test_case.smoke_dut_ports[0])
+        self.config_tx_rx_queue(queues_rss=1, disable_rss=True)
         queue_after, stats = self.send_pkg_return_stats()
-
         if queue_after is None:
             self.test_case.logger.info("after txq rxq the queue [{}] error".format(queue_after))
             return False
-- 
2.17.1


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

only message in thread, other threads:[~2021-10-26  8:49 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-26 17:19 [dts] [PATCH V3] smoke test support config different queue Lewei Yang

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