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 97A7F5A0A for ; Tue, 9 Jun 2015 11:29:29 +0200 (CEST) Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga101.fm.intel.com with ESMTP; 09 Jun 2015 02:29:27 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.13,579,1427785200"; d="scan'208";a="723747349" Received: from pgsmsx104.gar.corp.intel.com ([10.221.44.91]) by fmsmga001.fm.intel.com with ESMTP; 09 Jun 2015 02:29:23 -0700 Received: from shsmsx152.ccr.corp.intel.com (10.239.6.52) by PGSMSX104.gar.corp.intel.com (10.221.44.91) with Microsoft SMTP Server (TLS) id 14.3.224.2; Tue, 9 Jun 2015 17:29:01 +0800 Received: from shsmsx103.ccr.corp.intel.com ([169.254.4.23]) by SHSMSX152.ccr.corp.intel.com ([169.254.6.50]) with mapi id 14.03.0224.002; Tue, 9 Jun 2015 17:28:59 +0800 From: "Liu, Yong" To: "Liu, Jijiang" , "dev@dpdk.org" Thread-Topic: [dpdk-dev] [PATCH v3 00/10] Add a VXLAN sample Thread-Index: AQHQoZe4I7mimeVY70mlmYqeXXZpnJ2j6jUw Date: Tue, 9 Jun 2015 09:28:59 +0000 Message-ID: <86228AFD5BCD8E4EBFD2B90117B5E81E10E3A37F@SHSMSX103.ccr.corp.intel.com> References: <1433732508-32430-1-git-send-email-jijiang.liu@intel.com> In-Reply-To: <1433732508-32430-1-git-send-email-jijiang.liu@intel.com> Accept-Language: zh-CN, 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 v3 00/10] Add a VXLAN sample 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: Tue, 09 Jun 2015 09:29:30 -0000 Tested-by: Yong Liu - Tested Commit: c1715402df8f7fdb2392e12703d5b6f81fd5f447 - OS: Fedora20 3.15.5 - GCC: gcc version 4.8.3 20140911 - CPU: Intel(R) Xeon(R) CPU E5-2699 v3 @ 2.30GHz - NIC: Intel Corporation Device XL710 [8086:1584] Firmware 4.33 - Default x86_64-native-linuxapp-gcc configuration - Prerequisites: set up dpdk vhost-user running environment allocate enough hugepages for both vxlan sample and virtual machine - Total 5 cases, 5 passed, 0 failed - Prerequisites command / instruction: Update qemu-system-x86_64 to version 2.2.0 which support hugepage based m= emory Prepare vhost-use requested modules modprobe fuse modprobe cuse insmod lib/librte_vhost/eventfd_link/eventfd_link.ko Allocate 4096*2M hugepages for vm and dpdk echo 4096 > /sys/kernel/mm/hugepages/hugepages-2048kB/nr_hugepages =09 - Case: vxlan_sample_encap Description: check vxlan sample encap function work fine Command / instruction: Start vxlan sample with only encapsulation enable tep_termination -c 0xf -n 3 --socket-mem 2048,2048 -- -p 0x1 \ --udp-port 4789 --nb-devices 2 --filter-type 3 --tx-checksum 0 \ --encap 1 --decap 0 Wait for vhost-net socket device created and message dumped. VHOST_CONFIG: bind to vhost-net Start virtual machine with hugepage based memory and two vhost-user dev= ices qemu-system-x86_64 -name vm0 -enable-kvm -daemonize \ -cpu host -smp 4 -m 4096 \ -object memory-backend-file,id=3Dmem,size=3D4096M,mem-path=3D/mnt/h= uge,share=3Don \ -numa node,memdev=3Dmem -mem-prealloc \ -chardev socket,id=3Dchar0,path=3D./dpdk/vhost-net \ -netdev type=3Dvhost-user,id=3Dnetdev0,chardev=3Dchar0,vhostforce \ -device virtio-net-pci,netdev=3Dnetdev0,mac=3D00:00:20:00:00:20 \ -chardev socket,id=3Dchar1,path=3D./dpdk/vhost-net \ -netdev type=3Dvhost-user,id=3Dnetdev1,chardev=3Dchar1,vhostforce \ -device virtio-net-pci,netdev=3Dnetdev1,mac=3D00:00:20:00:00:21 \ -drive file=3D/storage/vm-image/vm0.img -vnc :1 Login into virtual machine and start testpmd with additional arguments testpmd -c f -n 3 -- -i --txqflags=3D0xf00 --disable-hw-vlan Start packet forward of testpmd and transit several packets for mac lea= rning testpmd> set fwd mac testpmd> start tx_first Make sure virtIO port registered normally. VHOST_CONFIG: virtio is now ready for processing. VHOST_DATA: (1) Device has been added to data core 56 VHOST_DATA: (1) MAC_ADDRESS 00:00:20:00:00:21 and VNI 1000 registered VHOST_DATA: (0) MAC_ADDRESS 00:00:20:00:00:20 and VNI 1000 registered Send normal udp packet to PF device and packet dmac match PF device=20 Verify packet has been recevied in virtIO port0 and forwarded by port1 testpmd> show port stats all Verify encapsulated packet received on PF device - Case: vxlan_sample_decap Description: check vxlan sample decap function work fine Command / instruction: Start vxlan sample with only de-capsulation enable tep_termination -c 0xf -n 3 --socket-mem 2048,2048 -- -p 0x1 \ --udp-port 4789 --nb-devices 2 --filter-type 3 --tx-checksum 0 \ --encap 0 --decap 1 Start vhost-user test environment like case vxlan_sample_encap Send vxlan packet Ether(dst=3DPF mac)/IP/UDP/vni(1000)/ Ether(dst=3DvirtIO port0)/IP/UDP to PF device Verify that packet received by virtIO port0 and forwarded by virtIO port1. testpmd> show port stats all Verify that PF received packet just the same as inner packet Send vxlan packet Ether(dst=3DPF mac)/IP/UDP/vni(1000)/ Ether(dst=3DvirtIO port1)/IP/UDP to PF device Verify that packet received by virtIO port1 and forwarded by virtIO port0. testpmd> show port stats all=09 Make sure PF received packet received inner packet with mac reversed. =09 - Case: vxlan_sample_encap_and_decap Description: check vxlan sample decap&encap work fine in the same time Command / instruction: Start vxlan sample with only de-capsulation enable tep_termination -c 0xf -n 3 --socket-mem 2048,2048 -- -p 0x1 \ --udp-port 4789 --nb-devices 2 --filter-type 3 --tx-checksum 0 \ --encap 1 --decap 1 Start vhost-user test environment like case vxlan_sample_encap Ether(dst=3DPF mac)/IP/UDP/vni(1000)/ Ether(dst=3DvirtIO port0)/IP/UDP Send vxlan packet Ether(dst=3DPF mac)/IP/UDP/vni(1000)/ Ether(dst=3DvirtIO port0)/IP/UDP to PF device Verify that packet received by virtIO port0 and forwarded by virtIO port1. testpmd> show port stats all Verify encapsulated packet received on PF device. Verify that inner packet src and dst mac address have been conversed. =09 - Case: vxlan_sample_chksum=09 Description: check vxlan sample transmit checksum work fine Command / instruction: Start vxlan sample with only decapsulation enable tep_termination -c 0xf -n 3 --socket-mem 2048,2048 -- -p 0x1 \ --udp-port 4789 --nb-devices 2 --filter-type 3 --tx-checksum 1 \ --encap 1 --decap 1 Start vhost-user test environment like case vxlan_sample_encap Send vxlan packet with Ether(dst =3D PF mac)/IP/UDP/vni(1000)/=20 Ether(dst =3D virtIO port0)/IP wrong chksum/ UDP wrong chksum Verify that packet recevied by virtIO port0 and forwarded by virtIO port1. testpmd> show port stats all Verify encapsulated packet received on PF device. Verify that inner packet src and dst mac address have been conversed. Verify that inner packet ip checksum and udp checksum were corrected. =09 Send vxlan packet with Ether(dst =3D PF mac)/IP/UDP/vni(1000)/=20 Ether(dst =3D virtIO port0)/IP wrong chksum/ TCP wrong chksum Verify that packet recevied by virtIO port0 and forwarded by virtIO port1. testpmd> show port stats all Verify encapsulated packet received on PF device. Verify that inner packet src and dst mac address have been conversed. Verify that inner packet ip checksum and tcp checksum were corrected. =09 Send vxlan packet with Ether(dst =3D PF mac)/IP/UDP/vni(1000)/=20 Ether(dst =3D virtIO port0)/IP wrong chksum/ SCTP wrong chksum Verify that packet received by virtIO port0 and forwarded by virtIO port1. testpmd> show port stats all Verify encapsulated packet received on PF device. Verify that inner packet src and dst mac address have been conversed. Verify that inner packet ip checksum and sctp checksum were corrected. - Case: vxlan_sample_tso Description: check vxlan sample tso work fine Command / instruction: Start vxlan sample with tso enable, tx checksum must enable too For hardware limitation, tso segment size must be larger 256=20 tep_termination -c 0xf -n 3 --socket-mem 2048,2048 -- -p 0x1 \ --udp-port 4789 --nb-devices 2 --filter-type 3 --tx-checksum 1 \ --encap 1 --decap 1 --tso-segsz 256 Start vhost-user test environment like case vxlan_sample_encap Send vxlan packet with Ether(dst =3D PF mac)/IP/UDP/vni(1000)/=20 Ether(dst =3D virtIO port0)/TCP/892 Bytes data, total length will be 100= 0 Verify that packet recevied by virtIO port0 and forwarded by virtIO port1. testpmd> show port stats all Verify that four separated vxlan packets received on PF devices. Make sure tcp packet payload is 256, 256, 256 and 124. > -----Original Message----- > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Jijiang Liu > Sent: Monday, June 08, 2015 11:02 AM > To: dev@dpdk.org > Subject: [dpdk-dev] [PATCH v3 00/10] Add a VXLAN sample >=20 > This VXLAN sample simulates a VXLAN Tunnel Endpoint (VTEP) termination in > DPDK, which is used to demonstrate the offload and filtering capabilities > of i40 NIC for VXLAN packet. >=20 > And this sample uses the basic virtio devices management function from > vHost example, and the US-vHost interface and tunnel filtering mechanism > to direct the traffic to/from a specific VM. >=20 > In addition, this sample is also designed to show how tunneling protocols > can be handled. For the vHost interface, we do not need to support zero > copy/inter VM packet transfer, etc. The approaches we took would be of > benefit to you because we put a pluggable structure in place so that the > application could be easily extended to support a new tunneling protocol. >=20 > The software framework is as follows: >=20 >=20 > |-------------------| |-------------------| > | VM-1(VNI:100) | | VM-2(VNI:200) | > | |------| |------| | | |------| |------| | > | |vport0| |vport1| | | |vport0| |vport1| | > |-|------|-|------|-| |-|------|-|------|-| Guests > \ / > |-------------\-------/--------| > | us-vHost interface | > | |-|----|--| | > | decap| | TEP| | encap | DPDK App > | |-|----|--| | > | | | | > |------------|----|------------| > | | > |-------------|----|---------------| > |tunnel filter| | IP/L4 Tx csum | > |IP/L4 csum | | TSO | > |packet type | | | NIC > |packet recogn| | | > |-------------|----|---------------| > | | > | | > | | > /-------\ > VXLAN Tunnel >=20 > The sample will support the followings: > 1> Tunneling packet recognition. >=20 > 2> The port of UDP tunneling is configurable >=20 > 3> Directing incoming traffic to the correct queue based on the tunnel > filter type such as inner MAC address and VNI. >=20 > The VNI will be assigned from a static internal table based on the us- > vHost device ID. Each device will receive a unique device ID. The inner > MAC will be learned by the first packet transmitted from a device. >=20 > 4> Decapsulation of Rx VXLAN traffic. This is a software only operation. >=20 > 5> Encapsulation of Tx VXLAN traffic. This is a software only operation. >=20 > 6> Tx outer IP, inner IP and L4 checksum offload >=20 > 7> TSO support for tunneling packet >=20 > The limitations: > 1. No ARP support. > 2. There are some duplicated source codes because I used the basic virti= o > device management function from VHOST sample. Considering that the curren= t > VHOST sample is quite complicated and huge enough, I think we shall have > a separate sample for tunneling packet processing. > 3. Currently, only the i40e NIC is tested in the sample, but other types > of NICs will also be supported if they are able to support tunneling > packet filter. >=20 > v2 changes: > Fixed an issue about the 'nb_ports' duplication in check_ports_num(). > Removed the inaccurate comment in main.c > Fixed an issue about TSO offload. >=20 > v3 changes: > Changed some viriable name that don't follow coding rules. > Removed the limitation of VXLAN packet size due to TSO support. > Removed useless 'll_root_used' variable in vxlan_setup.c file. > Removed defination and use of '_htons'. >=20 > Jijiang Liu (10): > create VXLAN sample framework using virtio device management function > add basic VXLAN structures > addthe pluggable structures > implement VXLAN packet processing > add udp port configuration > add filter type configuration > add tx checksum offload configuration > add TSO offload configuration > add Rx checksum statistics > add encapsulation and decapsulation flags >=20 >=20 > examples/Makefile | 1 + > examples/tep_termination/Makefile | 55 ++ > examples/tep_termination/main.c | 1205 > ++++++++++++++++++++++++++++++++ > examples/tep_termination/main.h | 129 ++++ > examples/tep_termination/vxlan.c | 262 +++++++ > examples/tep_termination/vxlan.h | 76 ++ > examples/tep_termination/vxlan_setup.c | 444 ++++++++++++ > examples/tep_termination/vxlan_setup.h | 77 ++ > 8 files changed, 2249 insertions(+), 0 deletions(-) > create mode 100644 examples/tep_termination/Makefile > create mode 100644 examples/tep_termination/main.c > create mode 100644 examples/tep_termination/main.h > create mode 100644 examples/tep_termination/vxlan.c > create mode 100644 examples/tep_termination/vxlan.h > create mode 100644 examples/tep_termination/vxlan_setup.c > create mode 100644 examples/tep_termination/vxlan_setup.h >=20 > -- > 1.7.7.6