From patchwork Mon Apr 16 14:30:25 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Finucane X-Patchwork-Id: 898657 X-Patchwork-Delegate: ian.stokes@intel.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=openvswitch.org (client-ip=140.211.169.12; helo=mail.linuxfoundation.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=that.guru Authentication-Results: ozlabs.org; dkim=fail reason="key not found in DNS" (0-bit key; unprotected) header.d=that.guru header.i=@that.guru header.b="fyXiPUXr"; dkim-atps=neutral Received: from mail.linuxfoundation.org (mail.linuxfoundation.org [140.211.169.12]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 40PrYW2PKhz9s1R for ; Tue, 17 Apr 2018 00:36:47 +1000 (AEST) Received: from mail.linux-foundation.org (localhost [127.0.0.1]) by mail.linuxfoundation.org (Postfix) with ESMTP id D9DA6EEC; Mon, 16 Apr 2018 14:30:53 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@mail.linuxfoundation.org Received: from smtp1.linuxfoundation.org (smtp1.linux-foundation.org [172.17.192.35]) by mail.linuxfoundation.org (Postfix) with ESMTPS id E7E29EB7 for ; Mon, 16 Apr 2018 14:30:49 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from glass.birch.relay.mailchannels.net (glass.birch.relay.mailchannels.net [23.83.209.70]) by smtp1.linuxfoundation.org (Postfix) with ESMTPS id 00AD6473 for ; Mon, 16 Apr 2018 14:30:48 +0000 (UTC) X-Sender-Id: 5xi41l16bi|x-authuser|stephen@that.guru Received: from relay.mailchannels.net (localhost [127.0.0.1]) by relay.mailchannels.net (Postfix) with ESMTP id 58400280C8A; Mon, 16 Apr 2018 14:30:43 +0000 (UTC) Received: from one.mxroute.com (unknown [100.96.13.37]) (Authenticated sender: 5xi41l16bi) by relay.mailchannels.net (Postfix) with ESMTPA id DB3CF280A3D; Mon, 16 Apr 2018 14:30:42 +0000 (UTC) X-Sender-Id: 5xi41l16bi|x-authuser|stephen@that.guru Received: from one.mxroute.com (one-outgoing.mxroute.com [172.19.51.240]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384) by 0.0.0.0:2500 (trex/5.14.1); Mon, 16 Apr 2018 14:30:43 +0000 X-MC-Relay: Neutral X-MailChannels-SenderId: 5xi41l16bi|x-authuser|stephen@that.guru X-MailChannels-Auth-Id: 5xi41l16bi X-Bored-Harbor: 69508a272ff69c81_1523889043224_1869664863 X-MC-Loop-Signature: 1523889043224:1455241161 X-MC-Ingress-Time: 1523889043222 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=that.guru; s=default; h=References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: Sender:Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=TLI+pdwRxsST4C8ff8atVQKbws1hG9n/BI1ud1PxXCY=; b=fyXiPUXrOPjoa95x3A8GpyRu4z kfFIXfq+jpwDZ4BHAOXjR+jrmsAiLEfPk8JD74GAB72RJM9tFzgWfZDH/NW3BeM6+YuPEpg/xWNnt Q3xOiAw3YNabyrWCQz8NSsRktPN06Fx6WTx/WLcWjomMAlJWF6STuf4gwXEvk4n+Ak2NBpDf9PGk8 4Lgyrp+5y3QxbMoc5TRLxe69L6wKRDvotStxOjFPPz1Piaz7XN+uOE1T89GfiAV8OF0ktchCTmE4m WMoUi2RhheoXAjZUNjgPiTcxttXMOI57mEtlK4NQpS1DDV3rpHQmUUaV12GrlyguI90xvKlzJCo2o SpzKcVfQ==; From: Stephen Finucane To: dev@openvswitch.org Date: Mon, 16 Apr 2018 15:30:25 +0100 Message-Id: <20180416143026.24561-9-stephen@that.guru> X-Mailer: git-send-email 2.14.3 In-Reply-To: <20180416143026.24561-1-stephen@that.guru> References: <20180416143026.24561-1-stephen@that.guru> X-AuthUser: stephen@that.guru X-Spam-Status: No, score=-1.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_NONE,T_DKIM_INVALID autolearn=no version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on smtp1.linux-foundation.org Subject: [ovs-dev] [PATCH v2 8/9] doc: Add "jumbo frames" topic document X-BeenThere: ovs-dev@openvswitch.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: ovs-dev-bounces@openvswitch.org Errors-To: ovs-dev-bounces@openvswitch.org We include refrences from the physical and vhost-user interface guides. Signed-off-by: Stephen Finucane --- v2: - Don't split the document into multiple docs --- Documentation/howto/dpdk.rst | 52 ++-------------------- Documentation/topics/dpdk/index.rst | 1 + Documentation/topics/dpdk/jumbo-frames.rst | 71 ++++++++++++++++++++++++++++++ Documentation/topics/dpdk/phy.rst | 6 +++ Documentation/topics/dpdk/vhost-user.rst | 6 +++ 5 files changed, 87 insertions(+), 49 deletions(-) create mode 100644 Documentation/topics/dpdk/jumbo-frames.rst diff --git a/Documentation/howto/dpdk.rst b/Documentation/howto/dpdk.rst index 1a0fb6df1..e65e7dfaa 100644 --- a/Documentation/howto/dpdk.rst +++ b/Documentation/howto/dpdk.rst @@ -48,9 +48,9 @@ number of dpdk devices found in the log file:: $ ovs-vsctl add-port br0 dpdk-p1 -- set Interface dpdk-p1 type=dpdk \ options:dpdk-devargs=0000:01:00.1 -Some NICs (i.e. Mellanox ConnectX-3) have only one PCI address associated -with multiple ports. Using a PCI device like above won't work. Instead, below -usage is suggested:: +Some NICs (i.e. Mellanox ConnectX-3) have only one PCI address associated with +multiple ports. Using a PCI device like above won't work. Instead, below usage +is suggested:: $ ovs-vsctl add-port br0 dpdk-p0 -- set Interface dpdk-p0 type=dpdk \ options:dpdk-devargs="class=eth,mac=00:11:22:33:44:55:01" @@ -85,52 +85,6 @@ To stop ovs-vswitchd & delete bridge, run:: $ ovs-appctl -t ovsdb-server exit $ ovs-vsctl del-br br0 -Jumbo Frames ------------- - -By default, DPDK ports are configured with standard Ethernet MTU (1500B). To -enable Jumbo Frames support for a DPDK port, change the Interface's -``mtu_request`` attribute to a sufficiently large value. For example, to add a -DPDK Phy port with MTU of 9000:: - - $ ovs-vsctl add-port br0 dpdk-p0 -- set Interface dpdk-p0 type=dpdk \ - options:dpdk-devargs=0000:01:00.0 mtu_request=9000 - -Similarly, to change the MTU of an existing port to 6200:: - - $ ovs-vsctl set Interface dpdk-p0 mtu_request=6200 - -Some additional configuration is needed to take advantage of jumbo frames with -vHost ports: - -1. *mergeable buffers* must be enabled for vHost ports, as demonstrated in the - QEMU command line snippet below:: - - -netdev type=vhost-user,id=mynet1,chardev=char0,vhostforce \ - -device virtio-net-pci,mac=00:00:00:00:00:01,netdev=mynet1,mrg_rxbuf=on - -2. Where virtio devices are bound to the Linux kernel driver in a guest - environment (i.e. interfaces are not bound to an in-guest DPDK driver), the - MTU of those logical network interfaces must also be increased to a - sufficiently large value. This avoids segmentation of Jumbo Frames received - in the guest. Note that 'MTU' refers to the length of the IP packet only, - and not that of the entire frame. - - To calculate the exact MTU of a standard IPv4 frame, subtract the L2 header - and CRC lengths (i.e. 18B) from the max supported frame size. So, to set - the MTU for a 9018B Jumbo Frame:: - - $ ip link set eth1 mtu 9000 - -When Jumbo Frames are enabled, the size of a DPDK port's mbuf segments are -increased, such that a full Jumbo Frame of a specific size may be accommodated -within a single mbuf segment. - -Jumbo frame support has been validated against 9728B frames, which is the -largest frame size supported by Fortville NIC using the DPDK i40e driver, but -larger frames and other DPDK NIC drivers may be supported. These cases are -common for use cases involving East-West traffic only. - .. _dpdk-ovs-in-guest: OVS with DPDK Inside VMs diff --git a/Documentation/topics/dpdk/index.rst b/Documentation/topics/dpdk/index.rst index d083d929e..181f61abb 100644 --- a/Documentation/topics/dpdk/index.rst +++ b/Documentation/topics/dpdk/index.rst @@ -39,3 +39,4 @@ The DPDK Datapath /topics/dpdk/pmd /topics/dpdk/qos /topics/dpdk/pdump + /topics/dpdk/jumbo-frames diff --git a/Documentation/topics/dpdk/jumbo-frames.rst b/Documentation/topics/dpdk/jumbo-frames.rst new file mode 100644 index 000000000..692b291ac --- /dev/null +++ b/Documentation/topics/dpdk/jumbo-frames.rst @@ -0,0 +1,71 @@ +.. + Copyright 2018, Red Hat, Inc. + + Licensed under the Apache License, Version 2.0 (the "License"); you may + not use this file except in compliance with the License. You may obtain + a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + License for the specific language governing permissions and limitations + under the License. + + Convention for heading levels in Open vSwitch documentation: + + ======= Heading 0 (reserved for the title in a document) + ------- Heading 1 + ~~~~~~~ Heading 2 + +++++++ Heading 3 + ''''''' Heading 4 + + Avoid deeper levels because they do not render well. + +============ +Jumbo Frames +============ + +By default, DPDK ports are configured with standard Ethernet MTU (1500B). To +enable Jumbo Frames support for a DPDK port, change the Interface's +``mtu_request`` attribute to a sufficiently large value. For example, to add a +:doc:`DPDK physical port ` with an MTU of 9000, run:: + + $ ovs-vsctl add-port br0 dpdk-p0 -- set Interface dpdk-p0 type=dpdk \ + options:dpdk-devargs=0000:01:00.0 mtu_request=9000 + +Similarly, to change the MTU of an existing port to 6200, run:: + + $ ovs-vsctl set Interface dpdk-p0 mtu_request=6200 + +Some additional configuration is needed to take advantage of jumbo frames with +:doc:`vHost User ports `: + +- *Mergeable buffers* must be enabled for vHost User ports, as demonstrated in + the QEMU command line snippet below:: + + -netdev type=vhost-user,id=mynet1,chardev=char0,vhostforce \ + -device virtio-net-pci,mac=00:00:00:00:00:01,netdev=mynet1,mrg_rxbuf=on + +- Where virtio devices are bound to the Linux kernel driver in a guest + environment (i.e. interfaces are not bound to an in-guest DPDK driver), the + MTU of those logical network interfaces must also be increased to a + sufficiently large value. This avoids segmentation of Jumbo Frames received + in the guest. Note that 'MTU' refers to the length of the IP packet only, and + not that of the entire frame. + + To calculate the exact MTU of a standard IPv4 frame, subtract the L2 header + and CRC lengths (i.e. 18B) from the max supported frame size. So, to set the + MTU for a 9018B Jumbo Frame:: + + $ ip link set eth1 mtu 9000 + +When Jumbo Frames are enabled, the size of a DPDK port's mbuf segments are +increased, such that a full Jumbo Frame of a specific size may be accommodated +within a single mbuf segment. + +Jumbo frame support has been validated against 9728B frames, which is the +largest frame size supported by Fortville NIC using the DPDK i40e driver, but +larger frames and other DPDK NIC drivers may be supported. These cases are +common for use cases involving East-West traffic only. diff --git a/Documentation/topics/dpdk/phy.rst b/Documentation/topics/dpdk/phy.rst index c0931b2c4..477b291e4 100644 --- a/Documentation/topics/dpdk/phy.rst +++ b/Documentation/topics/dpdk/phy.rst @@ -218,3 +218,9 @@ If the log is not seen then the port can be detached like so:: For more information please refer to the `DPDK Port Hotplug Framework`__. __ http://dpdk.org/doc/guides/prog_guide/port_hotplug_framework.html#hotplug + +Jumbo Frames +------------ + +DPDK physical ports can be configured to use Jumbo Frames. For more +information, refer to :doc:`jumbo-frames`. diff --git a/Documentation/topics/dpdk/vhost-user.rst b/Documentation/topics/dpdk/vhost-user.rst index 168d5c5ce..67eb77d43 100644 --- a/Documentation/topics/dpdk/vhost-user.rst +++ b/Documentation/topics/dpdk/vhost-user.rst @@ -444,6 +444,12 @@ Sample XML .. _QEMU documentation: http://git.qemu-project.org/?p=qemu.git;a=blob;f=docs/specs/vhost-user.txt;h=7890d7169;hb=HEAD +Jumbo Frames +------------ + +DPDK vHost User ports can be configured to use Jumbo Frames. For more +information, refer to :doc:`jumbo-frames`. + vhost-user Dequeue Zero Copy (experimental) -------------------------------------------