From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by dpdk.org (Postfix) with ESMTP id 06CF94C8B for ; Wed, 28 Nov 2018 09:29:00 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga103.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 28 Nov 2018 00:29:00 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.56,290,1539673200"; d="scan'208";a="96119135" Received: from fmsmsx106.amr.corp.intel.com ([10.18.124.204]) by orsmga008.jf.intel.com with ESMTP; 28 Nov 2018 00:28:59 -0800 Received: from fmsmsx121.amr.corp.intel.com (10.18.125.36) by FMSMSX106.amr.corp.intel.com (10.18.124.204) with Microsoft SMTP Server (TLS) id 14.3.408.0; Wed, 28 Nov 2018 00:28:59 -0800 Received: from shsmsx103.ccr.corp.intel.com (10.239.4.69) by fmsmsx121.amr.corp.intel.com (10.18.125.36) with Microsoft SMTP Server (TLS) id 14.3.408.0; Wed, 28 Nov 2018 00:28:59 -0800 Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.102]) by SHSMSX103.ccr.corp.intel.com ([169.254.4.161]) with mapi id 14.03.0415.000; Wed, 28 Nov 2018 16:28:57 +0800 From: "Tu, Lijuan" To: "Zhao, MeijuanX" , "dts@dpdk.org" CC: "Zhao, MeijuanX" Thread-Topic: [dts] [PATCH V2 2/2] test_plans/vf macfilter: add dpdk pf test scenorio Thread-Index: AQHUhufFsHK+tJMU/Uqxs3xu4QV39KVk2vAw Date: Wed, 28 Nov 2018 08:28:56 +0000 Message-ID: <8CE3E05A3F976642AAB0F4675D0AD20E0B9C1C08@SHSMSX101.ccr.corp.intel.com> References: <1543388472-9880-1-git-send-email-meijuanx.zhao@intel.com> <1543388472-9880-2-git-send-email-meijuanx.zhao@intel.com> In-Reply-To: <1543388472-9880-2-git-send-email-meijuanx.zhao@intel.com> Accept-Language: zh-CN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-version: 11.0.400.15 dlp-reaction: no-action x-ctpclassification: CTP_NT x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiYzc4OTNiYWQtNDcxNy00ZTZmLWIxODYtMzlmNTExZjM3ZjQxIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiUGM5VHZsXC80YURQVkJCVFA3NHRzdTlCNEcxcnRlZmd5cnpLUjVKU1VjZnFmdEdSWXB4R2k0QWt3NjZsQ3NpaysifQ== x-originating-ip: [10.239.127.40] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dts] [PATCH V2 2/2] test_plans/vf macfilter: add dpdk pf test scenorio X-BeenThere: dts@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: test suite reviews and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Nov 2018 08:29:01 -0000 Applied, thanks > -----Original Message----- > From: dts [mailto:dts-bounces@dpdk.org] On Behalf Of zhao,meijuan > Sent: Wednesday, November 28, 2018 3:01 PM > To: dts@dpdk.org > Cc: Zhao, MeijuanX > Subject: [dts] [PATCH V2 2/2] test_plans/vf macfilter: add dpdk pf test > scenorio >=20 > Signed-off-by: zhao,meijuan > --- > test_plans/vf_macfilter_test_plan.rst | 190 ++++++++++++++++++++++++-- > 1 file changed, 182 insertions(+), 8 deletions(-) >=20 > diff --git a/test_plans/vf_macfilter_test_plan.rst > b/test_plans/vf_macfilter_test_plan.rst > index 221c05e..715c66d 100644 > --- a/test_plans/vf_macfilter_test_plan.rst > +++ b/test_plans/vf_macfilter_test_plan.rst > @@ -39,7 +39,7 @@ Test Case 1: test_kernel_2pf_2vf_1vm_iplink_macfilter >=20 > 1. Get the pci device id of DUT, for example:: >=20 > - ./dpdk_nic_bind.py --st > + ./usertools/dpdk-devbind.py -s >=20 > 0000:81:00.0 'Ethernet Controller X710 for 10GbE SFP+' if=3Dens259= f0 > drv=3Di40e unused=3D > 0000:81:00.1 'Ethernet Controller X710 for 10GbE SFP+' if=3Dens259= f1 > drv=3Di40e unused=3D @@ -49,7 +49,7 @@ Test Case 1: > test_kernel_2pf_2vf_1vm_iplink_macfilter > echo 1 > /sys/bus/pci/devices/0000\:81\:00.0/sriov_numvfs > echo 1 > /sys/bus/pci/devices/0000\:81\:00.1/sriov_numvfs >=20 > - ./dpdk_nic_bind.py --st > + ./usertools/dpdk-devbind.py -s > 0000:81:00.0 'Ethernet Controller X710 for 10GbE SFP+' if=3Dens259= f0 > drv=3Di40e unused=3D > 0000:81:00.1 'Ethernet Controller X710 for 10GbE SFP+' if=3Dens259= f1 > drv=3Di40e unused=3D > 0000:81:02.0 'XL710/X710 Virtual Function' unused=3D @@ -76,7 > +76,7 @@ Test Case 1: test_kernel_2pf_2vf_1vm_iplink_macfilter > virsh nodedev-detach pci_0000_81_02_0; > virsh nodedev-detach pci_0000_81_0a_0; >=20 > - ./dpdk_nic_bind.py --st > + ./usertools/dpdk-devbind.py -s >=20 > 0000:81:00.0 'Ethernet Controller X710 for 10GbE SFP+' if=3Dens259= f0 > drv=3Di40e unused=3D > 0000:81:00.1 'Ethernet Controller X710 for 10GbE SFP+' if=3Dens259= f1 > drv=3Di40e unused=3D @@ -96,7 +96,7 @@ Test Case 1: > test_kernel_2pf_2vf_1vm_iplink_macfilter > bind them to igb_uio driver, and then start testpmd, enable CRC strip= , > disable promisc mode,set it in mac forward mode:: >=20 > - ./tools/dpdk_nic_bind.py --bind=3Digb_uio 00:06.0 00:07.0 > + ./usertools/dpdk-devbind.py --bind=3Digb_uio 00:06.0 00:07.0 > ./x86_64-native-linuxapp-gcc/app/testpmd -c 0x0f -n 4 -w 00:06.0 > -w 00:07.0 -- -i --portmask=3D0x3 --tx-offloads=3D0x8fff >=20 > testpmd> port stop all > @@ -119,7 +119,7 @@ Test Case 2: > test_kernel_2pf_2vf_1vm_mac_add_filter >=20 > 1. Get the pci device id of DUT, for example:: >=20 > - ./dpdk_nic_bind.py --st > + ./usertools/dpdk-devbind.py -s >=20 > 0000:81:00.0 'Ethernet Controller X710 for 10GbE SFP+' if=3Dens259= f0 > drv=3Di40e unused=3D > 0000:81:00.1 'Ethernet Controller X710 for 10GbE SFP+' if=3Dens259= f1 > drv=3Di40e unused=3D @@ -129,7 +129,7 @@ Test Case 2: > test_kernel_2pf_2vf_1vm_mac_add_filter > echo 1 > /sys/bus/pci/devices/0000\:81\:00.0/sriov_numvfs > echo 1 > /sys/bus/pci/devices/0000\:81\:00.1/sriov_numvfs >=20 > - ./dpdk_nic_bind.py --st > + ./usertools/dpdk-devbind.py -s > 0000:81:00.0 'Ethernet Controller X710 for 10GbE SFP+' if=3Dens259= f0 > drv=3Di40e unused=3D > 0000:81:00.1 'Ethernet Controller X710 for 10GbE SFP+' if=3Dens259= f1 > drv=3Di40e unused=3D > 0000:81:02.0 'XL710/X710 Virtual Function' unused=3D @@ -154,7 > +154,7 @@ Test Case 2: test_kernel_2pf_2vf_1vm_mac_add_filter > virsh nodedev-detach pci_0000_81_02_0; > virsh nodedev-detach pci_0000_81_0a_0; >=20 > - ./dpdk_nic_bind.py --st > + ./usertools/dpdk-devbind.py -s >=20 > 0000:81:00.0 'Ethernet Controller X710 for 10GbE SFP+' if=3Dens259= f0 > drv=3Di40e unused=3D > 0000:81:00.1 'Ethernet Controller X710 for 10GbE SFP+' if=3Dens259= f1 > drv=3Di40e unused=3D @@ -174,7 +174,7 @@ Test Case 2: > test_kernel_2pf_2vf_1vm_mac_add_filter > bind them to igb_uio driver, and then start testpmd, enable CRC strip= on > VF, disable promisc mode, add a new MAC to VF0 and then start:: >=20 > - ./tools/dpdk_nic_bind.py --bind=3Digb_uio 00:06.0 00:07.0 > + ./usertools/dpdk-devbind.py --bind=3Digb_uio 00:06.0 00:07.0 > ./x86_64-native-linuxapp-gcc/app/testpmd -c 0x0f -n 4 -w 00:06.0 > -w 00:07.0 -- -i --portmask=3D0x3 --tx-offloads=3D0x8fff >=20 > testpmd> port stop all > @@ -199,3 +199,177 @@ Test Case 2: > test_kernel_2pf_2vf_1vm_mac_add_filter > 8. Use scapy to send 100 random packets with a wrong MAC to VF0, verify > the > packets can't be received by one VF and can be forward to another VF > correctly. > + > +Test Case 3: test_dpdk_2pf_2vf_1vm_mac_add_filter > +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D > + > +1. Get the pci device id of DUT, bind them to igb_uio,for example:: > + > + ./usertools/dpdk-devbind.py -s > + > + 0000:81:00.0 'Ethernet Controller X710 for 10GbE SFP+' if=3Dens259= f0 > drv=3Di40e unused=3D > + 0000:81:00.1 'Ethernet Controller X710 for 10GbE SFP+' if=3Dens259= f1 > drv=3Di40e unused=3D > + ./usertools/dpdk-devbind.py --bind=3Digb_uio 0000:81:00.0 > + 0000:81:00.1 > + > + > +2. Create 2 VFs from 2 PFs, and don't set the VF MAC address at PF0:: > + > + echo 1 > /sys/bus/pci/devices/0000\:81\:00.0/max_vfs > + echo 1 > /sys/bus/pci/devices/0000\:81\:00.1/max_vfs > + > + ./usertools/dpdk-devbind.py -s > + 0000:81:00.0 'Ethernet Controller X710 for 10GbE SFP+' > drv=3Digb_uio unused=3Di40e > + 0000:81:00.1 'Ethernet Controller X710 for 10GbE SFP+' > drv=3Digb_uio unused=3Di40e > + 0000:81:02.0 'XL710/X710 Virtual Function' unused=3D > + 0000:81:0a.0 'XL710/X710 Virtual Function' unused=3D > + > +3. Start testpmd:: > + > + ./x86_64-native-linuxapp-gcc/app/testpmd -c 0x6 -n 4 -b > + 0000:81:02.0 -b 0000:81:0a.0 -- -i > + > +4. Detach VFs from the host, bind them to pci-stub driver:: > + > + /sbin/modprobe pci-stub > + > + using `lspci -nn|grep -i ethernet` to get VF device id, for > + example "8086 154c", > + > + echo "8086 154c" > /sys/bus/pci/drivers/pci-stub/new_id > + echo 0000:81:02.0 > > /sys/bus/pci/devices/0000:08:02.0/driver/unbind > + echo 0000:81:02.0 > /sys/bus/pci/drivers/pci-stub/bind > + > + echo "8086 154c" > /sys/bus/pci/drivers/pci-stub/new_id > + echo 0000:81:0a.0 > > /sys/bus/pci/devices/0000:08:0a.0/driver/unbind > + echo 0000:81:0a.0 > /sys/bus/pci/drivers/pci-stub/bind > + > + or using the following more easy way:: > + > + virsh nodedev-detach pci_0000_81_02_0; > + virsh nodedev-detach pci_0000_81_0a_0; > + > + ./dpdk_nic_bind.py --st > + > + 0000:81:00.0 'Ethernet Controller X710 for 10GbE SFP+' if=3Dens259= f0 > drv=3Di40e unused=3D > + 0000:81:00.1 'Ethernet Controller X710 for 10GbE SFP+' if=3Dens259= f1 > drv=3Di40e unused=3D > + 0000:81:02.0 'XL710/X710 Virtual Function' if=3D drv=3Dpci-stub un= used=3D > + 0000:81:0a.0 'XL710/X710 Virtual Function' if=3D drv=3Dpci-stub > + unused=3D > + > + it can be seen that VFs 81:02.0 & 81:0a.0 's driver is pci-stub. > +5. Passthrough VFs 81:02.0 & 81:0a.0 to vm0, and start vm0:: > + > + /usr/bin/qemu-system-x86_64 -name vm0 -enable-kvm \ > + -cpu host -smp 4 -m 2048 -drive file=3D/home/image/sriov-fc20-1.im= g > -vnc :1 \ > + -device pci-assign,host=3D81:02.0,id=3Dpt_0 \ > + -device pci-assign,host=3D81:0a.0,id=3Dpt_1 > + > +6. login vm0, got VFs pci device id in vm0, assume they are 00:06.0 & > 00:07.0, > + bind them to igb_uio driver, and then start testpmd, enable CRC strip= on > + VF, disable promisc mode, add a new MAC to VF0 and then start:: > + > + ./tools/dpdk_nic_bind.py --bind=3Digb_uio 00:06.0 00:07.0 > + ./x86_64-native-linuxapp-gcc/app/testpmd -c 0x0f -n 4 -w 00:06.0 > + -w 00:07.0 -- -i --portmask=3D0x3 --tx-offloads=3D0x8fff > + > + testpmd> port stop all > + testpmd> port config all crc-strip on > + testpmd> port start all > + testpmd> set promisc all off > + testpmd> mac_addr add 0 00:11:22:33:44:55 > + testpmd> set fwd mac > + testpmd> start > + > + Note: In Jan, 2016, i40e doesn't support mac_addr add operation, so > the > + case will be failed for FVL/Fort park NICs. > + > +7. Use scapy to send 100 random packets with current VF0's MAC, verify > the > + packets can be received by one VF and can be forward to another VF > + correctly. > + > +8. Use scapy to send 100 random packets with new added VF0's MAC, verify > the > + packets can be received by one VF and can be forward to another VF > + correctly. > + > +9. Use scapy to send 100 random packets with a wrong MAC to VF0, verify > the > + packets can't be received by one VF and can be forward to another VF > + correctly. > +Test Case 4: test_dpdk_2pf_2vf_1vm_iplink_macfilter > +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D > + > +1. Get the pci device id of DUT, bind them to igb_uio,for example:: > + > + ./usertools/dpdk-devbind.py -s > + > + 0000:81:00.0 'Ethernet Controller X710 for 10GbE SFP+' if=3Dens259= f0 > drv=3Di40e unused=3D > + 0000:81:00.1 'Ethernet Controller X710 for 10GbE SFP+' if=3Dens259= f1 > drv=3Di40e unused=3D > + ./usertools/dpdk-devbind.py --bind=3Digb_uio 0000:81:00.0 > + 0000:81:00.1 > + > + > +2. Create 2 VFs from 2 PFs, and set the VF MAC address at PF0:: > + > + echo 1 > /sys/bus/pci/devices/0000\:81\:00.0/max_vfs > + echo 1 > /sys/bus/pci/devices/0000\:81\:00.1/max_vfs > + > + ./usertools/dpdk-devbind.py -s > + 0000:81:00.0 'Ethernet Controller X710 for 10GbE SFP+' > drv=3Digb_uio unused=3Di40e > + 0000:81:00.1 'Ethernet Controller X710 for 10GbE SFP+' > drv=3Digb_uio unused=3Di40e > + 0000:81:02.0 'XL710/X710 Virtual Function' unused=3D > + 0000:81:0a.0 'XL710/X710 Virtual Function' unused=3D > + > +3. Start testpmd:: > + > + ./x86_64-native-linuxapp-gcc/app/testpmd -c 0x6 -n 4 -b > 0000:81:02.0 -b 0000:81:0a.0 -- -i > + testpmd>set vf mac addr 0 0 00:11:22:33:44:55 > + > +4. Detach VFs from the host, bind them to pci-stub driver:: > + > + /sbin/modprobe pci-stub > + > + using `lspci -nn|grep -i ethernet` to get VF device id, for > + example "8086 154c", > + > + echo "8086 154c" > /sys/bus/pci/drivers/pci-stub/new_id > + echo 0000:81:02.0 > > /sys/bus/pci/devices/0000:08:02.0/driver/unbind > + echo 0000:81:02.0 > /sys/bus/pci/drivers/pci-stub/bind > + > + echo "8086 154c" > /sys/bus/pci/drivers/pci-stub/new_id > + echo 0000:81:0a.0 > > /sys/bus/pci/devices/0000:08:0a.0/driver/unbind > + echo 0000:81:0a.0 > /sys/bus/pci/drivers/pci-stub/bind > + > + or using the following more easy way:: > + > + virsh nodedev-detach pci_0000_81_02_0; > + virsh nodedev-detach pci_0000_81_0a_0; > + > + ./dpdk_nic_bind.py --st > + > + 0000:81:00.0 'Ethernet Controller X710 for 10GbE SFP+' if=3Dens259= f0 > drv=3Di40e unused=3D > + 0000:81:00.1 'Ethernet Controller X710 for 10GbE SFP+' if=3Dens259= f1 > drv=3Di40e unused=3D > + 0000:81:02.0 'XL710/X710 Virtual Function' if=3D drv=3Dpci-stub un= used=3D > + 0000:81:0a.0 'XL710/X710 Virtual Function' if=3D drv=3Dpci-stub > + unused=3D > + > + it can be seen that VFs 81:02.0 & 81:0a.0 's driver is pci-stub. > +5. Passthrough VFs 81:02.0 & 81:0a.0 to vm0, and start vm0:: > + > + /usr/bin/qemu-system-x86_64 -name vm0 -enable-kvm \ > + -cpu host -smp 4 -m 2048 -drive file=3D/home/image/sriov-fc20-1.im= g > -vnc :1 \ > + -device pci-assign,host=3D81:02.0,id=3Dpt_0 \ > + -device pci-assign,host=3D81:0a.0,id=3Dpt_1 > + > +6. Login vm0, got VFs pci device id in vm0, assume they are 00:06.0 & > 00:07.0, > + bind them to igb_uio driver, and then start testpmd, enable CRC strip= , > + disable promisc mode,set it in mac forward mode:: > + > + ./tools/dpdk_nic_bind.py --bind=3Digb_uio 00:06.0 00:07.0 > + ./x86_64-native-linuxapp-gcc/app/testpmd -c 0x0f -n 4 -w 00:06.0 > + -w 00:07.0 -- -i --portmask=3D0x3 --tx-offloads=3D0x8fff > + > + testpmd> port stop all > + testpmd> port config all crc-strip on > + testpmd> port start all > + testpmd> set promisc all off > + testpmd> set fwd mac > + testpmd> start > + > +7. Use scapy to send 100 random packets with ip link set MAC to VF, veri= fy > the > + packets can be received by one VF and can be forward to another VF > + correctly. > + > +8. Also use scapy to send 100 random packets with a wrong MAC to VF, > verify > + the packets can't be received by one VF and can be forward to another > VF > + correctly. > -- > 2.17.2