From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 8E517A0C43; Mon, 18 Oct 2021 12:51:35 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 7897A40141; Mon, 18 Oct 2021 12:51:35 +0200 (CEST) Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by mails.dpdk.org (Postfix) with ESMTP id 174D74003C for ; Mon, 18 Oct 2021 12:51:32 +0200 (CEST) X-IronPort-AV: E=McAfee;i="6200,9189,10140"; a="208325602" X-IronPort-AV: E=Sophos;i="5.85,381,1624345200"; d="scan'208";a="208325602" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Oct 2021 03:51:29 -0700 X-IronPort-AV: E=Sophos;i="5.85,381,1624345200"; d="scan'208";a="493537273" Received: from unknown (HELO localhost.localdomain) ([10.240.183.102]) by orsmga008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Oct 2021 03:51:28 -0700 From: Lewei Yang To: dts@dpdk.org Cc: Lewei Yang Date: Mon, 18 Oct 2021 19:22:25 +0000 Message-Id: <20211018192225.12775-1-leweix.yang@intel.com> X-Mailer: git-send-email 2.17.1 Subject: [dts] [PATCH V1] smoke test support config different queues 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" smoke test support config different queues Signed-off-by: Lewei Yang --- test_plans/pf_smoke_test_plan.rst | 19 ++++++++++-- test_plans/vf_smoke_test_plan.rst | 17 +++++++++-- tests/TestSuite_pf_smoke.py | 2 +- tests/smoke_base.py | 48 +++++++++++++++++++++++++++++-- 4 files changed, 76 insertions(+), 10 deletions(-) diff --git a/test_plans/pf_smoke_test_plan.rst b/test_plans/pf_smoke_test_plan.rst index 2b6c6128..f7c75150 100644 --- a/test_plans/pf_smoke_test_plan.rst +++ b/test_plans/pf_smoke_test_plan.rst @@ -150,14 +150,27 @@ 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/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/smoke_base.py b/tests/smoke_base.py index 0d7046b0..505b7e19 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,9 @@ 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) queue_pattern = re.compile(r'Receive\squeue=(\w+)') # collect all queues queues = queue_pattern.findall(out) @@ -155,6 +156,47 @@ class SmokeTest(object): self.test_case.dut.send_expect("stop", "testpmd> ") self.test_case.dut.send_expect("port stop all", "testpmd> ") + + if self.test_case.smoke_dut_nic_name in 'foxville': + queues_rss = 2 + 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: 2' not in out: + self.test_case.logger.info("RX queue number {} no display".format(queues_rss)) + return False + if 'Tx queue number: 2' not in out: + self.test_case.logger.info("Tx queue number {} no display".format(queues_rss)) + return False + else: + queues_rss = 16 + 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: 16' not in out: + self.test_case.logger.info("RX queue number {} no display".format(queues_rss)) + return False + if 'Tx queue number: 16' 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> ") + hash_flag, queues, hash_values = self.send_pkg_return_stats(rss=True) + if queues is None: + self.test_case.logger.info("txq rxq the queues[{}] error".format(queues)) + return False + 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 == hash_values or hash_flag is False: + self.test_case.logger.info("rss the hash flag [{}] [{}] error".format(queues, hash_values)) + return False + + # modify queues to 1 can work + 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 0 rx_offload rss_hash off", "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> ") -- 2.17.1