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 84738A00E6 for ; Wed, 10 Jul 2019 08:17:15 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 7A5B81B997; Wed, 10 Jul 2019 08:17:15 +0200 (CEST) Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by dpdk.org (Postfix) with ESMTP id BA5DC4C8E for ; Wed, 10 Jul 2019 08:17:13 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 09 Jul 2019 23:17:12 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.63,473,1557212400"; d="scan'208";a="168214761" Received: from fmsmsx106.amr.corp.intel.com ([10.18.124.204]) by orsmga003.jf.intel.com with ESMTP; 09 Jul 2019 23:17:12 -0700 Received: from fmsmsx120.amr.corp.intel.com (10.18.124.208) by FMSMSX106.amr.corp.intel.com (10.18.124.204) with Microsoft SMTP Server (TLS) id 14.3.439.0; Tue, 9 Jul 2019 23:17:12 -0700 Received: from shsmsx103.ccr.corp.intel.com (10.239.4.69) by fmsmsx120.amr.corp.intel.com (10.18.124.208) with Microsoft SMTP Server (TLS) id 14.3.439.0; Tue, 9 Jul 2019 23:17:12 -0700 Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.134]) by SHSMSX103.ccr.corp.intel.com ([169.254.4.109]) with mapi id 14.03.0439.000; Wed, 10 Jul 2019 14:17:11 +0800 From: "Tu, Lijuan" To: "Wang, Yinan" , "dts@dpdk.org" CC: "Wang, Yinan" Thread-Topic: [dts] [PATCH v1] test_plans: add test plan for vdev primary and secondary test Thread-Index: AQHVLVApa2Szmjrg9k+bi/RhCTpzwqbDc5Lw Date: Wed, 10 Jul 2019 06:17:10 +0000 Message-ID: <8CE3E05A3F976642AAB0F4675D0AD20E0BADEAF5@SHSMSX101.ccr.corp.intel.com> References: <20190627182037.61784-1-yinan.wang@intel.com> In-Reply-To: <20190627182037.61784-1-yinan.wang@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.600.7 dlp-reaction: no-action x-ctpclassification: CTP_NT x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiZWM1NzZlM2UtYTZhMi00YWM2LWI1YjctNGRlNWNiOTM1MWUxIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiSUwzT1c4VktpclNyVVg0bnNxTVc2bU9XT3A1Z01KOUxEY3F3S0ozNThJMmZQb1wvYlhNVHE5Z3RrMXJId25hQzkifQ== 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_plans: add test plan for vdev primary and secondary test 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 Yinan > Sent: Friday, June 28, 2019 2:21 AM > To: dts@dpdk.org > Cc: Wang, Yinan > Subject: [dts] [PATCH v1] test_plans: add test plan for vdev primary and > secondary test >=20 > From: Wang Yinan >=20 > Signed-off-by: Wang Yinan > --- > .../vdev_primary_secondary_test_plan.rst | 130 ++++++++++++++++++ > 1 file changed, 130 insertions(+) > create mode 100644 test_plans/vdev_primary_secondary_test_plan.rst >=20 > diff --git a/test_plans/vdev_primary_secondary_test_plan.rst > b/test_plans/vdev_primary_secondary_test_plan.rst > new file mode 100644 > index 0000000..338c779 > --- /dev/null > +++ b/test_plans/vdev_primary_secondary_test_plan.rst > @@ -0,0 +1,130 @@ > +.. Copyright (c) <2016>, 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 > +Primary/secondary process with vdev test plan > +=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 > + > +This test plan will test vdev primary/secondary by symmetric > +multi-process example, which demonstrates how a set of processes can run > in parallel, with each process performing the same set of packet processi= ng > operations. > + > +Symmetric MP Application Description > +------------------------------------ > + > +This test is a multi-process test which demonstrates how multiple > +processes can work together to perform packet I/O and packet processing > +in parallel, much as other example application work by using multiple > +threads. In this example, each process reads packets from all network > +ports being used - though from a different RX queue in each case. Those > +packets are then forwarded by each process which sends them out by > writing them directly to a suitable TX queue. > + > +Prerequisites > +------------- > + > +Assuming that DPDK build has been set up and the multi-process sample > +applications have been built. It is also assumed that a traffic > +generator has been configured and plugged in to the NIC ports 0 and 1. > + > +Test Methodology > +---------------- > + > +As with the simple_mp example, the first instance of the symmetric_mp > +process must be run as the primary instance, though with a number of > +other application specific parameters also provided after the EAL > +arguments. These additional parameters are: > + > +* -p , where portmask is a hexadecimal bitmask of what ports > +on the > + system are to be used. For example: -p 3 to use ports 0 and 1 only. > +* --num-procs , where N is the total number of symmetric_mp > +instances that > + will be run side-by-side to perform packet processing. This parameter > +is used to > + configure the appropriate number of receive queues on each network por= t. > +* --proc-id , where n is a numeric value in the range 0 <=3D n < N > +(number of > + processes, specified above). This identifies which symmetric_mp > +instance is being > + run, so that each process can read a unique receive queue on each > network port. > + > +The secondary symmetric_mp instances must also have these parameters > +specified, and the first two must be the same as those passed to the > +primary instance, or errors result. > + > +For example, to run a set of four symmetric_mp instances, running on > +lcores 1-4, all performing level-2 forwarding of packets between ports > +0 and 1, the following commands can be used (assuming run as root):: > + > + ./build/symmetric_mp -c 2 --proc-type=3Dauto -- -p 3 --num-procs=3D4 = --proc- > id=3D0 > + ./build/symmetric_mp -c 4 --proc-type=3Dauto -- -p 3 --num-procs=3D4 = --proc- > id=3D1 > + ./build/symmetric_mp -c 8 --proc-type=3Dauto -- -p 3 --num-procs=3D4 = --proc- > id=3D2 > + ./build/symmetric_mp -c 10 --proc-type=3Dauto -- -p 3 --num-procs=3D4 > + --proc-id=3D3 > + > +To run only 1 or 2 instances, the above parameters to the 1 or 2 > +instances being run should remain the same, except for the > +``num-procs`` value, which should be adjusted appropriately. > + > +Test Case 1: Virtio primary and secondary process 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=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D > + > +SW preparation: Change one line of the symmetric_mp sample and rebuild:: > + > + vi ./examples/multi_process/symmetric_mp/main.c > + -.offloads =3D DEV_RX_OFFLOAD_CHECKSUM, > + > +1. Bind one port to igb_uio, launch testpmd by below command:: > + > + ./testpmd -l 1-6 -n 4 --socket-mem 2048,2048 --legacy-mem --file- > prefix=3Dvhost --vdev 'net_vhost,iface=3Dvhost-net,queues=3D2,client=3D1'= --vdev > 'net_vhost1,iface=3Dvhost-net1,queues=3D2,client=3D1' -- -i --nb-cores= =3D4 --rxq=3D2 -- > txq=3D2 --txd=3D1024 --rxd=3D1024 > + testpmd>set fwd txonly > + testpmd>start > + > +2. Launch VM with two virtio ports, must set queues=3D2 as app receive > packets from special queue which index same with proc-id:: > + > + qemu-system-x86_64 -name us-vhost-vm \ > + -cpu host -enable-kvm -m 4096 -object memory-backend- > file,id=3Dmem,size=3D4096M,mem-path=3D/mnt/huge,share=3Don -numa > node,memdev=3Dmem -mem-prealloc \ > + -smp cores=3D4,sockets=3D1 -drive file=3D/home/osimg/ubuntu16.img \ > + -monitor unix:/tmp/vm2_monitor.sock,server,nowait -net > nic,vlan=3D2,macaddr=3D00:00:00:08:e8:aa,addr=3D1f -net > user,vlan=3D2,hostfwd=3Dtcp:127.0.0.1:6002-:22 \ > + -chardev socket,id=3Dchar,path=3D./vhost-net,server -netdev type=3D= vhost- > user,id=3Dmynet1,chardev=3Dchar,vhostforce,queues=3D2 \ > + -device virtio-net- > pci,mac=3D52:54:00:00:00:02,netdev=3Dmynet1,mrg_rxbuf=3Don,csum=3Don,mq= =3Don,ve > ctors=3D15 \ > + -chardev socket,id=3Dchar1,path=3D./vhost-net1,server -netdev type= =3Dvhost- > user,id=3Dmynet2,chardev=3Dchar1,vhostforce,queues=3D2 \ > + -device virtio-net- > pci,mac=3D52:54:00:00:00:03,netdev=3Dmynet2,mrg_rxbuf=3Don,csum=3Don,mq= =3Don,ve > ctors=3D15 \ > + -vnc :10 -daemonize > + > +3. Bind virtio port to igb_uio:: > + > + ./usertools/dpdk-devbind.py --bind=3Digb_uio xx:xx.x > + ./usertools/dpdk-devbind.py --bind=3Digb_uio xx:xx.x > + > +4. Launch two process by example:: > + > + examples/multi_process/symmetric_mp -l 1 -n 4 --proc-type=3Dauto -- = -p 3 - > -num-procs=3D2 --proc-id=3D0 > + examples/multi_process/symmetric_mp -l 2 -n 4 --proc-type=3Dsecondar= y > + -- -p 3 --num-procs=3D2 --proc-id=3D1 > + > +5. Quit all process, check the packets number in rx/tx statistic like be= low for > both primary process and secondary process:: > + > + Port 0: RX - 27511680, TX - 256, Drop - 27499168 > + Port 1: RX - 27499424, TX - 256, Drop - 27511424 > \ No newline at end of file > -- > 2.17.1