From patchwork Tue Apr 11 06:40:48 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Lingli Chen X-Patchwork-Id: 125898 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 3D8AA42919; Tue, 11 Apr 2023 09:51:02 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 3826F410FA; Tue, 11 Apr 2023 09:51:02 +0200 (CEST) Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by mails.dpdk.org (Postfix) with ESMTP id 43A8740A8B for ; Tue, 11 Apr 2023 09:51:01 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1681199461; x=1712735461; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=UIL8B9JMybOovaO2CUdVv9ybiO5bwQR9+/rz95QxDk4=; b=WoJvmenl7HtjxfoNB/EtQi1a/BF9GluPz20yWbfMlgN6YKPkpPft+xPG 0PEr3w+zAotWooQINz7Mbxhm3P2kz7iLgJep8ptVhd3bFLSCPa4gqNmqI UYdm0eti8U7B9XXJgaL88j6jy8tCsGSaFiSxC8XjJM4WCSdVMScd5Fq/R 6csQZKWDSVI/j0VCB17Y7Zco9bt1zy5WYLfQU4ckE2PjAO3+WYTKXNnC9 3NtepT2RTuDCgw99+SqZnSvFQfQpNQ7Xg7UeY6BPTrikXAcl0gk2Jdru4 PHtHc67SsF3dX4lX3Raxt17tIro6iq0m8tRVSRw1wyjFdbOYC1xsD2vST g==; X-IronPort-AV: E=McAfee;i="6600,9927,10676"; a="323912538" X-IronPort-AV: E=Sophos;i="5.98,336,1673942400"; d="scan'208";a="323912538" Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Apr 2023 00:51:00 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10676"; a="638723295" X-IronPort-AV: E=Sophos;i="5.98,336,1673942400"; d="scan'208";a="638723295" Received: from unknown (HELO localhost.localdomain) ([10.239.252.99]) by orsmga003-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Apr 2023 00:50:58 -0700 From: Lingli Chen To: dts@dpdk.org Cc: zhiminx.huang@intel.com, Lingli Chen Subject: [dts][PATCH V3 1/2] test_plans/queue_start_stop: optimize test_plans to remove re-compile dpdk test step Date: Tue, 11 Apr 2023 02:40:48 -0400 Message-Id: <20230411064049.63478-1-linglix.chen@intel.com> X-Mailer: git-send-email 2.17.1 MIME-Version: 1.0 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 remove re-compile dpdk test step Signed-off-by: Lingli Chen --- test_plans/queue_start_stop_test_plan.rst | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/test_plans/queue_start_stop_test_plan.rst b/test_plans/queue_start_stop_test_plan.rst index aecdb095..44b9c2df 100644 --- a/test_plans/queue_start_stop_test_plan.rst +++ b/test_plans/queue_start_stop_test_plan.rst @@ -31,13 +31,10 @@ Test Case: queue start/stop This case support PF (Intel® Ethernet 700 Series/Intel® Ethernet 800 Series/82599), VF (Intel® Ethernet 700 Series, 82599) -#. Update testpmd source code. Add the following C code in ./app/test-pmd/fwdmac.c:: - - printf("ports %u queue %u received %u packages\n", fs->rx_port, fs->rx_queue, nb_rx); - -#. Compile testpmd again, then run testpmd:: +#. Launch testpmd:: x86_64-native-linuxapp-gcc/app/dpdk-testpmd -l 1-2 -n 4 -a 0000:af:00.0 -- -i --portmask=0x1 --port-topology=loop +#. Run "set verbose 1" to set verbose #. Run "set fwd mac" to set fwd type #. Run "start" to start fwd package @@ -55,9 +52,9 @@ This case support PF (Intel® Ethernet 700 Series/Intel® Ethernet 800 Series/82 #. Run "port 0 rxq 0 start" to start rxq 0 in port 0 #. Run "port 0 txq 0 stop" to stop txq 0 in port 0 #. Start packet generator to transmit and check tester port not receive packets - and in testpmd it not has "ports 0 queue 0 received 1 packages" print + and in testpmd it not has "port 0/queue 0: received 1 packets" print #. Run "port 0 txq 0 start" to start txq 0 in port 0 #. Start packet generator to transmit and check tester port receive packets - and in testpmd it has "ports 0 queue 0 received 1 packages" print + and in testpmd it has "port 0/queue 0: received 1 packets" print #. Test it again with VF From patchwork Tue Apr 11 06:40:49 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lingli Chen X-Patchwork-Id: 125899 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 7CCAC42919; Tue, 11 Apr 2023 09:51:07 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 775D9410F9; Tue, 11 Apr 2023 09:51:07 +0200 (CEST) Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by mails.dpdk.org (Postfix) with ESMTP id F2BF640A8B for ; Tue, 11 Apr 2023 09:51:05 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1681199466; x=1712735466; h=from:to:cc:subject:date:message-id:in-reply-to: references; bh=oVxujym5u18nqLFUBnI77+hNm6bwNjfV6QlR5wmUEIM=; b=MMfnifF8YmGxJSB/yhtn7Krk2UXvX2Z0rZDZ8wWbLiFs0KrXChPZk6G+ /Q/4T7GVB3xSsRrG7AACmum7xhh+qMgJnFjZvcjjOwqIT2LUkNBA9VzAO O8ws2C+uQcibVCcUGJWE7pIboWkrNW1RrgEDI2ADyZFsm/7QWCQRxFFlo 0j6B1byqMV0KQqDpAcjBg0E/fDbZFz+lZxP1Lb3sYVKkHxWNpUW2M9zdi g72Ul8fLV0BZpgTKTmb3PTxnbdvhByCDAaUh+DxpTtfg7jiBumSNToQI8 aFp9Q0qESKlsDka2rJ21DH25JFNh89oeawcgy7UN8B7+3mCTqcULQypnB Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10676"; a="323912563" X-IronPort-AV: E=Sophos;i="5.98,336,1673942400"; d="scan'208";a="323912563" Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Apr 2023 00:51:05 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10676"; a="638723320" X-IronPort-AV: E=Sophos;i="5.98,336,1673942400"; d="scan'208";a="638723320" Received: from unknown (HELO localhost.localdomain) ([10.239.252.99]) by orsmga003-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Apr 2023 00:51:04 -0700 From: Lingli Chen To: dts@dpdk.org Cc: zhiminx.huang@intel.com, Lingli Chen Subject: [dts][PATCH V3 2/2] tests/queue_start_stop: optimize test script to remove re-compile dpdk test Date: Tue, 11 Apr 2023 02:40:49 -0400 Message-Id: <20230411064049.63478-2-linglix.chen@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20230411064049.63478-1-linglix.chen@intel.com> References: <20230411064049.63478-1-linglix.chen@intel.com> 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 1. remove re-compile dpdk test step to sync with test_plans 2. delete macfwd_log.patch Signed-off-by: Lingli Chen --- V3: remove useless code V2: Add delete dep/macfwd_log.patch dep/macfwd_log.patch | 10 ----- tests/TestSuite_queue_start_stop.py | 64 +++++------------------------ 2 files changed, 11 insertions(+), 63 deletions(-) delete mode 100644 dep/macfwd_log.patch diff --git a/dep/macfwd_log.patch b/dep/macfwd_log.patch deleted file mode 100644 index 0f657f82..00000000 --- a/dep/macfwd_log.patch +++ /dev/null @@ -1,10 +0,0 @@ ---- app/test-pmd/macfwd.c.org 2015-07-02 10:51:12.821246109 +0800 -+++ app/test-pmd/macfwd.c 2015-07-02 10:50:11.343243319 +0800 -@@ -102,6 +102,7 @@ - nb_pkt_per_burst); - if (unlikely(nb_rx == 0)) - return; -+ printf("ports %u queue %u receive %u packages\n", fs->rx_port, fs->rx_queue, nb_rx); - - #ifdef RTE_TEST_PMD_RECORD_BURST_STATS - fs->rx_burst_stats.pkt_burst_spread[nb_rx]++; diff --git a/tests/TestSuite_queue_start_stop.py b/tests/TestSuite_queue_start_stop.py index 80baf8d6..9e304fb6 100644 --- a/tests/TestSuite_queue_start_stop.py +++ b/tests/TestSuite_queue_start_stop.py @@ -9,13 +9,9 @@ Test queue start stop Feature """ -import os -import re import time from framework.packet import Packet, strip_pktload -from framework.pmd_output import PmdOutput -from framework.settings import FOLDERS from framework.test_case import TestCase # @@ -43,26 +39,12 @@ class TestQueueStartStop(TestCase): """ Run before each test case. """ - try: - patch_file = FOLDERS["Depends"] + r"/macfwd_log.patch" - except: - self.logger.warning(str(FOLDERS)) - patch_file = r"dep/macfwd_log.patch" - FOLDERS["Depends"] = "dep" - patch_dst = "/tmp/" - - # dpdk patch and build - try: - self.dut.session.copy_file_to(patch_file, patch_dst) - self.patch_hotfix_dpdk(patch_dst + "macfwd_log.patch", True) - self.dut.build_install_dpdk(self.target) - except Exception as e: - raise IOError("dpdk setup failure: %s" % e) + pass - def check_forwarding(self, ports, nic, pktSize=64, received=True): - self.send_packet(ports[0], ports[1], self.nic, pktSize, received) + def check_forwarding(self, ports, pktSize=64, received=True): + self.send_packet(ports[0], ports[1], pktSize, received) - def send_packet(self, txPort, rxPort, nic, pktSize=64, received=True): + def send_packet(self, txPort, rxPort, pktSize=64, received=True): """ Send packages according to parameters. """ @@ -85,20 +67,6 @@ class TestQueueStartStop(TestCase): else: self.verify(len(sniff_pkts) == 0, "stop queue not work as expected") - def patch_hotfix_dpdk(self, patch_dir, on=True): - """ - This function is to apply or remove patch for dpdk. - patch_dir: the abs path of the patch - on: True for apply, False for remove - """ - try: - if on: - self.dut.send_expect("patch -p0 < %s" % patch_dir, "[~|~\]]# ") - else: - self.dut.send_expect("patch -p0 -R < %s" % patch_dir, "[~|~\]]# ") - except Exception as e: - raise ValueError("patch_hotfix_dpdk failure: %s" % e) - def test_queue_start_stop(self): """ queue start/stop test @@ -114,8 +82,9 @@ class TestQueueStartStop(TestCase): ) time.sleep(5) self.dut.send_expect("set fwd mac", "testpmd>") + self.dut.send_expect("set verbose 1", "testpmd>") self.dut.send_expect("start", "testpmd>") - self.check_forwarding([0, 0], self.nic) + self.check_forwarding([0, 0]) except Exception as e: raise IOError("dpdk start and first forward failure: %s" % e) @@ -125,7 +94,7 @@ class TestQueueStartStop(TestCase): self.dut.send_expect("stop", "testpmd>") self.dut.send_expect("port 0 rxq 0 stop", "testpmd>") self.dut.send_expect("start", "testpmd>") - self.check_forwarding([0, 0], self.nic, received=False) + self.check_forwarding([0, 0], received=False) # start rx queue test print("test start rx queue stop tx queue") @@ -133,12 +102,12 @@ class TestQueueStartStop(TestCase): self.dut.send_expect("port 0 rxq 0 start", "testpmd>") self.dut.send_expect("port 0 txq 0 stop", "testpmd>") self.dut.send_expect("start", "testpmd>") - self.check_forwarding([0, 0], self.nic, received=False) + self.check_forwarding([0, 0], received=False) out = self.dut.get_session_output() except Exception as e: raise IOError("queue start/stop forward failure: %s" % e) self.verify( - "ports 0 queue 0 receive " not in out, + "port 0/queue 0: received 1 packets" not in out, "start queue revice package failed, out = %s" % out, ) @@ -148,12 +117,12 @@ class TestQueueStartStop(TestCase): self.dut.send_expect("stop", "testpmd>") self.dut.send_expect("port 0 txq 0 start", "testpmd>") self.dut.send_expect("start", "testpmd>") - self.check_forwarding([0, 0], self.nic) + self.check_forwarding([0, 0]) out = self.dut.get_session_output() except Exception as e: raise IOError("queue start/stop forward failure: %s" % e) self.verify( - "ports 0 queue 0 receive " in out, + "port 0/queue 0: received 1 packets" in out, "start queue revice package failed, out = %s" % out, ) @@ -161,7 +130,6 @@ class TestQueueStartStop(TestCase): """ Run after each test case. """ - patch_dst = "/tmp/" try: self.dut.send_expect("stop", "testpmd>") @@ -169,18 +137,8 @@ class TestQueueStartStop(TestCase): except: print("Failed to quit testpmd") - self.dut.kill_all() - - try: - self.patch_hotfix_dpdk(patch_dst + "macfwd_log.patch", False) - except Exception as e: - print(("patch_hotfix_dpdk remove failure :%s" % e)) - def tear_down_all(self): """ Run after each test suite. """ self.dut.kill_all() - self.dut.send_expect("rm -rf ./app/test-pmd/testpmd", "#") - self.dut.send_expect("rm -rf ./app/test-pmd/*.o", "#") - self.dut.send_expect("rm -rf ./app/test-pmd/build", "#")