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 326E5A0540; Tue, 27 Dec 2022 10:46:31 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 2895E410FC; Tue, 27 Dec 2022 10:46:31 +0100 (CET) Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by mails.dpdk.org (Postfix) with ESMTP id 9330C40E2D for ; Tue, 27 Dec 2022 10:46:29 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1672134389; x=1703670389; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=Q+UKgJqDJ4eRj6uB8rzleVZfq3IKCyG3DbeTqQqyMF8=; b=FK1Cfq9q91tkzUdJi3OXyALdjLbtw4fD5mVT0ox6Nu15D/U+9e9QkqiQ RzP2NVKP9mHVtwajd6zpFdN3yPM8BvdBWp+7q0thZOw9Pd++rXKffnCUL EPfHMnLcQZrCCauE+puj16kIu3ZswsByjaeR5c3rAaTxD0F6ZrN/tHq++ 8+bgdUKesaVsDkD9rzyNoKlqWSvg6KVygVlFbxi9huuuNdgLXQQWkIsSh nkxTalbTV47nrbAi/PeBRTXffxWidEZ1UVrR4jUNmP1NBYnwVlEdDv3iJ 10pGMZ8F3Apv7oB0NnYC2Jz2GFV5YUkcw5MJdjMwaPM0h1XVJLDpMPHFC A==; X-IronPort-AV: E=McAfee;i="6500,9779,10572"; a="321910436" X-IronPort-AV: E=Sophos;i="5.96,278,1665471600"; d="scan'208";a="321910436" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Dec 2022 01:46:29 -0800 X-IronPort-AV: E=McAfee;i="6500,9779,10572"; a="683569401" X-IronPort-AV: E=Sophos;i="5.96,278,1665471600"; d="scan'208";a="683569401" Received: from unknown (HELO localhost.localdomain) ([10.239.252.20]) by orsmga008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Dec 2022 01:46:27 -0800 From: Song Jiale To: dts@dpdk.org Cc: Song Jiale , Jin Ling Subject: [dts] [PATCH V2 2/2] test_plans/multiprocess_iavf: add 2 cases Date: Tue, 27 Dec 2022 17:44:20 +0000 Message-Id: <20221227174420.513616-2-songx.jiale@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221227174420.513616-1-songx.jiale@intel.com> References: <20221227174420.513616-1-songx.jiale@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 in DPDK multiprocess, all operations done by the secondary process on the hardware are invalid. so action 'port stop' and 'port reset' only work in primary process. add 2 cases to test it. Signed-off-by: Jin Ling --- test_plans/multiprocess_iavf_test_plan.rst | 142 ++++++++++++++++++++- 1 file changed, 141 insertions(+), 1 deletion(-) diff --git a/test_plans/multiprocess_iavf_test_plan.rst b/test_plans/multiprocess_iavf_test_plan.rst index 2f5ae54a..f28f2042 100644 --- a/test_plans/multiprocess_iavf_test_plan.rst +++ b/test_plans/multiprocess_iavf_test_plan.rst @@ -47,6 +47,9 @@ twice - once as a primary instance, and once as a secondary instance. Messages are sent from primary to secondary and vice versa, demonstrating the processes are sharing memory and can communicate using rte_ring structures. +In DPDK multprocess, all operations done by the secondary process on the hardware are invalid +So action `port stop` and `port reset` only work in primary process. + Prerequisites ------------- @@ -54,9 +57,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 +953,138 @@ 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_port_stop +====================================== +Subcase 1: primary_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 --rxq=8 --txq=8 --num-procs=2 --proc-id=0 + ./dpdk-testpmd -l 3,4 --proc-type=auto -a 0000:17:01.0 --log-level=ice,7 -- -i --rxq=8 --txq=8 --num-procs=2 --proc-id=1 + +2. stop port in secondary process and start fwd in primary:: + + secondary process: + testpmd> port stop 0 + + primary process: + testpmd> set fwd rxonly + testpmd> set verbose 1 + testpmd> start + +3. send 1 packet from scapy:: + + >>> sendp([Ether(dst="00:11:22:33:44:55", src="52:00:00:00:00:00")/IP()/Raw(load="P"*20)], iface="ens6") + +expected result +~~~~~~~~~~~~~~~ + +Check that one packet was received in primary process:: + + primary process: + testpmd> stop + + ---------------------- Forward statistics for port 0 ---------------------- + RX-packets: 1 RX-dropped: 0 RX-total: 1 + TX-packets: 0 TX-dropped: 0 TX-total: 0 + ---------------------------------------------------------------------------- + +Subcase 2:secondary_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 --rxq=8 --txq=8 --num-procs=2 --proc-id=0 + ./dpdk-testpmd -l 3,4 --proc-type=auto -a 0000:17:01.0 --log-level=ice,7 -- -i --rxq=8 --txq=8 --num-procs=2 --proc-id=1 + +2. stop port in primary process and start fwd in secondary:: + + primary process: + testpmd> port stop 0 + + secondary process: + testpmd> set fwd rxonly + testpmd> set verbose 1 + testpmd> start + +3. send 1 packet from scapy:: + + >>> sendp([Ether(dst="00:11:22:33:44:55", src="52:00:00:00:00:00")/IP()/Raw(load="P"*20)], iface="ens6") + +expected result +~~~~~~~~~~~~~~~ + + Check that no packet was received. + + secondary process:: + + testpmd> stop + Telling cores to stop... + Waiting for lcores to finish... + + ---------------------- Forward statistics for port 0 ---------------------- + RX-packets: 0 RX-dropped: 1 RX-total: 1 + TX-packets: 0 TX-dropped: 0 TX-total: 0 + ---------------------------------------------------------------------------- + + +TestCase: test_multiprocess_vf_reset +==================================== +Subcase 1: primary_port_reset +----------------------------- +test steps +~~~~~~~~~~ + +1. Launch the app ``testpmd``, start 2 process with rxq/txq set as 8 (proc_id:0~1, queue id:0~7) with the following arguments:: + + ./dpdk-testpmd -l 1,2 --proc-type=auto -a 0000:17:01.0 --log-level=ice,7 -- -i --rxq=8 --txq=8 --num-procs=2 --proc-id=0 + ./dpdk-testpmd -l 3,4 --proc-type=auto -a 0000:17:01.0 --log-level=ice,7 -- -i --rxq=8 --txq=8 --num-procs=2 --proc-id=1 + + +2. reset port in primary when secondary is running:: + + primary process: + testpmd> port stop 0 + testpmd> port reset 0 + + +expected result +~~~~~~~~~~~~~~~ + +secondary process & primary process:: + + testpmd>show port info 0 + + Check that link status of port 0 is `down` + + +Subcase 2: secondary_port_reset +------------------------------- +test steps +~~~~~~~~~~ + +1. Launch the app ``testpmd``, start 2 process with rxq/txq set as 8 (proc_id:0~1, queue id:0~7) with the following arguments:: + + ./dpdk-testpmd -l 1,2 --proc-type=auto -a 0000:17:01.0 --log-level=ice,7 -- -i --rxq=8 --txq=8 --num-procs=2 --proc-id=0 + ./dpdk-testpmd -l 3,4 --proc-type=auto -a 0000:17:01.0 --log-level=ice,7 -- -i --rxq=8 --txq=8 --num-procs=2 --proc-id=1 + +2. reset port in secondary when primary is running:: + + secondary process: + testpmd> port stop 0 + testpmd> port reset 0 + +expected result +~~~~~~~~~~~~~~~ + +primary process & secondary process:: + + testpmd> show port info 0 + + Check that link status of port 0 is `up` \ No newline at end of file -- 2.25.1