diff mbox series

[V2] smoke test support config different queues

Message ID 20211021103154.26805-1-leweix.yang@intel.com (mailing list archive)
State Changes Requested
Headers show
Series [V2] smoke test support config different queues | expand

Checks

Context Check Description
ci/Intel-dts-suite-test fail Testing issues
ci/Intel-dts-doc-test fail Testing issues

Commit Message

Lewei Yang Oct. 21, 2021, 10:31 a.m. UTC
smoke test support config different queues

Signed-off-by: Lewei Yang <leweix.yang@intel.com>
---
 test_plans/pf_smoke_test_plan.rst | 23 +++++++++++--
 test_plans/vf_smoke_test_plan.rst | 17 ++++++++--
 tests/TestSuite_pf_smoke.py       |  2 +-
 tests/TestSuite_vf_smoke.py       |  2 +-
 tests/smoke_base.py               | 55 +++++++++++++++++++++----------
 5 files changed, 73 insertions(+), 26 deletions(-)
diff mbox series

Patch

diff --git a/test_plans/pf_smoke_test_plan.rst b/test_plans/pf_smoke_test_plan.rst
index 2b6c6128..f26267ec 100644
--- a/test_plans/pf_smoke_test_plan.rst
+++ b/test_plans/pf_smoke_test_plan.rst
@@ -148,16 +148,33 @@  Test Case 2: test RSS
 
 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..6f1a644a 100644
--- a/tests/TestSuite_pf_smoke.py
+++ b/tests/TestSuite_pf_smoke.py
@@ -56,9 +56,9 @@  class TestPfSmoke(TestCase):
         self.verify(len(self.smoke_dut_ports) >= 1, "Insufficient ports")
         self.smoke_tester_port = self.tester.get_local_port(self.smoke_dut_ports[0])
         self.smoke_tester_nic = self.tester.get_interface(self.smoke_tester_port)
+        self.smoke_dut_nic_name = self.nic
         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])
-
         # 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..79c699b6 100644
--- a/tests/TestSuite_vf_smoke.py
+++ b/tests/TestSuite_vf_smoke.py
@@ -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..2511d81e 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.
@@ -153,23 +175,20 @@  class SmokeTest(object):
             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