From patchwork Tue Oct 26 17:19:23 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lewei Yang X-Patchwork-Id: 102881 Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 80546A0C47; Tue, 26 Oct 2021 10:49:34 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 7355A41C27; Tue, 26 Oct 2021 10:49:34 +0200 (CEST) Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by mails.dpdk.org (Postfix) with ESMTP id 4FFC0407FF for ; Tue, 26 Oct 2021 10:49:32 +0200 (CEST) X-IronPort-AV: E=McAfee;i="6200,9189,10148"; a="230133549" X-IronPort-AV: E=Sophos;i="5.87,182,1631602800"; d="scan'208";a="230133549" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Oct 2021 01:49:31 -0700 X-IronPort-AV: E=Sophos;i="5.87,182,1631602800"; d="scan'208";a="497225968" Received: from unknown (HELO localhost.localdomain) ([10.240.183.102]) by orsmga008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Oct 2021 01:49:29 -0700 From: Lewei Yang To: dts@dpdk.org Cc: Qin Sun , Lewei Yang Date: Tue, 26 Oct 2021 17:19:23 +0000 Message-Id: <20211026171923.9571-1-leweix.yang@intel.com> X-Mailer: git-send-email 2.17.1 Subject: [dts] [PATCH V3] smoke test support config different queue X-BeenThere: dts@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: test suite reviews and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dts-bounces@dpdk.org Sender: "dts" From: Qin Sun smoke test support config different queue Signed-off-by: Lewei Yang --- 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