From patchwork Mon Feb 12 18:13:06 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Finucane X-Patchwork-Id: 872250 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; dkim=fail reason="key not found in DNS" (0-bit key; unprotected) header.d=that.guru header.i=@that.guru header.b="GlF4NaYY"; 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 3zgDSb5cWJz9s7f for ; Tue, 13 Feb 2018 05:18:39 +1100 (AEDT) Received: from mail.linux-foundation.org (localhost [127.0.0.1]) by mail.linuxfoundation.org (Postfix) with ESMTP id EBF10DCF; Mon, 12 Feb 2018 18:18:36 +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 2865EDAB for ; Mon, 12 Feb 2018 18:18:35 +0000 (UTC) X-Greylist: delayed 00:05:17 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 6FC0F12D for ; Mon, 12 Feb 2018 18:18:34 +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 185C7121ED9; Mon, 12 Feb 2018 18:13:23 +0000 (UTC) Received: from one.mxroute.com (unknown [100.96.30.35]) (Authenticated sender: 5xi41l16bi) by relay.mailchannels.net (Postfix) with ESMTPA id 679EC12272A; Mon, 12 Feb 2018 18:13:22 +0000 (UTC) X-Sender-Id: 5xi41l16bi|x-authuser|stephen@that.guru Received: from one.mxroute.com (one-outgoing.mxroute.com [172.18.36.240]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384) by 0.0.0.0:2500 (trex/5.13.1); Mon, 12 Feb 2018 18:13:23 +0000 X-MC-Relay: Neutral X-MailChannels-SenderId: 5xi41l16bi|x-authuser|stephen@that.guru X-MailChannels-Auth-Id: 5xi41l16bi X-Abaft-Robust: 32729c20243d9205_1518459202776_2219335949 X-MC-Loop-Signature: 1518459202776:4266041792 X-MC-Ingress-Time: 1518459202768 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=61zcPhrNnppcOVTCbZvsqRITvRRu8NyDdwgYyfiSuKs=; b=GlF4NaYYTYhd6q3Dm6YqigwCU2 7uabWX2xqcnuAknvB4Q9BoW9Wl8+2V6S8C7bCPWAeGFSoX/CHhRUpqy9Co7iXCju4+gfo/WlJS8hj I585cZ8qiXpuBLMAAoY+v5pnIBTaKR7XIwbgsv7iL4q0eLWJFdfecEi73va+4MCgoI1M3+EiXjPQV 2xeN79I30fKqFBmvsw7ZIyQhcWY1QEc2IzGtasTc/TXrm6Cu3DXQQy1UkhtuiCqXqz2XYYPyVADN5 yGUiTenPLTTcnJUc+PNaU1KSDLy4EWFQNshZ3pGWWzWocRyhwwmCVanSjKGL228Ij8COAOH+feVbJ qGB1y4Sw==; From: Stephen Finucane To: dev@openvswitch.org Date: Mon, 12 Feb 2018 18:13:06 +0000 Message-Id: <20180212181306.6674-9-stephen@that.guru> X-Mailer: git-send-email 2.14.3 In-Reply-To: <20180212181306.6674-1-stephen@that.guru> References: <20180212181306.6674-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 8/8] doc: Final cleanup of the DPDK howto 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 This concludes the cleanup by fixing some grammar nits and adding some additional cross-references. Signed-off-by: Stephen Finucane --- Documentation/howto/dpdk.rst | 61 ++++++++++++++++++++++---------------------- 1 file changed, 30 insertions(+), 31 deletions(-) diff --git a/Documentation/howto/dpdk.rst b/Documentation/howto/dpdk.rst index ba01810f8..89e068748 100644 --- a/Documentation/howto/dpdk.rst +++ b/Documentation/howto/dpdk.rst @@ -25,23 +25,26 @@ Using Open vSwitch with DPDK ============================ -This document describes how to use Open vSwitch with DPDK datapath. +This document describes how to use Open vSwitch with DPDK datapath. For more +detailed information, refer to the various :doc:`DPDK topic guides +`. .. important:: Using the DPDK datapath requires building OVS with DPDK support. Refer to :doc:`/intro/install/dpdk` for more information. -Ports and Bridges ------------------ +Overview +-------- -ovs-vsctl can be used to set up bridges and other Open vSwitch features. -Bridges should be created with a ``datapath_type=netdev``:: +:program:`ovs-vsctl` can be used to set up bridges and other Open vSwitch +features. Bridges should be created with a ``datapath_type=netdev``:: $ ovs-vsctl add-br br0 -- set bridge br0 datapath_type=netdev -ovs-vsctl can also be used to add DPDK devices. ovs-vswitchd should print the -number of dpdk devices found in the log file:: +:program:`ovs-vsctl` can also be used to add DPDK devices. +:program:`ovs-vswitchd` should print the number of ``dpdk`` devices found in +the log file:: $ ovs-vsctl add-port br0 dpdk-p0 -- set Interface dpdk-p0 type=dpdk \ options:dpdk-devargs=0000:01:00.0 @@ -59,14 +62,13 @@ is suggested:: .. important:: - Hotplugging physical interfaces is not supported using the above syntax. - This is expected to change with the release of DPDK v18.05. For information - on hotplugging physical interfaces, you should instead refer to - :ref:`port-hotplug`. + Hotplugging physical interfaces is not supported for these devices. This + is expected to change with the release of DPDK v18.05. For information on + hotplugging physical interfaces, refer to :ref:`port-hotplug`. After the DPDK ports get added to switch, a polling thread continuously polls -DPDK devices and consumes 100% of the core, as can be checked from ``top`` and -``ps`` commands:: +DPDK devices and consumes 100% of the core, as can be checked from +:command:`top` and :command:`ps` commands:: $ top -H $ ps -eLo pid,psr,comm | grep pmd @@ -79,7 +81,7 @@ set. For example:: -- set Interface p0 type=dpdk options:dpdk-devargs=0000:01:00.0 \ -- set Interface p1 type=dpdk options:dpdk-devargs=0000:01:00.1 -To stop ovs-vswitchd & delete bridge, run:: +To stop :program:`ovs-vswitchd` and delete the bridge, run:: $ ovs-appctl -t ovs-vswitchd exit $ ovs-appctl -t ovsdb-server exit @@ -126,7 +128,7 @@ Add a userspace bridge and two ``dpdk`` (PHY) ports:: $ ovs-vsctl add-port br0 phy1 -- set Interface phy1 type=dpdk options:dpdk-devargs=0000:01:00.1 ofport_request=2 -Add test flows to forward packets betwen DPDK port 0 and port 1:: +Add test flows to forward packets between DPDK port 0 and port 1:: # Clear current flows $ ovs-ofctl del-flows br0 @@ -137,13 +139,16 @@ Add test flows to forward packets betwen DPDK port 0 and port 1:: Transmit traffic into either port. You should see it returned via the other. +More information on the ``dpdk`` ports can be found in :doc:`/topics/dpdk/phy`. + .. _dpdk-vhost-loopback: PHY-VM-PHY (vHost Loopback) --------------------------- Add a userspace bridge, two ``dpdk`` (PHY) ports, and two ``dpdkvhostuser`` -ports:: +ports. It is assumed that the physical ports are already bound to DPDK, as +described in :ref:`dpdk-binding-nics`:: # Add userspace bridge $ ovs-vsctl add-br br0 -- set bridge br0 datapath_type=netdev @@ -161,7 +166,7 @@ ports:: $ ovs-vsctl add-port br0 dpdkvhostuser1 \ -- set Interface dpdkvhostuser1 type=dpdkvhostuser ofport_request=4 -Add test flows to forward packets betwen DPDK devices and VM ports:: +Add test flows to forward packets between DPDK devices and VM ports:: # Clear current flows $ ovs-ofctl del-flows br0 @@ -221,19 +226,7 @@ described in :ref:`dpdk-testpmd`. Once compiled, run the application:: $ set fwd mac retry $ start -When you finish testing, bind the vNICs back to kernel:: - - $ $DPDK_DIR/usertools/dpdk-devbind.py --bind=virtio-pci 0000:00:03.0 - $ $DPDK_DIR/usertools/dpdk-devbind.py --bind=virtio-pci 0000:00:04.0 - -.. note:: - - Valid PCI IDs must be passed in above example. The PCI IDs can be retrieved - like so:: - - $ $DPDK_DIR/usertools/dpdk-devbind.py --status - -More information on the dpdkvhostuser ports can be found in +More information on the ``dpdkvhostuser`` ports can be found in :doc:`/topics/dpdk/vhost-user`. PHY-VM-PHY (vHost Loopback) (Kernel Forwarding) @@ -277,7 +270,7 @@ devices to bridge ``br0``. Once complete, follow the below steps: $ ovs-vsctl set Interface phy0 options:n_rxq=2 $ ovs-vsctl set Interface phy1 options:n_rxq=2 -2. Instantiate Guest VM using QEMU cmdline +2. Instantiate Guest VM using QEMU command line We must configure with appropriate software versions to ensure this feature is supported. @@ -357,3 +350,9 @@ devices to bridge ``br0``. Once complete, follow the below steps: Check traffic on multiple queues:: $ cat /proc/interrupts | grep virtio + +More Information +---------------- + +More information on the DPDK datapath in provided in the :doc:`DPDK topic +guides `.