From patchwork Wed Sep 2 11:14:53 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Timo Puha X-Patchwork-Id: 513482 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from archives.nicira.com (li376-54.members.linode.com [96.126.127.54]) by ozlabs.org (Postfix) with ESMTP id B5A66140187 for ; Wed, 2 Sep 2015 21:15:05 +1000 (AEST) Received: from archives.nicira.com (localhost [127.0.0.1]) by archives.nicira.com (Postfix) with ESMTP id B55B2109FF; Wed, 2 Sep 2015 04:15:04 -0700 (PDT) X-Original-To: dev@openvswitch.org Delivered-To: dev@openvswitch.org Received: from mx1e3.cudamail.com (mx1.cudamail.com [69.90.118.67]) by archives.nicira.com (Postfix) with ESMTPS id 5C686109FB for ; Wed, 2 Sep 2015 04:15:04 -0700 (PDT) Received: from bar5.cudamail.com (localhost [127.0.0.1]) by mx1e3.cudamail.com (Postfix) with ESMTPS id 83BF34203FC for ; Wed, 2 Sep 2015 05:15:03 -0600 (MDT) X-ASG-Debug-ID: 1441192501-09eadd133cd9440001-byXFYA Received: from mx1-pf2.cudamail.com ([192.168.24.2]) by bar5.cudamail.com with ESMTP id JVeXDFhuTvDczhXt (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Wed, 02 Sep 2015 05:15:01 -0600 (MDT) X-Barracuda-Envelope-From: tpuhax@ecsmtp.ir.intel.com X-Barracuda-RBL-Trusted-Forwarder: 192.168.24.2 Received: from unknown (HELO mga03.intel.com) (134.134.136.65) by mx1-pf2.cudamail.com with SMTP; 2 Sep 2015 11:15:01 -0000 Received-SPF: none (mx1-pf2.cudamail.com: domain at ecsmtp.ir.intel.com does not designate permitted sender hosts) X-Barracuda-Apparent-Source-IP: 134.134.136.65 X-Barracuda-RBL-IP: 134.134.136.65 Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga103.jf.intel.com with ESMTP; 02 Sep 2015 04:15:00 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.17,453,1437462000"; d="scan'208";a="760758836" Received: from irvmail001.ir.intel.com ([163.33.26.43]) by orsmga001.jf.intel.com with ESMTP; 02 Sep 2015 04:14:58 -0700 Received: from sivswdev01.ir.intel.com (sivswdev01.ir.intel.com [10.237.217.45]) by irvmail001.ir.intel.com (8.14.3/8.13.6/MailSET/Hub) with ESMTP id t82BEwCs019560; Wed, 2 Sep 2015 12:14:58 +0100 Received: from sivswdev01.ir.intel.com (localhost [127.0.0.1]) by sivswdev01.ir.intel.com with ESMTP id t82BEw1d018106; Wed, 2 Sep 2015 12:14:58 +0100 Received: (from tpuhax@localhost) by sivswdev01.ir.intel.com with id t82BEwYQ018102; Wed, 2 Sep 2015 12:14:58 +0100 X-CudaMail-Envelope-Sender: tpuhax@ecsmtp.ir.intel.com From: Timo Puha To: dev@openvswitch.org X-CudaMail-MID: CM-E2-901010382 X-CudaMail-DTE: 090215 X-CudaMail-Originating-IP: 134.134.136.65 Date: Wed, 2 Sep 2015 12:14:53 +0100 X-ASG-Orig-Subj: [##CM-E2-901010382##][PATCH v2] dpdk: add support for v2.1.0 Message-Id: <1441192493-18058-1-git-send-email-timox.puha@intel.com> X-Mailer: git-send-email 1.7.4.1 X-GBUdb-Analysis: 0, 134.134.136.65, Ugly c=0 p=0 Source New X-MessageSniffer-Rules: 0-0-0-10876-c X-Barracuda-Connect: UNKNOWN[192.168.24.2] X-Barracuda-Start-Time: 1441192501 X-Barracuda-Encrypted: DHE-RSA-AES256-SHA X-Barracuda-URL: https://web.cudamail.com:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at cudamail.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.60 X-Barracuda-Spam-Status: No, SCORE=0.60 using per-user scores of TAG_LEVEL=3.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=3.0 tests=BSF_SC5_MJ1963, RDNS_NONE X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.22151 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.10 RDNS_NONE Delivered to trusted network by a host with no rDNS 0.50 BSF_SC5_MJ1963 Custom Rule MJ1963 Subject: [ovs-dev] [PATCH v2] dpdk: add support for v2.1.0 X-BeenThere: dev@openvswitch.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dev-bounces@openvswitch.org Sender: "dev" Update relevant artifacts to add support for DPDK v2.1.0 - INSTALL.DPDK.md - acinclude.m4: Change DPDK library name - netdev-dpdk: Limit minimum mbuf size to to adapt to DPDK bug fix that changes the treatment of the requested mbuf size - build.sh: Change DPDK version number Note that this breaks compatibility with DPDK v2.0.0 although only for the library name change. Note that throughput for vhost ports with mergeable buffers is reduced about 10% due to a necessary bug fix in DPDK vhost code. Signed-off-by: Mark Kavanagh Signed-off-by: Michal Weglicki Signed-off-by: Timo Puha --- .travis/build.sh | 2 +- INSTALL.DPDK.md | 17 ++++++----------- acinclude.m4 | 2 +- lib/netdev-dpdk.c | 12 +++++++++--- 4 files changed, 17 insertions(+), 16 deletions(-) diff --git a/.travis/build.sh b/.travis/build.sh index e90f4d0..3cadbf0 100755 --- a/.travis/build.sh +++ b/.travis/build.sh @@ -71,7 +71,7 @@ fi if [ "$DPDK" ]; then if [ -z "$DPDK_VER" ]; then - DPDK_VER="2.0.0" + DPDK_VER="2.1.0" fi install_dpdk $DPDK_VER if [ "$CC" = "clang" ]; then diff --git a/INSTALL.DPDK.md b/INSTALL.DPDK.md index 35dd9a0..8834c1d 100644 --- a/INSTALL.DPDK.md +++ b/INSTALL.DPDK.md @@ -16,7 +16,7 @@ OVS needs a system with 1GB hugepages support. Building and Installing: ------------------------ -Required: DPDK 2.0 +Required: DPDK 2.1 Optional (if building with vhost-cuse): `fuse`, `fuse-devel` (`libfuse-dev` on Debian/Ubuntu) @@ -24,7 +24,7 @@ on Debian/Ubuntu) 1. Set `$DPDK_DIR` ``` - export DPDK_DIR=/usr/src/dpdk-2.0 + export DPDK_DIR=/usr/src/dpdk-2.1 cd $DPDK_DIR ``` @@ -33,11 +33,6 @@ on Debian/Ubuntu) `CONFIG_RTE_BUILD_COMBINE_LIBS=y` - Update `config/common_linuxapp` so that DPDK is built with vhost - libraries. - - `CONFIG_RTE_LIBRTE_VHOST=y` - Then run `make install` to build and install the library. For default install without IVSHMEM: @@ -112,7 +107,7 @@ Using the DPDK with ovs-vswitchd: 3. Bind network device to vfio-pci: `$DPDK_DIR/tools/dpdk_nic_bind.py --bind=vfio-pci eth1` -3. Mount the hugetable filsystem +3. Mount the hugetable filesystem `mount -t hugetlbfs -o pagesize=1G none /dev/hugepages` @@ -315,7 +310,7 @@ the vswitchd. DPDK vhost: ----------- -DPDK 2.0 supports two types of vhost: +DPDK 2.1 supports two types of vhost: 1. vhost-user 2. vhost-cuse @@ -336,7 +331,7 @@ with OVS. DPDK vhost-user Prerequisites: ------------------------- -1. DPDK 2.0 with vhost support enabled as documented in the "Building and +1. DPDK 2.1 with vhost support enabled as documented in the "Building and Installing section" 2. QEMU version v2.1.0+ @@ -418,7 +413,7 @@ with OVS. DPDK vhost-cuse Prerequisites: ------------------------- -1. DPDK 2.0 with vhost support enabled as documented in the "Building and +1. DPDK 2.1 with vhost support enabled as documented in the "Building and Installing section" As an additional step, you must enable vhost-cuse in DPDK by setting the following additional flag in `config/common_linuxapp`: diff --git a/acinclude.m4 b/acinclude.m4 index 45cfaf6..90bb708 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -172,7 +172,7 @@ AC_DEFUN([OVS_CHECK_DPDK], [ DPDK_INCLUDE=$RTE_SDK/include DPDK_LIB_DIR=$RTE_SDK/lib - DPDK_LIB="-lintel_dpdk" + DPDK_LIB="-ldpdk" DPDK_EXTRA_LIB="" AC_COMPILE_IFELSE( diff --git a/lib/netdev-dpdk.c b/lib/netdev-dpdk.c index 3444bb1..a98ce61 100644 --- a/lib/netdev-dpdk.c +++ b/lib/netdev-dpdk.c @@ -65,11 +65,17 @@ static struct vlog_rate_limit rl = VLOG_RATE_LIMIT_INIT(5, 20); /* * need to reserve tons of extra space in the mbufs so we can align the * DMA addresses to 4KB. + * The minimum mbuf size is limited to avoid scatter behaviour and drop in + * performance for standard Ethernet MTU */ - #define MTU_TO_MAX_LEN(mtu) ((mtu) + ETHER_HDR_LEN + ETHER_CRC_LEN) -#define MBUF_SIZE(mtu) (MTU_TO_MAX_LEN(mtu) + (512) + \ - sizeof(struct rte_mbuf) + RTE_PKTMBUF_HEADROOM) +#define MBUF_SIZE_MTU(mtu) (MTU_TO_MAX_LEN(mtu) \ + + sizeof(struct dp_packet) \ + + RTE_PKTMBUF_HEADROOM) +#define MBUF_SIZE_DRIVER (2048 \ + + sizeof (struct rte_mbuf) \ + + RTE_PKTMBUF_HEADROOM) +#define MBUF_SIZE(mtu) MAX(MBUF_SIZE_MTU(mtu), MBUF_SIZE_DRIVER) /* Max and min number of packets in the mempool. OVS tries to allocate a * mempool with MAX_NB_MBUF: if this fails (because the system doesn't have