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 498F7A0564; Tue, 24 Mar 2020 07:52:04 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 3A6B51C0C3; Tue, 24 Mar 2020 07:52:04 +0100 (CET) Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by dpdk.org (Postfix) with ESMTP id 148541C02D for ; Tue, 24 Mar 2020 07:52:02 +0100 (CET) IronPort-SDR: r+KWd3FBLHhS+nrrMVd5CyvEmaj8nDu7kUylVyS67mAaTSRxzI/KylR/zCJVkyY5Uc5AVmtDMj Gaq5gF2UTkmg== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Mar 2020 23:52:02 -0700 IronPort-SDR: AMgP5pZyF/YrvKQaIboaXm38pnn8XyTI0DaUZ764gL/qNUqzQSMasm+altOB7zF7KJJYwiJM3c AqqPSGQ/VKnw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.72,299,1580803200"; d="scan'208";a="393183181" Received: from fmsmsx107.amr.corp.intel.com ([10.18.124.205]) by orsmga004.jf.intel.com with ESMTP; 23 Mar 2020 23:52:02 -0700 Received: from fmsmsx608.amr.corp.intel.com (10.18.126.88) by fmsmsx107.amr.corp.intel.com (10.18.124.205) with Microsoft SMTP Server (TLS) id 14.3.439.0; Mon, 23 Mar 2020 23:52:01 -0700 Received: from fmsmsx608.amr.corp.intel.com (10.18.126.88) by fmsmsx608.amr.corp.intel.com (10.18.126.88) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Mon, 23 Mar 2020 23:52:01 -0700 Received: from shsmsx154.ccr.corp.intel.com (10.239.6.54) by fmsmsx608.amr.corp.intel.com (10.18.126.88) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.1.1713.5 via Frontend Transport; Mon, 23 Mar 2020 23:52:01 -0700 Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.43]) by SHSMSX154.ccr.corp.intel.com ([169.254.7.145]) with mapi id 14.03.0439.000; Tue, 24 Mar 2020 14:51:59 +0800 From: "Tu, Lijuan" To: "Wang, Yinan" , "dts@dpdk.org" CC: "Wang, Yinan" Thread-Topic: [dts] [PATCH v1] test_plans: add vdev_primary_secondary hotplug test case Thread-Index: AQHWAXictVib+vuH6ESVZvUFUvpHXahXTnmA Date: Tue, 24 Mar 2020 06:51:59 +0000 Message-ID: <8CE3E05A3F976642AAB0F4675D0AD20E0BBF0A7B@SHSMSX101.ccr.corp.intel.com> References: <20200323180112.6172-1-yinan.wang@intel.com> In-Reply-To: <20200323180112.6172-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.2.0.6 dlp-reaction: no-action 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 vdev_primary_secondary hotplug test case 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: Tuesday, March 24, 2020 2:01 AM > To: dts@dpdk.org > Cc: Wang, Yinan > Subject: [dts] [PATCH v1] test_plans: add vdev_primary_secondary hotplug > test case >=20 > From: Wang Yinan >=20 > Signed-off-by: Wang Yinan > --- > .../vdev_primary_secondary_test_plan.rst | 132 +++++++++++++++--- > 1 file changed, 112 insertions(+), 20 deletions(-) >=20 > diff --git a/test_plans/vdev_primary_secondary_test_plan.rst > b/test_plans/vdev_primary_secondary_test_plan.rst > index bbea632..8cb1405 100644 > --- a/test_plans/vdev_primary_secondary_test_plan.rst > +++ b/test_plans/vdev_primary_secondary_test_plan.rst > @@ -1,4 +1,4 @@ > -.. Copyright (c) <2016>, Intel Corporation > +.. Copyright (c) <2020>, Intel Corporation > All rights reserved. >=20 > Redistribution and use in source and binary forms, with or without @@= - > 30,12 +30,12 @@ > ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF > ADVISED > OF THE POSSIBILITY OF SUCH DAMAGE. >=20 > -=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 > +=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 > +Virtio-pmd primary/secondary process 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=3D >=20 > -This test plan will test vdev primary/secondary by symmetric multi-proce= ss > example, which demonstrates how a set of processes can run in parallel, - > with each process performing the same set of packet processing operations= . > +This test plan will test vdev primary/secondary with symmetric_mp, > +which demonstrates how a set of processes can run in parallel, with each > process performing the same set of packet processing operations. Also tes= t > vdev primary/secondary with hotplug_mp example. >=20 > Symmetric MP Application Description > ------------------------------------ > @@ -88,8 +88,37 @@ 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. >=20 > -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 > +Hotplug MP Application Description > +---------------------------------- > + > +Currently secondary process will only sync ethdev from primary process > +at init stage, but it will not be aware if device is attached/detached > +on primary process at runtime. > + > +While there is the requirement from application that take > +primary-secondary process model. The primary process work as a resource > +management process, it will create/destroy virtual device at runtime, > +while the secondary process deal with the network stuff with these devic= es. > + > +So the orignial intention is to fix this gap, but beyond that the patch > +set provide a more comprehesive solution to handle different hotplug > +cases in multi-process situation, it cover below scenario: > + > +* Attach a device from the primary > +* Detach a device from the primary > +* Attach a device from a secondary > +* Detach a device from a secondary > + > +In primary-secondary process model, we assume ethernet devices are > +shared by default, that means attach or detach a device on any process > +will broadcast to all other processes through mp channel then device > +information will be synchronized on all processes. > + > +Any failure during attaching process will cause inconsistent status > +between processes, so proper rollback action should be considered. > + > +Test Case 1: Virtio-pmd primary and secondary process symmetric 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=3D=3D=3D=3D=3D=3D=3D=3D=3D > =3D=3D=3D=3D=3D >=20 > SW preparation: Change one line of the symmetric_mp sample and rebuild:: >=20 > @@ -104,15 +133,17 @@ SW preparation: Change one line of the > symmetric_mp sample and rebuild:: >=20 > 2. Launch VM with two virtio ports, must set queues=3D2 as app receive > packets from special queue which index same with proc-id:: >=20 > - 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,v > ectors=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,v > ectors=3D15 \ > - -vnc :10 -daemonize > + qemu-system-x86_64 -name vm1 -enable-kvm -cpu host -smp 4 -m 4096 \ > + -object memory-backend-file,id=3Dmem,size=3D4096M,mem- > path=3D/mnt/huge,share=3Don \ > + -numa node,memdev=3Dmem -mem-prealloc -drive > file=3D/home/osimg/ubuntu16.img \ > + -chardev socket,path=3D/tmp/vm2_qga0.sock,server,nowait,id=3Dvm2_qga= 0 - > device virtio-serial \ > + -device virtserialport,chardev=3Dvm2_qga0,name=3Dorg.qemu.guest_agen= t.2 > -daemonize \ > + -monitor unix:/tmp/vm2_monitor.sock,server,nowait -device > e1000,netdev=3Dnttsip1 \ > + -netdev user,id=3Dnttsip1,hostfwd=3Dtcp:127.0.0.1:6002-:22 \ > + -chardev socket,id=3Dchar,path=3D./vhost-net,server -netdev type=3Dv= host- > 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,v > ectors=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=3Do > + n,mq=3Don,vectors=3D15 -vnc :10 -daemonize >=20 > 3. Bind virtio port to igb_uio:: >=20 > @@ -121,10 +152,71 @@ SW preparation: Change one line of the > symmetric_mp sample and rebuild:: >=20 > 4. Launch two process by example:: >=20 > - 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 > + ./examples/multi_process/symmetric_mp/build/symmetric_mp -l 1 -n 4 - > -proc-type=3Dauto -- -p 3 --num-procs=3D2 --proc-id=3D0 > + ./examples/multi_process/symmetric_mp/build/symmetric_mp -l 2 -n 4 > + --proc-type=3Dsecondary -- -p 3 --num-procs=3D2 --proc-id=3D1 >=20 > 5. Quit all process, check the packets number in rx/tx statistic like be= low for > both primary process and secondary process:: >=20 > Port 0: RX - 27511680, TX - 256, Drop - 27499168 > - Port 1: RX - 27499424, TX - 256, Drop - 27511424 > \ No newline at end of file > + Port 1: RX - 27499424, TX - 256, Drop - 27511424 > + > +Test Case 2: Virtio-pmd primary and secondary process hotplug 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=3D=3D=3D=3D=3D=3D=3D=3D=3D > =3D=3D=3D > + > +1. 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 vm1 -enable-kvm -cpu host -smp 4 -m 4096 \ > + -object memory-backend-file,id=3Dmem,size=3D4096M,mem- > path=3D/mnt/huge,share=3Don \ > + -numa node,memdev=3Dmem -mem-prealloc -drive > file=3D/home/osimg/ubuntu16.img \ > + -chardev socket,path=3D/tmp/vm2_qga0.sock,server,nowait,id=3Dvm2_qga= 0 - > device virtio-serial \ > + -device virtserialport,chardev=3Dvm2_qga0,name=3Dorg.qemu.guest_agen= t.2 > -daemonize \ > + -monitor unix:/tmp/vm2_monitor.sock,server,nowait -device > e1000,netdev=3Dnttsip1 \ > + -netdev user,id=3Dnttsip1,hostfwd=3Dtcp:127.0.0.1:6002-:22 \ > + -chardev socket,id=3Dchar,path=3D./vhost-net,server -netdev type=3Dv= host- > 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,v > ectors=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=3Do > + n,mq=3Don,vectors=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. Start sample code as primary process:: > + > + ./examples/multi_process/hotplug_mp/build/hotplug_mp --proc- > type=3Dauto -- -p 3 --num-procs=3D2 --proc-id=3D0 > + example> list > + list all etherdev > + 0 0000:00:05.0 > + 1 0000:00:06.0 > + > +5. Start sample code as secondary process:: > + > + ./examples/multi_process/hotplug_mp/build/hotplug_mp --proc- > type=3Dsecondary -- -p 3 --num-procs=3D2 --proc-id=3D1 > + example> list > + list all etherdev > + 0 0000:00:05.0 > + 1 0000:00:06.0 > + > +6. Detach the virtual device from primary, check primary and secondary > processes detach the share device successfully:: > + > + example> detach 0000:00:05.0 > + example> list > + list all etherdev > + 1 0000:00:06.0 > + > +7. Attach a virtual device from secondary, check primary and secondary > processes attach the share device successfully:: > + > + example> attach 0000:00:05.0 > + example> list > + list all etherdev > + 0 0000:00:05.0 > + 1 0000:00:06.0 > + > +8. Repeat above attach and detach for 2 times. > -- > 2.17.1