From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id F264BA04E0; Wed, 27 Nov 2019 10:01:30 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id BFD6758C3; Wed, 27 Nov 2019 10:01:30 +0100 (CET) Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by dpdk.org (Postfix) with ESMTP id 254425596 for ; Wed, 27 Nov 2019 10:01:28 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga004.jf.intel.com ([10.7.209.38]) by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 27 Nov 2019 01:01:28 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.69,248,1571727600"; d="scan'208";a="359440612" Received: from fmsmsx108.amr.corp.intel.com ([10.18.124.206]) by orsmga004.jf.intel.com with ESMTP; 27 Nov 2019 01:01:27 -0800 Received: from fmsmsx163.amr.corp.intel.com (10.18.125.72) by FMSMSX108.amr.corp.intel.com (10.18.124.206) with Microsoft SMTP Server (TLS) id 14.3.439.0; Wed, 27 Nov 2019 01:01:27 -0800 Received: from shsmsx104.ccr.corp.intel.com (10.239.4.70) by fmsmsx163.amr.corp.intel.com (10.18.125.72) with Microsoft SMTP Server (TLS) id 14.3.439.0; Wed, 27 Nov 2019 01:01:27 -0800 Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.213]) by SHSMSX104.ccr.corp.intel.com ([169.254.5.127]) with mapi id 14.03.0439.000; Wed, 27 Nov 2019 17:01:25 +0800 From: "Tu, Lijuan" To: "Zhang, Yuwei1" , "Zhu, TaoX" , "dts@dpdk.org" CC: "Zhu, TaoX" Thread-Topic: [dts] [PATCH V1] test_plan: add test plan for port representor Thread-Index: AQHVb3zf/zAhabQ52U6tvOEeyvB72adqoKkAgDSC0FA= Date: Wed, 27 Nov 2019 09:01:24 +0000 Message-ID: <8CE3E05A3F976642AAB0F4675D0AD20E0BB695C3@SHSMSX101.ccr.corp.intel.com> References: <1568961270-41923-1-git-send-email-taox.zhu@intel.com> In-Reply-To: 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.2.0.6 dlp-reaction: no-action x-ctpclassification: CTP_NT x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiYjZiOWFmMDUtNzJjNS00ODkzLThlMzctZjQxOGQzMTJkNzg5IiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiSHJId2hEdXNrQlBBK3lKU2F5YmVKRU96aWZUU3ZjZWJGaHVmOXoybU95WFdvWFwvclFDbnQ1UGNkSFNrcFIyd3AifQ== 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 V1] test_plan: add test plan for port representor 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: , Errors-To: dts-bounces@dpdk.org Sender: "dts" Applied, thanks > -----Original Message----- > From: dts [mailto:dts-bounces@dpdk.org] On Behalf Of Zhang, Yuwei1 > Sent: Friday, October 25, 2019 3:08 PM > To: Zhu, TaoX ; dts@dpdk.org > Cc: Zhu, TaoX > Subject: Re: [dts] [PATCH V1] test_plan: add test plan for port represent= or >=20 > Acked-by Yuwei Zhang >=20 > -----Original Message----- > From: dts [mailto:dts-bounces@dpdk.org] On Behalf Of Zhu Tao > Sent: Friday, September 20, 2019 2:35 PM > To: dts@dpdk.org > Cc: Zhu, TaoX > Subject: [dts] [PATCH V1] test_plan: add test plan for port representor >=20 > add port_representor_test_plan.rst to test_plans >=20 > Signed-off-by: Zhu Tao > --- > test_plans/port_representor_test_plan.rst | 206 ++++++++++++++++++++++ > 1 file changed, 206 insertions(+) > create mode 100644 test_plans/port_representor_test_plan.rst >=20 > diff --git a/test_plans/port_representor_test_plan.rst > b/test_plans/port_representor_test_plan.rst > new file mode 100644 > index 0000000..e7c1849 > --- /dev/null > +++ b/test_plans/port_representor_test_plan.rst > @@ -0,0 +1,206 @@ > +.. Copyright (c) <2019>, 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. > + > +=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 > +Port Representor Tests > +=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 > + > +Description > +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > +Use two representor ports as the control plane to manage the two VFs, > +the control plane could change VFs behavior such as change promiscous > +mode, stats reset, etc. our statistical data information is independent > +on the control plane and data plane. > + > +Prerequisites > +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > +Create two VFs and two VFs representor ports which are used as control > plane. > + > +1. bind PF to igb_uio:: > + > + ./usertools/dpdk-devbind.py -b igb_uio 0000:af:00.0 > + > +2. create two VFs from PF:: > + > + echo 2 > /sys/bus/pci/devices/0000\:af\:00.0/max_vfs > + > +3. bind two VFs to vfio-pci:: > + > + ./usertools/dpdk-devbind.py -b vfio-pci 0000:af:02.0 0000:af:02.1 > + > +4. start a testpmd with create 2 VFs representor ports as control plane > named testpmd-pf:: > + > + ./testpmd --lcores 1,2 -n 4 -w af:00.0,representor=3D0-1 --socket-me= m > 1024,1024 \ > + --proc-type auto --file-prefix testpmd-pf -- -i > + --port-topology=3Dchained > + > +5. start two testpmd as dataplane named testpmd-vf0/testpmd-vf1(case 3 > run later):: > + > + ./testpmd --lcores 3,4 -n 4 -w af:02.0 --socket-mem 1024,1024 --proc= -type > auto --file-prefix testpmd-vf0 -- -i > + ./testpmd --lcores 5,6 -n 4 -w af:02.1 --socket-mem 1024,1024 > + --proc-type auto --file-prefix testpmd-vf1 -- -i > + > +Note: Every case needs to restart testpmd. > + > +Test Cases > +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > + > +1. Test Case 1: VF Stats show and clear [ixgbe not support] > +----------------------------------------------------------- > +Description: use control testpmd to get and clear dataplane testpmd port= s > Stats. > + > +1. prepare 3 testpmd to receive packets:: > + > + PF testpmd> set promisc 0 off > + PF testpmd> start > + VF0 testpmd> set promisc 0 off > + VF0 testpmd> start > + VF1 testpmd> set promisc 0 off > + VF1 testpmd> start > + > +2. send 30 packets by scapy as below:: > + > + scapy> pkt1=3DEther(src=3Dsrc_mac, dst=3Dpf_mac)/IP() > + scapy> pkt2=3DEther(src=3Dsrc_mac, dst=3Dvf0_mac)/IP() > + scapy> pkt3=3DEther(src=3Dsrc_mac, dst=3Dvf1_mac)/IP() > + scapy> pkts=3D[pkt1, pkt2, pkt3]*10 > + scapy> sendp(pkts, iface=3D"ens785f0") > + > +3. check port stats in control testpmd, it will show 1 PF and 2 VF stats= :: > + > + PF testpmd> show port stats all > + > + expected result: > + VF0 and VF1 will show receive 10 packets separately in control testmpd= . > + > +4. clear port stats in control testpmd:: > + > + PF testpmd> clear vf stats 0 0 > + PF testpmd> clear vf stats 0 1 > + PF testpmd> clear port stats all > + PF testpmd> show port stats all > + > + expected result: > + all the testpmd's port stats should be cleared > + > +Note: PF statistics superimpose the number of VFs, and the independent > command > + 'clear vf stats ' to clear this part of the data. > + > +2. Test Case 2: VF Promiscous enable/disable > +-------------------------------------------- > +Description: use control testpmd to enable/disable dataplane testpmd por= ts > promiscous mode. > + > +1. prepare 3 testpmd to receive packets, turn on VF0 promisc mode in > control testpmd:: > + > + PF testpmd> set promisc 0 off > + PF testpmd> start > + VF0 testpmd> set promisc 0 off > + VF0 testpmd> start > + VF1 testpmd> set promisc 0 off > + VF1 testpmd> start > + PF testpmd> set promisc 1 on > + > +2. send 40 packets by scapy as below:: > + > + scapy> pkt1=3DEther(src=3Dsrc_mac, dst=3Dpf_mac)/IP() > + scapy> pkt2=3DEther(src=3Dsrc_mac, dst=3Dvf0_mac)/IP() > + scapy> pkt3=3DEther(src=3Dsrc_mac, dst=3Dvf1_mac)/IP() > + scapy> pkt4=3DEther(src=3Dsrc_mac, dst=3Dunicast_mac)/IP() > + scapy> pkts=3D[pkt1, pkt2, pkt3, pkt4]*10 > + scapy> sendp(pkts, iface=3D"ens785f0") > + > +3. check port stats in DUT:: > + > + PF testpmd> show port stats all > + > + expected result: > + VF0 should receive 20 packets(10 vf0_mac and 10 unicast_mac) and VF1 > + show receive 10 packets in representor ports of PF. > + > +3. Test Case 3: set VF MAC address > +---------------------------------- > +Description: use control testpmd to set vf mac address > + > +1. Run PF testpmd with PF first, set VF0 and VF1 mac address use > representor ports:: > + > + PF testpmd> mac_addr set 1 aa:11:22:33:44:55 > + PF testpmd> mac_addr set 2 aa:22:33:44:55:66 > + PF testpmd> set promisc 0 off > + PF testpmd> start > + > +2. Run VFs testpmd, and turn off promisc mode:: > + > + VF0 testpmd> set promisc 0 off > + VF0 testpmd> start > + VF1 testpmd> set promisc 0 off > + VF1 testpmd> start > + > +3. use test case 2 step 2 to send packets from traffic generator > + > +4. check port stats in DUT:: > + > + PF testpmd> show port stats all > + > + expected result: > + VF0 should receive 10 packets and VF1 show receive 10 packets in > representor ports of PF. > + > +4. Test Case 4: set vlan filter > +------------------------------- > +Description: use control testpmd to set vlan > + > +1. set promisc mode off in control testpmd, turn on vlan filter, add vla= n > filter in each VF:: > + > + PF testpmd> set promisc 1 off > + PF testpmd> vlan set filter on 1 > + PF testpmd> rx_vlan add 3 1 > + PF testpmd> set promisc 2 off > + PF testpmd> vlan set filter on 2 > + PF testpmd> rx_vlan add 4 2 > + VF0 testpmd> start > + VF1 testpmd> start > + > + > +2. use scapy to send packets as below:: > + > + scapy> pkt1=3DEther(src=3Dsrc_mac, dst=3Dvf0_mac)/Dot1Q(vlan=3D3)/IP= () > + scapy> pkt2=3DEther(src=3Dsrc_mac, dst=3Dvf1_mac)/Dot1Q(vlan=3D4)/IP= () > + scapy> pkts=3D[pkt1, pkt2]*10 > + scapy> sendp(pkts, iface=3D"ens785f0") > + > +3. check port stats in 2 VF testpmd: > + expected result: > + 2 VF testpmds should receive 10 packets separately. > + > + > + > + > + > + > + > -- > 2.21.0.windows.1