From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by dpdk.org (Postfix) with ESMTP id ED90DB6AB for ; Thu, 16 Apr 2015 05:56:05 +0200 (CEST) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga103.jf.intel.com with ESMTP; 15 Apr 2015 20:56:05 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.11,585,1422950400"; d="scan'208";a="680919379" Received: from shvmail01.sh.intel.com ([10.239.29.42]) by orsmga001.jf.intel.com with ESMTP; 15 Apr 2015 20:56:04 -0700 Received: from shecgisg004.sh.intel.com (shecgisg004.sh.intel.com [10.239.29.89]) by shvmail01.sh.intel.com with ESMTP id t3G3u2IL005172; Thu, 16 Apr 2015 11:56:02 +0800 Received: from shecgisg004.sh.intel.com (localhost [127.0.0.1]) by shecgisg004.sh.intel.com (8.13.6/8.13.6/SuSE Linux 0.8) with ESMTP id t3G3twcc028741; Thu, 16 Apr 2015 11:56:00 +0800 Received: (from jijiangl@localhost) by shecgisg004.sh.intel.com (8.13.6/8.13.6/Submit) id t3G3twpj028737; Thu, 16 Apr 2015 11:55:58 +0800 From: Jijiang Liu To: dev@dpdk.org, walter.e.gilmore@intel.com, thomas.long@intel.com Date: Thu, 16 Apr 2015 11:55:48 +0800 Message-Id: <1429156558-28548-1-git-send-email-jijiang.liu@intel.com> X-Mailer: git-send-email 1.7.12.2 Subject: [dpdk-dev] [PATCH RFC 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: Thu, 16 Apr 2015 03:56:06 -0000 This VXLAN example 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. And this example uses the basic virtio devices management function from vHost example, and it uses us-Vhost interface and tunnel filtering mechanism to direct the traffic to/from a specific VM. 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 approach that we take would be of benefit to you in that we put a pluggable structure in place so that the application could be easily extended to support a new tunneling protocol. The software framework is as follows: |-------------------| |-------------------| | 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 |CRC strip | | | |-------------|----|---------------| | | | | | | /-------\ VXLAN Tunnel The sample will support the followings: 1> Tunneling packet recognition. 2> The port of UDP tunneling is configurable 3> Directing of incoming traffic to the correct queue based on the tunnel filter type such as inner MAC address and VNI. 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 from the first packet transmitted from a device. 4> Decapsulation of Rx VXLAN traffic. This is a software only operation(will use HW header split instead later) 5> Encapsulation of Tx VXLAN traffic. This is a software only operation 6> Tx outer IP, inner IP and L4 checksum offload 7> TSO support for tunneling packet Limitations: 1. No ARP support 2. There are some duplicated source codes because of using the basic virtio device management function from vhost sample, but consider that current vhost sample is quite complicated and huge enough, and I think we shall have a separate sample for tunneling packet processing. 3. Currently, only the i40e NIC is supported in the sample, but other types of NICs also can be supported later if those NICs are able to support tunneling packet filter. Jijiang Liu (10): create VXLAN sample framework using virtio device management function add basic VXLAN structures add VXLAN operation APIs support overlay operations Add encapsulation and decapsulation function add udp port configuration add filter type configuration add tx checksum offload configuration add TSO offload configuration add encapsulation and decapsulation flags examples/Makefile | 1 + examples/tep_termination/Makefile | 58 ++ examples/tep_termination/main.c | 1117 ++++++++++++++++++++++++++++++++ examples/tep_termination/main.h | 113 ++++ examples/tep_termination/vxlan.c | 242 +++++++ examples/tep_termination/vxlan.h | 81 +++ examples/tep_termination/vxlan_setup.c | 453 +++++++++++++ examples/tep_termination/vxlan_setup.h | 76 +++ 8 files changed, 2141 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 -- 1.7.7.6