From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by dpdk.org (Postfix) with ESMTP id 2AEE0559C for ; Mon, 18 Jan 2016 02:30:48 +0100 (CET) Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga103.fm.intel.com with ESMTP; 17 Jan 2016 17:30:46 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.22,310,1449561600"; d="scan'208";a="635243313" Received: from fmsmsx103.amr.corp.intel.com ([10.18.124.201]) by FMSMGA003.fm.intel.com with ESMTP; 17 Jan 2016 17:30:46 -0800 Received: from fmsmsx157.amr.corp.intel.com (10.18.116.73) by FMSMSX103.amr.corp.intel.com (10.18.124.201) with Microsoft SMTP Server (TLS) id 14.3.248.2; Sun, 17 Jan 2016 17:30:46 -0800 Received: from shsmsx101.ccr.corp.intel.com (10.239.4.153) by FMSMSX157.amr.corp.intel.com (10.18.116.73) with Microsoft SMTP Server (TLS) id 14.3.248.2; Sun, 17 Jan 2016 17:30:45 -0800 Received: from shsmsx102.ccr.corp.intel.com ([169.254.2.172]) by SHSMSX101.ccr.corp.intel.com ([169.254.1.215]) with mapi id 14.03.0248.002; Mon, 18 Jan 2016 09:30:35 +0800 From: "Xu, Qian Q" To: "Liu, Yong" , "dts@dpdk.org" Thread-Topic: [dts] [PATCH 4/6] tests vf_vlan: add VF vlan test plan Thread-Index: AQHRTD6TsXpGJ+h1LEi5q4VZb0bI7J8AhgJg Date: Mon, 18 Jan 2016 01:30:35 +0000 Message-ID: <82F45D86ADE5454A95A89742C8D1410E031BA0B9@shsmsx102.ccr.corp.intel.com> References: <1452495940-9681-1-git-send-email-yong.liu@intel.com> <1452495940-9681-4-git-send-email-yong.liu@intel.com> In-Reply-To: <1452495940-9681-4-git-send-email-yong.liu@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiZjk3ZjliZGEtZjlkZi00ZTZiLWI3ODMtYzUwN2QyNTQ5YzZjIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX0lDIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE1LjQuMTAuMTkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiNDZaanZLb2hJN3JWRVFQUFVhRDFPWkFNQ0FZdkVSVGlHbzc3SDk2cDhSZz0ifQ== x-ctpclassification: CTP_IC 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 4/6] tests vf_vlan: add VF vlan test plan 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: Mon, 18 Jan 2016 01:30:48 -0000 How about the boundary testing, we may need test VLAN ID=3D4095, 4096?=20 Thanks Qian -----Original Message----- From: dts [mailto:dts-bounces@dpdk.org] On Behalf Of Yong Liu Sent: Monday, January 11, 2016 3:06 PM To: dts@dpdk.org Subject: [dts] [PATCH 4/6] tests vf_vlan: add VF vlan test plan Signed-off-by: Marvin Liu diff --git a/test_plans/vf_vlan_test_plan.rst b/test_plans/vf_vlan_test_pla= n.rst new file mode 100644 index 0000000..24ae1fc --- /dev/null +++ b/test_plans/vf_vlan_test_plan.rst @@ -0,0 +1,186 @@ +.. Copyright (c) <2015>, Intel Corporation + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + + - Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + - Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + + - Neither the name of Intel Corporation nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + OF THE POSSIBILITY OF SUCH DAMAGE. + + +The support of VLAN offload features by VF device consists in: + +- the filtering of received VLAN packets +- VLAN header stripping by hardware in received [VLAN] packets +- VLAN header insertion by hardware in transmitted packets + +Prerequisites +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D +1. Create VF device from PF devices. + ./dpdk_nic_bind.py --st + 0000:87:00.0 'Ethernet Controller X710 for 10GbE SFP+' if=3Dens259f0 drv= =3Di40e unused=3D + 0000:87:00.1 'Ethernet Controller X710 for 10GbE SFP+' if=3Dens259f1=20 +drv=3Di40e unused=3D + + echo 1 > /sys/bus/pci/devices/0000\:87\:00.0/sriov_numvfs + echo 1 > /sys/bus/pci/devices/0000\:87\:00.1/sriov_numvfs + + ./dpdk_nic_bind.py --st + + 0000:87:00.0 'Ethernet Controller X710 for 10GbE SFP+' if=3Dens259f0 d= rv=3Di40e unused=3D + 0000:87:02.0 'XL710/X710 Virtual Function' unused=3D + 0000:87:0a.0 'XL710/X710 Virtual Function' unused=3D + +2. Detach VFs from the host, bind them to pci-stub driver, + + /sbin/modprobe pci-stub + + using `lspci -nn|grep -i ethernet` got VF device id, for example "8086=20 +154c", + + echo "8086 154c" > /sys/bus/pci/drivers/pci-stub/new_id + echo 0000:87:02.0 > /sys/bus/pci/devices/0000:87:02.0/driver/unbind + echo 0000:87:02.0 > /sys/bus/pci/drivers/pci-stub/bind + + echo "8086 154c" > /sys/bus/pci/drivers/pci-stub/new_id + echo 0000:87:0a.0 > /sys/bus/pci/devices/0000:87:0a.0/driver/unbind + echo 0000:87:0a.0 > /sys/bus/pci/drivers/pci-stub/bind + +3. Passthrough VFs 87:02.0 & 87:02.1 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.img -vnc = :1 \ + -device pci-assign,host=3D87:02.0,id=3Dpt_0 \ + -device pci-assign,host=3D87:0a.0,id=3Dpt_1 + +4. Login vm0 and them bind VF devices to igb_uio driver. + + ./tools/dpdk_nic_bind.py --bind=3Digb_uio 00:04.0 00:05.0 + +5. Start testpmd, set it in rxonly mode and enable verbose output + testpmd -c 0x0f -n 4 -w 00:04.0 -w 00:05.0 -- -i --portmask=3D0x3 --txqfl= ags=3D0 + testpmd> set fwd rxonly + testpmd> set verbose 1 + testpmd> start + +Test Case 1: VF Port based vlan rx +=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 +Linux network configration tool only set pvid on VF devices. + +1. Add pvid on VF0 from PF device + ip link set $PF_INTF vf 0 vlan 2 + +2. Send packet with same vlan id and check VF can receive + +3. Send packet without vlan and check VF can't receive + +4. Send packet with wrong and check Vf can't receive + +5. Check pf device show correct pvid setting + ip link show ens259f0 + ... + vf 0 MAC 00:00:00:00:00:00, vlan 1, spoof checking on, link-state=20 +auto + +7. Remove added vlan from PF device + ip link set $PF_INTF vf 0 vlan 0 + +8. Restart testpmd and send packet without vlan and check VF can=20 +receive + +9. Set packet with vlan id 0 and check VF can receive + +10. Set packet with random id 1-4095 and check VF can't receive + +Test Case 2: VF port based vlan tx +=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. Add pvid on VF0 from PF device + ip link set $PF_INTF vf 0 vlan 2 + +2. Start testpmd with mac forward mode + testpmd> set fwd mac + testpmd> start + +3. Send packet from tester port1 and check packet recevied by tester port0 + Check port1 recevied packet with configured vlan 2 + +Test Case 3: VF tagged vlan tx +=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. Start testpmd with full-featured tx code path and with mac forward mode + testpmd -c f -n 3 -- -i --txqflags=3D0x0 + testpmd> set fwd mac + testpmd> start + +2. Add tx vlan offload on VF0, take care the first param is port + testpmd> tx_vlan 0 1 + +3. Send packet from tester port1 and check packet recevied by tester port0 + Check port- recevied packet with configured vlan 1 + +Test case4: VF tagged vlan rx +=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. Make sure port based vlan disabled on VF0 and VF1 2. Start testpmd=20 +with rxonly mode + testpmd> set fwd rxonly + testpmd> set verbose 1 + testpmd> start + +3. Send packet without vlan and check packet received + +4. Send packet with vlan 0 and check packet received + +5. Add vlan on VF0 from VF driver + testpmd> rx_vlan add 1 0 + +6. Send packet with vlan0/1 and check packet received (set vlan filter=20 +off still can't recevied, need return error) + +7. Remove vlan on VF0 + rx_vlan rm 1 0 + +8. Send packet with vlan 0 and check packet received + +9. Send packet without vlan and check packet received + +10. Send packe with vlan 1 and check packet can't recevied + +Test case5: VF Vlan strip test +=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. Start testpmd with mac forward mode + testpmd> set fwd mac + testpmd> set verbose 1 + testpmd> start + +2. Add tagged vlan 1 on VF0 + testpmd> rx_vlan add 1 0 + +3. Disable VF0 vlan strip and sniff packet on tester port1 + testpmd> vlan set strip off 0 + +4. set packet from tester port0 with vlan 1 and check sniffed packet=20 +has vlan + +5. enable vlan strip on VF0 and sniff packet on tester port1 + testpmd> vlan set strip on 0 + +6. send packet from tester port0 with vlan 1 and check sniffed packet=20 +without vlan + +7. send packet from tester port0 with vlan 0 and check sniffed packet=20 +without vlan -- 1.9.3