From patchwork Mon Apr 16 14:30:20 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Finucane X-Patchwork-Id: 898652 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="G72eg6FS"; 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 40PrSc1xzTz9s1l for ; Tue, 17 Apr 2018 00:32:32 +1000 (AEST) Received: from mail.linux-foundation.org (localhost [127.0.0.1]) by mail.linuxfoundation.org (Postfix) with ESMTP id E0A13E95; Mon, 16 Apr 2018 14:30:45 +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 50EDCDCF for ; Mon, 16 Apr 2018 14:30:43 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from catfish.maple.relay.mailchannels.net (catfish.maple.relay.mailchannels.net [23.83.214.32]) by smtp1.linuxfoundation.org (Postfix) with ESMTPS id 29156682 for ; Mon, 16 Apr 2018 14:30:41 +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 12FA7121461; Mon, 16 Apr 2018 14:30:39 +0000 (UTC) Received: from one.mxroute.com (unknown [100.96.14.60]) (Authenticated sender: 5xi41l16bi) by relay.mailchannels.net (Postfix) with ESMTPA id 5C748121883; Mon, 16 Apr 2018 14:30:38 +0000 (UTC) X-Sender-Id: 5xi41l16bi|x-authuser|stephen@that.guru Received: from one.mxroute.com (one-outgoing.mxroute.com [172.18.56.151]) (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:39 +0000 X-MC-Relay: Neutral X-MailChannels-SenderId: 5xi41l16bi|x-authuser|stephen@that.guru X-MailChannels-Auth-Id: 5xi41l16bi X-Arithmetic-Bitter: 49a3bdd8073f2789_1523889038686_4085092112 X-MC-Loop-Signature: 1523889038685:1889046088 X-MC-Ingress-Time: 1523889038685 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=UmLk6nwv3lYHcpZazOdxLCSYGViXJcKL4R54vRFlAWY=; b=G72eg6FSl3Pv9jnaI2TpF3FAer NFAwi+dv/32cSQwipVCxdhEBVFAmuuJvy1s0YRjnFoofrFyxf6Kjit3ahVsDakDp0Evvw3x56QSLA 6WWW0YwYFrZIHGgTu6UUtPLaI0BwS3TA1KoxU2bp9D1KCcMTgwLflQNPrcarMHInQ6YO3FmpOP97g SJ62F4FQwg/pRZwD7+WTsxI868IDfoGp9X9cobruqvxM6EjITP9tLph7x4A1VQVRkUKkwLwai0bUe Wcp0QmXJK5gkJdUS0mku23O8TzBbn8ZVwaPWJJAN2J12fg0Im4jTrg/RRA5kCRmf6MAwhM7M64SFM bfgrCy5Q==; From: Stephen Finucane To: dev@openvswitch.org Date: Mon, 16 Apr 2018 15:30:20 +0100 Message-Id: <20180416143026.24561-4-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 3/9] doc: Move additional sections to "physical ports" doc 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 The "hotplugging", "flow control", and "Rx checksum offload" sections only apply to 'dpdk' ports and are too detailed to include in a high-level howto. Move them, reworking some aspects of this in the process. Signed-off-by: Stephen Finucane --- v2: - Split out vdev into its own document (and patch) - Add cross-references from DPDK howto guide to detailed topic guides - Add flow control --- Documentation/howto/dpdk.rst | 103 ++++++------------------------------ Documentation/topics/dpdk/index.rst | 11 ++-- Documentation/topics/dpdk/phy.rst | 86 ++++++++++++++++++++++++++++++ 3 files changed, 110 insertions(+), 90 deletions(-) diff --git a/Documentation/howto/dpdk.rst b/Documentation/howto/dpdk.rst index 388728363..531612880 100644 --- a/Documentation/howto/dpdk.rst +++ b/Documentation/howto/dpdk.rst @@ -57,8 +57,12 @@ usage is suggested:: $ ovs-vsctl add-port br0 dpdk-p1 -- set Interface dpdk-p1 type=dpdk \ options:dpdk-devargs="class=eth,mac=00:11:22:33:44:55:02" -Note: such syntax won't support hotplug. The hotplug is supposed to work with -future DPDK release, v18.05. +.. 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`. 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 @@ -123,34 +127,6 @@ To clear the ingress policer configuration from the port:: Refer to vswitch.xml for more details on ingress-policer. -Flow Control ------------- - -Flow control can be enabled only on DPDK physical ports. To enable flow control -support at tx side while adding a port, run:: - - $ ovs-vsctl add-port br0 dpdk-p0 -- set Interface dpdk-p0 type=dpdk \ - options:dpdk-devargs=0000:01:00.0 options:tx-flow-ctrl=true - -Similarly, to enable rx flow control, run:: - - $ ovs-vsctl add-port br0 dpdk-p0 -- set Interface dpdk-p0 type=dpdk \ - options:dpdk-devargs=0000:01:00.0 options:rx-flow-ctrl=true - -To enable flow control auto-negotiation, run:: - - $ ovs-vsctl add-port br0 dpdk-p0 -- set Interface dpdk-p0 type=dpdk \ - options:dpdk-devargs=0000:01:00.0 options:flow-ctrl-autoneg=true - -To turn ON the tx flow control at run time for an existing port, run:: - - $ ovs-vsctl set Interface dpdk-p0 options:tx-flow-ctrl=true - -The flow control parameters can be turned off by setting ``false`` to the -respective parameter. To disable the flow control at tx side, run:: - - $ ovs-vsctl set Interface dpdk-p0 options:tx-flow-ctrl=false - pdump ----- @@ -236,16 +212,6 @@ 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. -Rx Checksum Offload -------------------- - -By default, DPDK physical ports are enabled with Rx checksum offload. - -Rx checksum offload can offer performance improvement only for tunneling -traffic in OVS-DPDK because the checksum validation of tunnel packets is -offloaded to the NIC. Also enabling Rx checksum may slightly reduce the -performance of non-tunnel traffic, specifically for smaller size packet. - .. _extended-statistics: Extended & Custom Statistics @@ -278,52 +244,6 @@ Note about "Extended Statistics": vHost ports supports only partial statistics. RX packet size based counter are only supported and doesn't include TX packet size counters. -.. _port-hotplug: - -Port Hotplug ------------- - -OVS supports port hotplugging, allowing the use of ports that were not bound -to DPDK when vswitchd was started. -In order to attach a port, it has to be bound to DPDK using the -``dpdk_nic_bind.py`` script:: - - $ $DPDK_DIR/tools/dpdk_nic_bind.py --bind=igb_uio 0000:01:00.0 - -Then it can be attached to OVS:: - - $ ovs-vsctl add-port br0 dpdkx -- set Interface dpdkx type=dpdk \ - options:dpdk-devargs=0000:01:00.0 - -Detaching will be performed while processing del-port command:: - - $ ovs-vsctl del-port dpdkx - -Sometimes, the del-port command may not detach the device. -Detaching can be confirmed by the appearance of an INFO log. -For example:: - - INFO|Device '0000:04:00.1' has been detached - -If the log is not seen, then the port can be detached using:: - -$ ovs-appctl netdev-dpdk/detach 0000:01:00.0 - -Detaching can be confirmed by console output:: - - Device '0000:04:00.1' has been detached - -.. warning:: - Detaching should not be done if a device is known to be non-detachable, as - this may cause the device to behave improperly when added back with - add-port. The Chelsio Terminator adapters which use the cxgbe driver seem - to be an example of this behavior; check the driver documentation if this - is suspected. - -This feature does not work with some NICs. -For more information please refer to the `DPDK Port Hotplug Framework -`__. - .. _vdev-support: Vdev Support @@ -653,3 +573,14 @@ devices to bridge ``br0``. Once complete, follow the below steps: Check traffic on multiple queues:: $ cat /proc/interrupts | grep virtio + +Further Reading +--------------- + +More detailed information can be found in the :doc:`DPDK topics section +` of the documentation. These guides are listed below. + +.. NOTE(stephenfin): Remember to keep this in sync with topics/dpdk/index + +.. include:: ../topics/dpdk/index.rst + :start-line: 30 diff --git a/Documentation/topics/dpdk/index.rst b/Documentation/topics/dpdk/index.rst index dfde88377..4b4dc119a 100644 --- a/Documentation/topics/dpdk/index.rst +++ b/Documentation/topics/dpdk/index.rst @@ -25,10 +25,13 @@ The DPDK Datapath ================= +.. NOTE(stephenfin): Part of this doc is included in 'howto/dpdk'. Update that +.. if you modify this document + .. toctree:: :maxdepth: 2 - phy - vhost-user - ring - pmd + /topics/dpdk/phy + /topics/dpdk/vhost-user + /topics/dpdk/ring + /topics/dpdk/pmd diff --git a/Documentation/topics/dpdk/phy.rst b/Documentation/topics/dpdk/phy.rst index ad191dad0..929f394ea 100644 --- a/Documentation/topics/dpdk/phy.rst +++ b/Documentation/topics/dpdk/phy.rst @@ -125,3 +125,89 @@ utilize is a requirement in order to deliver the high-performance possible with DPDK acceleration. It is possible to configure multiple Rx queues for ``dpdk`` ports, thus ensuring this is not a bottleneck for performance. For information on configuring PMD threads, refer to :doc:`pmd`. + +Flow Control +------------ + +Flow control can be enabled only on DPDK physical ports. To enable flow control +support at Tx side while adding a port, run:: + + $ ovs-vsctl add-port br0 dpdk-p0 -- set Interface dpdk-p0 type=dpdk \ + options:dpdk-devargs=0000:01:00.0 options:tx-flow-ctrl=true + +Similarly, to enable Rx flow control, run:: + + $ ovs-vsctl add-port br0 dpdk-p0 -- set Interface dpdk-p0 type=dpdk \ + options:dpdk-devargs=0000:01:00.0 options:rx-flow-ctrl=true + +To enable flow control auto-negotiation, run:: + + $ ovs-vsctl add-port br0 dpdk-p0 -- set Interface dpdk-p0 type=dpdk \ + options:dpdk-devargs=0000:01:00.0 options:flow-ctrl-autoneg=true + +To turn on the Tx flow control at run time for an existing port, run:: + + $ ovs-vsctl set Interface dpdk-p0 options:tx-flow-ctrl=true + +The flow control parameters can be turned off by setting ``false`` to the +respective parameter. To disable the flow control at Tx side, run:: + + $ ovs-vsctl set Interface dpdk-p0 options:tx-flow-ctrl=false + +Rx Checksum Offload +------------------- + +By default, DPDK physical ports are enabled with Rx checksum offload. + +Rx checksum offload can offer performance improvement only for tunneling +traffic in OVS-DPDK because the checksum validation of tunnel packets is +offloaded to the NIC. Also enabling Rx checksum may slightly reduce the +performance of non-tunnel traffic, specifically for smaller size packet. + +.. _port-hotplug: + +Hotplugging +----------- + +OVS supports port hotplugging, allowing the use of physical ports that were not +bound to DPDK when ovs-vswitchd was started. + +.. warning:: + + This feature is not compatible with all NICs. Refer to vendor documentation + for more information. + +.. important:: + + Ports must be bound to DPDK. Refer to :ref:`dpdk-binding-nics` for more + information. + +To *hotplug* a port, simply add it like any other port:: + + $ ovs-vsctl add-port br0 dpdkx -- set Interface dpdkx type=dpdk \ + options:dpdk-devargs=0000:01:00.0 + +Ports can be detached using the ``del-port`` command:: + + $ ovs-vsctl del-port dpdkx + +This should both delete the port and detach the device. If successful, you +should see an ``INFO`` log. For example:: + + INFO|Device '0000:04:00.1' has been detached + +If the log is not seen then the port can be detached like so:: + + $ ovs-appctl netdev-dpdk/detach 0000:01:00.0 + +.. warning:: + + Detaching should not be done if a device is known to be non-detachable, as + this may cause the device to behave improperly when added back with + add-port. The Chelsio Terminator adapters which use the cxgbe driver seem + to be an example of this behavior; check the driver documentation if this + is suspected. + +For more information please refer to the `DPDK Port Hotplug Framework`__. + +__ http://dpdk.org/doc/guides/prog_guide/port_hotplug_framework.html#hotplug