From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by dpdk.org (Postfix) with ESMTP id A87EF93A4 for ; Fri, 13 Nov 2015 08:36:15 +0100 (CET) Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga101.fm.intel.com with ESMTP; 12 Nov 2015 23:35:57 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.20,286,1444719600"; d="scan'208";a="599621175" Received: from fmsmsx108.amr.corp.intel.com ([10.18.124.206]) by FMSMGA003.fm.intel.com with ESMTP; 12 Nov 2015 23:35:58 -0800 Received: from fmsmsx112.amr.corp.intel.com (10.18.116.6) by FMSMSX108.amr.corp.intel.com (10.18.124.206) with Microsoft SMTP Server (TLS) id 14.3.248.2; Thu, 12 Nov 2015 23:35:42 -0800 Received: from shsmsx103.ccr.corp.intel.com (10.239.110.14) by FMSMSX112.amr.corp.intel.com (10.18.116.6) with Microsoft SMTP Server (TLS) id 14.3.248.2; Thu, 12 Nov 2015 23:35:41 -0800 Received: from shsmsx102.ccr.corp.intel.com ([169.254.2.42]) by SHSMSX103.ccr.corp.intel.com ([169.254.4.138]) with mapi id 14.03.0248.002; Fri, 13 Nov 2015 15:35:36 +0800 From: "Xu, Qian Q" To: "Liu, Jijiang" , "dev@dpdk.org" Thread-Topic: [dpdk-dev] [PATCH v5 0/4] add virtio offload support in us-vhost Thread-Index: AQHRHULDD+jVdTsI60Sd/4yE1LydOZ6ZkHRA Date: Fri, 13 Nov 2015 07:35:35 +0000 Message-ID: <82F45D86ADE5454A95A89742C8D1410E0317BC80@shsmsx102.ccr.corp.intel.com> References: <1447330026-16685-1-git-send-email-jijiang.liu@intel.com> In-Reply-To: <1447330026-16685-1-git-send-email-jijiang.liu@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: 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: [dpdk-dev] [PATCH v5 0/4] add virtio offload support in us-vhost X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Nov 2015 07:36:16 -0000 Tested-by: Qian Xu - Test Commit: 6b6a94ee17d246a0078cc83257f522d0a6db5409 - OS/Kernel: Fedora 21/4.1.8 - GCC: gcc (GCC) 4.9.2 20141101 (Red Hat 4.9.2-1) - CPU: Intel(R) Xeon(R) CPU E5-2699 v3 @ 2.30GHz - NIC: Intel Corporation 82599ES 10-Gigabit SFI/SFP+ Network Connection (re= v 01) - Target: Intel Corporation 82599ES 10-Gigabit SFI/SFP+ Network Connection = (rev 01) - Total 2 cases, 2 passed. DPDK vhost + legacy virtio can work well with NI= C TSO offload and VM2VM iperf forwards.=20 Test Case1: DPDK vhost user + virtio-net one VM fwd tso =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D HW preparation: Connect 2 ports directly. In our case, connect 81:00.0(port= 1) and 81:00.1(port2) two ports directly. Port1 is binded to igb_uio for vh= ost-sample to use, while port2 is in kernel driver.=20 SW preparation: Change one line of the vhost sample and rebuild:: #In function virtio_tx_route(xxx) m->vlan_tci =3D vlan_tag;=20 #changed to=20 m->vlan_tci =3D 1000; 1. Launch the Vhost sample by below commands, socket-mem is set for the vho= st sample to use, need ensure that the PCI port located socket has the memo= ry. In our case, the PCI BDF is 81:00.0, so we need assign memory for socke= t1. For TSO/CSUM test, we need set "--mergeable 1--tso 1 --csum 1".:: taskset -c 18-20 ./examples/vhost/build/vhost-switch -c 0x1c0000 -n 4 -= -huge-dir /mnt/huge --socket-mem 0,2048 -- -p 1 --mergeable 1 --zero-copy 0= --vm2vm 0 --tso 1 --csum 1 2. Launch VM1 taskset -c 21-22 \ qemu-system-x86_64 -name us-vhost-vm1 \ -cpu host -enable-kvm -m 1024 -object memory-backend-file,id=3Dmem,siz= e=3D1024M,mem-path=3D/mnt/huge,share=3Don -numa node,memdev=3Dmem -mem-prea= lloc \ -smp cores=3D2,sockets=3D1 -drive file=3D/home/img/dpdk-vm1.img \ -chardev socket,id=3Dchar0,path=3D/home/qxu10/vhost-tso-test/dpdk/vhos= t-net -netdev type=3Dvhost-user,id=3Dmynet1,chardev=3Dchar0,vhostforce \ -device virtio-net-pci,mac=3D52:54:00:00:00:01,netdev=3Dmynet1,csum=3D= on,gso=3Don,guest_csum=3Don,guest_tso4=3Don,guest_tso6=3Don,guest_ecn=3Don = \ -netdev tap,id=3Dipvm1,ifname=3Dtap3,script=3D/etc/qemu-ifup -device r= tl8139,netdev=3Dipvm1,id=3Dnet0,mac=3D00:10:00:00:11:01 -nographic 3. On host,configure port2, then you can see there is a interface called en= s260f1.1000.:: =20 ifconfig ens260f1 vconfig add ens260f1 1000 ifconfig ens260f1.1000 1.1.1.8 4. On the VM1, set the virtio IP and run iperf ifconfig ethX 1.1.1.2 ping 1.1.1.8 # let virtio and port2 can ping each other successfully, t= hen the arp table will be set up automatically.=20 =20 5. In host, run : `iperf -s -i 1` ; In guest, run `iperf -c 1.1.1.4 -i 1 -t= 60`, check all the tcpdump packet has 65160 length packet.=20 6. The iperf performance could be relatively stable at ~9.4Gbits/s.=20 Test Case2: DPDK vhost user + virtio-net VM2VM=3D1 fwd tso =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D HW preparation: No special setup needed.=20 1. Launch the Vhost sample by below commands, socket-mem is set for the vho= st sample to use, need ensure that the PCI port located socket has the memo= ry. In our case, the PCI BDF is 81:00.0, so we need assign memory for socke= t1. For TSO/CSUM test, we need set "--mergeable 1--tso 1 --csum 1 --vm2vm 1= ".:: taskset -c 18-20 ./examples/vhost/build/vhost-switch -c 0x1c0000 -n 4 -= -huge-dir /mnt/huge --socket-mem 0,2048 -- -p 1 --mergeable 1 --zero-copy 0= --vm2vm 1 --tso 1 --csum 1 2. Launch VM1 and VM2. :: taskset -c 21-22 \ qemu-system-x86_64 -name us-vhost-vm1 \ -cpu host -enable-kvm -m 1024 -object memory-backend-file,id=3Dmem,siz= e=3D1024M,mem-path=3D/mnt/huge,share=3Don -numa node,memdev=3Dmem -mem-prea= lloc \ -smp cores=3D2,sockets=3D1 -drive file=3D/home/img/dpdk-vm1.img \ -chardev socket,id=3Dchar0,path=3D/home/qxu10/vhost-tso-test/dpdk/vhos= t-net -netdev type=3Dvhost-user,id=3Dmynet1,chardev=3Dchar0,vhostforce \ -device virtio-net-pci,mac=3D52:54:00:00:00:01,netdev=3Dmynet1,csum=3D= on,gso=3Don,guest_csum=3Don,guest_tso4=3Don,guest_tso6=3Don,guest_ecn=3Don = \ -netdev tap,id=3Dipvm1,ifname=3Dtap3,script=3D/etc/qemu-ifup -device r= tl8139,netdev=3Dipvm1,id=3Dnet0,mac=3D00:10:00:00:11:01 -nographic taskset -c 23-24 \ qemu-system-x86_64 -name us-vhost-vm1 \ -cpu host -enable-kvm -m 1024 -object memory-backend-file,id=3Dmem,siz= e=3D1024M,mem-path=3D/mnt/huge,share=3Don -numa node,memdev=3Dmem -mem-prea= lloc \ -smp cores=3D2,sockets=3D1 -drive file=3D/home/img/vm1.img \ -chardev socket,id=3Dchar1,path=3D/home/qxu10/vhost-tso-test/dpdk/vhos= t-net -netdev type=3Dvhost-user,id=3Dmynet2,chardev=3Dchar1,vhostforce \ -device virtio-net-pci,mac=3D52:54:00:00:00:02,netdev=3Dmynet2 \ -netdev tap,id=3Dipvm1,ifname=3Dtap4,script=3D/etc/qemu-ifup -device r= tl8139,netdev=3Dipvm1,id=3Dnet0,mac=3D00:10:00:00:11:02 -nographic 3. On VM1, set the virtio IP and run iperf ifconfig ethX 1.1.1.2 arp -s 1.1.1.8 52:54:00:00:00:02 arp # to check the arp table is complete and correct.=20 4. On VM2, set the virtio IP and run iperf ifconfig ethX 1.1.1.8 arp -s 1.1.1.2 52:54:00:00:00:01 arp # to check the arp table is complete and correct.=20 =20 5. Ensure virtio1 can ping virtio2. Then in VM1, run : `iperf -s -i 1` ; In= VM2, run `iperf -c 1.1.1.4 -i 1 -t 60`, check all the tcpdump packet has 6= 5160 length packet. Thanks Qian -----Original Message----- From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Jijiang Liu Sent: Thursday, November 12, 2015 8:07 PM To: dev@dpdk.org Subject: [dpdk-dev] [PATCH v5 0/4] add virtio offload support in us-vhost Adds virtio offload support in us-vhost. =20 The patch set adds the feature negotiation of checksum and TSO between us-v= host and vanilla Linux virtio guest, and add these offload features support= in the vhost lib, and change vhost sample to test them. v5 changes: Add more clear descriptions to explain these changes. reset the 'virtio_net_hdr' value in the virtio_enqueue_offload() function= . reorganize patches.=20 =20 =20 v4 change: remove virtio-net change, only keep vhost changes. add guest TX offload capabilities to support VM to VM case. split the cleanup code as a separate patch. =20 v3 change: rebase latest codes. =20 v2 change: fill virtio device information for TX offloads. *** BLURB HERE *** Jijiang Liu (4): add vhost offload capabilities remove ipv4_hdr structure from vhost sample. add guest offload setting ln the vhost lib. change vhost application to test checksum and TSO for VM to NIC case examples/vhost/main.c | 120 ++++++++++++++++++++++++++++----- lib/librte_vhost/vhost_rxtx.c | 150 +++++++++++++++++++++++++++++++++++++= +++- lib/librte_vhost/virtio-net.c | 9 ++- 3 files changed, 259 insertions(+), 20 deletions(-) --=20 1.7.7.6