From patchwork Fri Dec 30 18:40:38 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Jiale, SongX" X-Patchwork-Id: 121485 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 EBCACA0032; Fri, 30 Dec 2022 11:42:52 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id C626B40DD8; Fri, 30 Dec 2022 11:42:52 +0100 (CET) Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by mails.dpdk.org (Postfix) with ESMTP id 542F04067B for ; Fri, 30 Dec 2022 11:42:50 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1672396970; x=1703932970; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=lFJ3FVioJbpHErij8HZO9Fv6uPUHqR0wSfq9eKQhYn4=; b=ZybH/IpcYgh7P6OR8/9TvwJkQQ/8fkGPI4zCM0W4CKe3vElH+diH4U9u sCvztBG8B3wEnD4l18Hosd8jAt0711EOvcRJX3/N4pOa9iDlhiHwhNlwS k5A0pbzz0PPMA1mSozuSp8XPusi4hriZJzYAZNWA8lFWLMarlNEYF8foa /AvC9RFYMWlY/+ETeZZATl+zpHTYpD0SlHbfFqI51c7ddFqIUVHh1vfO3 3Lc2uIqFo/v5/n/Vzo4ZqtqmrhkDu2lHwBpT/QvjU9vj/FNZAWMVZlG1Y ujYDvpy+rSDif+/nr9Q0z/9FSnOclW1sNFX1x4kw4Aniev0cVY9zrodI8 Q==; X-IronPort-AV: E=McAfee;i="6500,9779,10575"; a="318887650" X-IronPort-AV: E=Sophos;i="5.96,287,1665471600"; d="scan'208";a="318887650" Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Dec 2022 02:42:49 -0800 X-IronPort-AV: E=McAfee;i="6500,9779,10575"; a="827944183" X-IronPort-AV: E=Sophos;i="5.96,287,1665471600"; d="scan'208";a="827944183" Received: from unknown (HELO localhost.localdomain) ([10.239.252.20]) by orsmga005-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Dec 2022 02:42:47 -0800 From: Song Jiale To: dts@dpdk.org Cc: Song Jiale Subject: [dts] [PATCH V3 1/2] tests/multiprocess_iavf: add new case according to testplan Date: Fri, 30 Dec 2022 18:40:38 +0000 Message-Id: <20221230184039.1005671-1-songx.jiale@intel.com> X-Mailer: git-send-email 2.25.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 1. add 1 case according to testplan. 2. the optimization script, sort the results of regular matching. Signed-off-by: Song Jiale --- v3: -rework the test case according to the new testplan tests/TestSuite_multiprocess_iavf.py | 46 +++++++++++++++++++++++++++- 1 file changed, 45 insertions(+), 1 deletion(-) diff --git a/tests/TestSuite_multiprocess_iavf.py b/tests/TestSuite_multiprocess_iavf.py index bb8e0c98..c52bfa9c 100644 --- a/tests/TestSuite_multiprocess_iavf.py +++ b/tests/TestSuite_multiprocess_iavf.py @@ -476,7 +476,7 @@ class TestMultiprocessIavf(TestCase): ) pkt_num = kwargs.get("pkt_num") res = self.get_pkt_statistic(out, **kwargs) - res_num = res["rx-total"] + res_num = res["rx-packets"] self.verify( res_num == pkt_num, "fail: got wrong number of packets, expect pakcet number {}, got {}".format( @@ -1068,6 +1068,7 @@ class TestMultiprocessIavf(TestCase): r"Port \d+\s+-\s+rx:\s+(?P\d+)\s+tx:.*PORTS", out, re.DOTALL ) rx_num = re.findall(r"Client\s+\d\s+-\s+rx:\s+(\d+)", res.group(0)) + rx_num.sort(reverse=True) for i in range(proc_num): self.verify( int(rx_num[i]) > 0, @@ -1677,6 +1678,49 @@ class TestMultiprocessIavf(TestCase): } self.rte_flow(mac_ipv4_symmetric, self.multiprocess_rss_data, **pmd_param) + def test_multiprocess_negative_action(self): + """ + Test Case: test_multiprocess_negative_action + + """ + # start testpmd multi-process + self.launch_multi_testpmd( + proc_type="auto", + queue_num=4, + process_num=2, + ) + for pmd_output in self.pmd_output_list: + pmd_output.execute_cmd("stop") + # set primary process port stop + try: + self.pmd_output_list[0].execute_cmd("port stop 0") + except Exception as ex: + out = ex.output + self.logger.error(out) + self.verify( + "core dump" not in out, "Core dump occurred in the primary process!!!" + ) + for pmd_output in self.pmd_output_list: + pmd_output.quit() + # start testpmd multi-process + self.launch_multi_testpmd( + proc_type="auto", + queue_num=4, + process_num=2, + ) + for pmd_output in self.pmd_output_list: + pmd_output.execute_cmd("stop") + # reset port in secondary process + try: + self.pmd_output_list[1].execute_cmd("port stop 0") + self.pmd_output_list[1].execute_cmd("port reset 0") + except Exception as ex: + out = ex.output + self.logger.error(out) + self.verify( + "core dump" not in out, "Core dump occurred in the second process!!!" + ) + def set_fields(self): """set ip protocol field behavior""" fields_config = { From patchwork Fri Dec 30 18:40:39 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Jiale, SongX" X-Patchwork-Id: 121486 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 5DB8FA00C3; Fri, 30 Dec 2022 11:42:53 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id E433042D3A; Fri, 30 Dec 2022 11:42:52 +0100 (CET) Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by mails.dpdk.org (Postfix) with ESMTP id 4F1DE4067B for ; Fri, 30 Dec 2022 11:42:51 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1672396971; x=1703932971; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=EJ8faRnXm/fNbHmQwHuC0oaRfnXVUMUhFu1VlpeGrio=; b=PQNMsCgXGWzBkj+ejDCeMjalK13QWr23sVhb6igKI8aNuH62jbkrjtp2 tYVS32raw4FwOc/YYH+UaZ23kGHz7wgCobDoBFLzwwCMR+F8cSG6MhHQL sfQdRI6YffaJfBs0GoXXkwXESyZ/UFDhRJ1lekbVCcZ79k5LRlFX2qpVk 9jg5J4EAE0FMM0ElbjC4chwNTm/RmD/nDYYv6cpK7K3Z963ZX4uXEmvDf EME9FFkSXaqHTG/NuBqEqG/t1X/QGKjTxNTgKlcLsXjDgMiRPo3LIRkZt HlA+eOgufEqDQ3WDzxHrVJpDG+5i+0zUgqJBjiXRVC2btNryHUb0Fak4z A==; X-IronPort-AV: E=McAfee;i="6500,9779,10575"; a="318887656" X-IronPort-AV: E=Sophos;i="5.96,287,1665471600"; d="scan'208";a="318887656" Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Dec 2022 02:42:50 -0800 X-IronPort-AV: E=McAfee;i="6500,9779,10575"; a="827944187" X-IronPort-AV: E=Sophos;i="5.96,287,1665471600"; d="scan'208";a="827944187" Received: from unknown (HELO localhost.localdomain) ([10.239.252.20]) by orsmga005-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Dec 2022 02:42:49 -0800 From: Song Jiale To: dts@dpdk.org Cc: Song Jiale , Jin Ling Subject: [dts] [PATCH V3 2/2] test_plans/multiprocess_iavf: add 1 case Date: Fri, 30 Dec 2022 18:40:39 +0000 Message-Id: <20221230184039.1005671-2-songx.jiale@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221230184039.1005671-1-songx.jiale@intel.com> References: <20221230184039.1005671-1-songx.jiale@intel.com> 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 add a case to test the testpmd primary process and secondary process crash of the vf port. Signed-off-by: Jin Ling Signed-off-by: Song Jiale Acked-by: Jin Ling Acked-by: Lijuan Tu --- v3: -redesign testplan test_plans/multiprocess_iavf_test_plan.rst | 47 +++++++++++++++++++++- 1 file changed, 46 insertions(+), 1 deletion(-) diff --git a/test_plans/multiprocess_iavf_test_plan.rst b/test_plans/multiprocess_iavf_test_plan.rst index 2f5ae54a..b6222773 100644 --- a/test_plans/multiprocess_iavf_test_plan.rst +++ b/test_plans/multiprocess_iavf_test_plan.rst @@ -54,9 +54,11 @@ If using vfio the kernel must be >= 3.6+ and VT-d must be enabled in bios.When using vfio, use the following commands to load the vfio driver and bind it to the device under test:: + echo 1 > /sys/bus/pci/devices/0000:17:00.0/sriov_numvfs + ip link set ens9 vf0 mac 00:11:22:33:44:55 modprobe vfio modprobe vfio-pci - usertools/dpdk-devbind.py --bind=vfio-pci device_bus_id + usertools/dpdk-devbind.py --bind=vfio-pci {vf_pci} Assuming that a DPDK build has been set up and the multi-process sample applications have been built. @@ -948,3 +950,46 @@ Test Case: test_multiprocess_negative_exceed_process_num the first and second processes should be launched successfully the third process should be launched failed and output should contain the following string: 'multi-process option proc-id(2) should be less than num-procs(2)' + +Test Case: test_multiprocess_negative_action +============================================ +Subcase 1: test_secondary_process_port_stop +------------------------------------------- +test steps +~~~~~~~~~~ + +1. Launch the app ``testpmd``, start 2 process with the following arguments:: + + ./dpdk-testpmd -l 1,2 --proc-type=auto -a 0000:17:01.0 --log-level=ice,7 -- -i --num-procs=2 --proc-id=0 + ./dpdk-testpmd -l 3,4 --proc-type=auto -a 0000:17:01.0 --log-level=ice,7 -- -i --num-procs=2 --proc-id=1 + +2. stop port in primary process:: + + primary process: + testpmd> port stop 0 + +expected result +~~~~~~~~~~~~~~~ + + Check that there are no core dump messages in the output. + +Subcase 2: test_secondary_process_port_reset +-------------------------------------------- +test steps +~~~~~~~~~~ + +1. Launch the app ``testpmd``, start 2 process with the following arguments:: + + ./dpdk-testpmd -l 1,2 --proc-type=auto -a 0000:17:01.0 --log-level=ice,7 -- -i --num-procs=2 --proc-id=0 + ./dpdk-testpmd -l 3,4 --proc-type=auto -a 0000:17:01.0 --log-level=ice,7 -- -i --num-procs=2 --proc-id=1 + +2. reset port in secondary process:: + + secondary process: + testpmd> port stop 0 + testpmd> port reset 0 + +expected result +~~~~~~~~~~~~~~~ + + Check that there are no core dump messages in the output. \ No newline at end of file