From patchwork Thu Jun 16 08:41:02 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Yaqi Tang X-Patchwork-Id: 112852 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 6BA86A00BE; Thu, 16 Jun 2022 10:41:09 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 44ED14281E; Thu, 16 Jun 2022 10:41:09 +0200 (CEST) Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by mails.dpdk.org (Postfix) with ESMTP id 1066D4114F for ; Thu, 16 Jun 2022 10:41:06 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1655368867; x=1686904867; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=3ylEz4gjbM8dkVfIAny1GG3/w0TH0N4ZXwDCcgv9vfA=; b=JKHl3E1/AMmtcyRk9wvFtO9VoYbM+NNO7qTjzxgcb0KW5iAInv9mvhWM MabI4TBOSsWxbo/q5HLzf1fZzXxNPxySSYTxxSgwRwWg7kRmRaZmVxb5n m5DcA7LcwOdYTRNc06Xygkl6W2ANnUC81SgIU0RmPUAtuF2Qk5Ggjxjzj 3a3fwV7lJL4aFNziWu1M29/IJmTqXgsuhbgTLzNt0BikRi2+bnLuv/5s3 OUxmxTnRVdjDwGEpntuE7VAW/+froYUrBLvSu8rJdJ8S8LSz1/raK4FQZ CVFLfrdY3Gblr8Fc+GRm6r2aDXs8Tg+Z41Mm9bMAWOa2yTKuSDhNoqMqE g==; X-IronPort-AV: E=McAfee;i="6400,9594,10379"; a="259663501" X-IronPort-AV: E=Sophos;i="5.91,304,1647327600"; d="scan'208";a="259663501" Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Jun 2022 01:41:05 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.91,304,1647327600"; d="scan'208";a="589550523" Received: from dpdk-yaqi.sh.intel.com ([10.67.118.237]) by fmsmga007.fm.intel.com with ESMTP; 16 Jun 2022 01:41:04 -0700 From: Yaqi Tang To: dts@dpdk.org Cc: Yaqi Tang Subject: [dts][PATCH V2] test_plans/vm_hotplug: adjust test plan format Date: Thu, 16 Jun 2022 08:41:02 +0000 Message-Id: <20220616084102.94737-1-yaqi.tang@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 Adjust the format of test plan according to test plan template, and add the step number. Signed-off-by: Yaqi Tang --- test_plans/vm_hotplug_test_plan.rst | 198 ++++++++++++++-------------- 1 file changed, 101 insertions(+), 97 deletions(-) diff --git a/test_plans/vm_hotplug_test_plan.rst b/test_plans/vm_hotplug_test_plan.rst index 941ace7b..472f6ab6 100644 --- a/test_plans/vm_hotplug_test_plan.rst +++ b/test_plans/vm_hotplug_test_plan.rst @@ -16,45 +16,50 @@ by failsafe PMD. So "plug out/in the NIC" typically does not the case that physically plug out/in a NIC from/to server, it should be case that remove/add a qemu device from/to a VM. +Prerequisites +============= + Hardware -======== +-------- Ixgbe and i40e NICs Note -==== +---- Known issue for UIO in dpdk/doc/guides/rel_notes/known_issues.rst as below, This test plan only test VFIO scenario. Kernel crash when hot-unplug igb_uio device while DPDK application is running ------------------------------------------------------------------------------ +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ **Description**: - When device has been bound to igb_uio driver and application is running, - hot-unplugging the device may cause kernel crash. + When device has been bound to igb_uio driver and application is running, + hot-unplugging the device may cause kernel crash. **Reason**: - When device is hot-unplugged, igb_uio driver will be removed which will destroy UIO resources. - Later trying to access any uio resource will cause kernel crash. + When device is hot-unplugged, igb_uio driver will be removed which will destroy UIO resources. + Later trying to access any uio resource will cause kernel crash. **Resolution/Workaround**: - If using DPDK for PCI HW hot-unplug, prefer to bind device with VFIO instead of IGB_UIO. + If using DPDK for PCI HW hot-unplug, prefer to bind device with VFIO instead of IGB_UIO. **Affected Environment/Platform**: ALL. **Driver/Module**: - ``igb_uio`` module. + ``igb_uio`` module. +Test case +========= -Test Case: one device -===================== -Bind host PF port 0 to vfio_pci:: +Test Case 1: one device +----------------------- +1. Bind host PF port 0 to vfio_pci:: modprobe vfio_pci ./usertools/dpdk-devbind.py -b vfio_pci 18:00.0 -Passthrough PF and start qemu script as below, using “-monitor stdio” -will send the monitor to the standard output:: +2. Passthrough PF and start qemu script as below, using “-monitor stdio” + will send the monitor to the standard output:: taskset -c 0-7 qemu-system-x86_64 -enable-kvm \ -m 4096 -cpu host -smp 8 -name qemu-vm1 \ @@ -65,7 +70,7 @@ will send the monitor to the standard output:: -device rtl8139,netdev=hostnet1,id=net0,mac=00:00:00:14:c4:31,bus=pci.0,addr=0x1f \ -vnc :5 -Log in VM, bind passthrough port 0 to vfio-pci:: +3. Log in VM, bind passthrough port 0 to vfio-pci:: modprobe -r vfio_iommu_type1 modprobe -r vfio @@ -73,57 +78,57 @@ Log in VM, bind passthrough port 0 to vfio-pci:: modprobe vfio-pci ./usertools/dpdk-devbind.py -b vfio-pci 00:03.0 -Start testpmd with "--hot-plug" enable, set rxonly forward mode -and enable verbose output:: +4. Start testpmd with "--hot-plug" enable, set rxonly forward mode + and enable verbose output::  ./dpdk-testpmd -c f -n 4 -- -i --hot-plug testpmd> set fwd rxonly testpmd> set verbose 1 testpmd> start -Send packets from tester, check RX could work successfully +5. Send packets from tester, check RX could work successfully. -Set txonly forward mode, send packet from testpmd, check TX could -work successfully:: +6. Set txonly forward mode, send packet from testpmd, check TX could + work successfully:: testpmd> set fwd txonly testpmd> start -Remove device from qemu interface:: +7. Remove device from qemu interface:: - (qemu) device_del dev1 + (qemu) device_del dev1 -Check device is removed, no system hange and core dump:: +8. Check device is removed, no system hange and core dump:: - ./usertools/dpdk-devbind.py -s + ./usertools/dpdk-devbind.py -s -Add device from qemu interface:: +9. Add device from qemu interface:: (qemu) device_add vfio-pci,host=18:00.0,id=dev1 -Check driver adds the device, bind port to vfio-pci +10. Check driver adds the device, bind port to vfio-pci. -Attach the VF from testpmd:: +11. Attach the VF from testpmd:: testpmd> port attach 00:03.0 testpmd> port start all -Check testpmd adds the device successfully, no hange and core dump +12. Check testpmd adds the device successfully, no hange and core dump. -Check RX/TX could work successfully +13. Check RX/TX could work successfully. -Repeat above steps for 3 times +14. Repeat above steps for 3 times. -Test Case: one device + reset -============================= -Bind host PF port 0 to vfio_pci:: +Test Case 2: one device + reset +------------------------------- +1. Bind host PF port 0 to vfio_pci:: modprobe vfio_pci ./usertools/dpdk-devbind.py -b vfio_pci 18:00.0 -Log in VM, passthrough PF and start qemu script same as above +2. Log in VM, passthrough PF and start qemu script same as above. -Bind passthrough port 0 to vfio-pci:: +3. Bind passthrough port 0 to vfio-pci:: modprobe -r vfio_iommu_type1 modprobe -r vfio @@ -131,56 +136,55 @@ Bind passthrough port 0 to vfio-pci:: modprobe vfio-pci ./usertools/dpdk-devbind.py -b vfio-pci 00:03.0 -Start testpmd with "--hot-plug" enable, set rxonly forward mode -and enable verbose output:: +4. Start testpmd with "--hot-plug" enable, set rxonly forward mode + and enable verbose output::  ./dpdk-testpmd -c f -n 4 -- -i --hot-plug testpmd> set fwd rxonly testpmd> set verbose 1 testpmd> start -Send packets from tester, check RX could work successfully +5. Send packets from tester, check RX could work successfully. -Set txonly forward mode, send packet from testpmd, check TX could -work successfully:: +6. Set txonly forward mode, send packet from testpmd, check TX could + work successfully:: testpmd> set fwd txonly testpmd> start -Remove device from qemu interface:: +7. Remove device from qemu interface:: - (qemu) device_del dev1 + (qemu) device_del dev1 -Quit testpmd +8. Quit testpmd. -Check device is removed, no system hange and core dump:: +9. Check device is removed, no system hange and core dump:: - ./usertools/dpdk-devbind.py -s + ./usertools/dpdk-devbind.py -s -Add device from qemu interface:: +10. Add device from qemu interface:: (qemu) device_add vfio-pci,host=18:00.0,id=dev1 -Check driver adds the device, bind port to vfio-pci - -Restart testpmd +11. Check driver adds the device, bind port to vfio-pci. -Check testpmd adds the device successfully, no hange and core dump +12. Restart testpmd. -Check RX/TX could work successfully +13. Check testpmd adds the device successfully, no hange and core dump. -Repeat above steps for 3 times +14. Check RX/TX could work successfully. +15. Repeat above steps for 3 times. -Test Case: two/multi devices -============================ -Bind host PF port 0 and port 1 to vfio_pci:: +Test Case 3: two/multi devices +------------------------------ +1. Bind host PF port 0 and port 1 to vfio_pci:: modprobe vfio_pci ./usertools/dpdk-devbind.py -b vfio_pci 18:00.0 18:00.1 -Passthrough PFs and start qemu script as below, using “-monitor stdio” -will send the monitor to the standard output:: +2. Passthrough PFs and start qemu script as below, using “-monitor stdio” + will send the monitor to the standard output:: taskset -c 0-7 qemu-system-x86_64 -enable-kvm \ -m 4096 -cpu host -smp 8 -name qemu-vm1 \ @@ -192,7 +196,7 @@ will send the monitor to the standard output:: -device rtl8139,netdev=hostnet1,id=net0,mac=00:00:00:14:c4:31,bus=pci.0,addr=0x1f \ -vnc :5 -Log in VM, bind passthrough port 0 and port 1 to vfio-pci:: +3. Log in VM, bind passthrough port 0 and port 1 to vfio-pci:: modprobe -r vfio_iommu_type1 modprobe -r vfio @@ -200,60 +204,60 @@ Log in VM, bind passthrough port 0 and port 1 to vfio-pci:: modprobe vfio-pci ./usertools/dpdk-devbind.py -b vfio-pci 00:03.0 00:04.0 -Start testpmd with "--hot-plug" enable, set rxonly forward mode -and enable verbose output:: +4. Start testpmd with "--hot-plug" enable, set rxonly forward mode + and enable verbose output::  ./dpdk-testpmd -c f -n 4 -- -i --hot-plug testpmd> set fwd rxonly testpmd> set verbose 1 testpmd> start -Send packets from tester, check RX could work successfully -Set txonly forward mode, send packet from testpmd, check TX could -work successfully:: +5. Send packets from tester, check RX could work successfully. + +6. Set txonly forward mode, send packet from testpmd, check TX could + work successfully:: testpmd> set fwd txonly testpmd> start -Remove device 1 and device 2 from qemu interface:: +7. Remove device 1 and device 2 from qemu interface:: - (qemu) device_del dev1 - (qemu) device_del dev2 + (qemu) device_del dev1 + (qemu) device_del dev2 -Check devices are removed, no system hange and core dump:: +8. Check devices are removed, no system hange and core dump:: - ./usertools/dpdk-devbind.py -s + ./usertools/dpdk-devbind.py -s -Add devices from qemu interface:: +9. Add devices from qemu interface:: (qemu) device_add vfio-pci,host=18:00.0,id=dev1 (qemu) device_add vfio-pci,host=18:00.1,id=dev2 -Check driver adds the devices, bind port to vfio-pci +10. Check driver adds the devices, bind port to vfio-pci. -Attach the VFs from testpmd:: +11. Attach the VFs from testpmd:: testpmd> port attach 00:03.0 testpmd> port attach 00:04.0 testpmd> port start all -Check testpmd adds the devices successfully, no hange and core dump - -Check RX/TX could work successfully +12. Check testpmd adds the devices successfully, no hange and core dump. -Repeat above steps for 3 times +13. Check RX/TX could work successfully. +14. Repeat above steps for 3 times. -Test Case: two/multi devices + reset -==================================== -Bind host PF port 0 and port 1 to vfio_pci:: +Test Case 4: two/multi devices + reset +-------------------------------------- +1. Bind host PF port 0 and port 1 to vfio_pci:: modprobe vfio_pci ./usertools/dpdk-devbind.py -b vfio_pci 18:00.0 18:00.1 -Passthrough PFs and start qemu script same as above +2. Passthrough PFs and start qemu script same as above. -Log in VM, bind passthrough port 0 and port 1 to vfio-pci:: +3. Log in VM, bind passthrough port 0 and port 1 to vfio-pci:: modprobe -r vfio_iommu_type1 modprobe -r vfio @@ -261,44 +265,44 @@ Log in VM, bind passthrough port 0 and port 1 to vfio-pci:: modprobe vfio-pci ./usertools/dpdk-devbind.py -b vfio-pci 00:03.0 00:04.0 -Start testpmd with "--hot-plug" enable, set rxonly forward mode -and enable verbose output:: +4. Start testpmd with "--hot-plug" enable, set rxonly forward mode + and enable verbose output::  ./dpdk-testpmd -c f -n 4 -- -i --hot-plug testpmd> set fwd rxonly testpmd> set verbose 1 testpmd> start -Send packets from tester, check RX could work successfully +5. Send packets from tester, check RX could work successfully. -Set txonly forward mode, send packets from testpmd, check TX could -work successfully:: +6. Set txonly forward mode, send packets from testpmd, check TX could + work successfully:: testpmd> set fwd txonly testpmd> start -Remove device 1 and device 2 from qemu interface:: +7. Remove device 1 and device 2 from qemu interface:: - (qemu) device_del dev1 - (qemu) device_del dev2 + (qemu) device_del dev1 + (qemu) device_del dev2 -Quit testpmd +8. Quit testpmd. -Check devices are removed, no system hange and core dump:: +9. Check devices are removed, no system hange and core dump:: - ./usertools/dpdik-devbind.py -s + ./usertools/dpdik-devbind.py -s -Add devices from qemu interface:: +10. Add devices from qemu interface:: (qemu) device_add vfio-pci,host=18:00.0,id=dev1 (qemu) device_add vfio-pci,host=18:00.1,id=dev2 -Check driver adds the devices, bind ports to vfio-pci +11. Check driver adds the devices, bind ports to vfio-pci. -Restart testpmd +12. Restart testpmd. -Check testpmd adds the devices successfully, no hange and core dump +13. Check testpmd adds the devices successfully, no hange and core dump. -Check RX/TX could work successfully +14. Check RX/TX could work successfully. -Repeat above steps for 3 times +15. Repeat above steps for 3 times.