From patchwork Tue Sep 8 15:26:36 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Stokes, Ian" X-Patchwork-Id: 1359794 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=openvswitch.org (client-ip=140.211.166.133; helo=hemlock.osuosl.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=intel.com Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4Bm8Bw5T8Wz9sTS for ; Wed, 9 Sep 2020 01:26:48 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 11BBB87335; Tue, 8 Sep 2020 15:26:47 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id R6NP2Zvlx8X0; Tue, 8 Sep 2020 15:26:44 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by hemlock.osuosl.org (Postfix) with ESMTP id EDAF68732A; Tue, 8 Sep 2020 15:26:43 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id B599EC0859; Tue, 8 Sep 2020 15:26:43 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@lists.linuxfoundation.org Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) by lists.linuxfoundation.org (Postfix) with ESMTP id 1F4E6C0051 for ; Tue, 8 Sep 2020 15:26:42 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 04BF0204DC for ; Tue, 8 Sep 2020 15:26:42 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id vNI1FX1GAn54 for ; Tue, 8 Sep 2020 15:26:40 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by silver.osuosl.org (Postfix) with ESMTPS id E38FF20026 for ; Tue, 8 Sep 2020 15:26:39 +0000 (UTC) IronPort-SDR: pz8UAr2Ib4bV4C9q8wc0uJZhU/jgWmTbwwAJitB7yiCJmdbKemRo9RbASPGQ+1mqZ5DhoCcaRZ gMfaP83K+DKA== X-IronPort-AV: E=McAfee;i="6000,8403,9738"; a="155554706" X-IronPort-AV: E=Sophos;i="5.76,406,1592895600"; d="scan'208";a="155554706" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Sep 2020 08:26:39 -0700 IronPort-SDR: YtMqI4CrcKj5L+V+2AK9gBkH+yrltNXnIo00TJlZd3KVTbP4ox5VlADTWeaqeoRNmn8nvukXlx nC5sefFSmWHQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.76,406,1592895600"; d="scan'208";a="336448973" Received: from sivswdev08.ir.intel.com (HELO localhost.localdomain) ([10.237.217.47]) by fmsmga002.fm.intel.com with ESMTP; 08 Sep 2020 08:26:37 -0700 From: Ian Stokes To: dev@openvswitch.org Date: Tue, 8 Sep 2020 16:26:36 +0100 Message-Id: <1599578796-32152-1-git-send-email-ian.stokes@intel.com> X-Mailer: git-send-email 1.7.0.7 Cc: maxime.coquelin@redhat.com, i.maximets@ovn.org Subject: [ovs-dev] [PATCH v1 1/1] DPDK: Remove support for vhost-user zero-copy. X-BeenThere: ovs-dev@openvswitch.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: ovs-dev-bounces@openvswitch.org Sender: "dev" Support for vhost-user dequeue zero-copy was deprecated in OVS 2.14 with the aim of removing it for OVS 2.15. Support for zero-copy will also be removed from DPDK 20.11. As such remove support from OVS. Signed-off-by: Ian Stokes Signed-off-by: Ian Stokes --- Documentation/topics/dpdk/vhost-user.rst | 72 -------------------------------- NEWS | 2 + lib/netdev-dpdk.c | 25 ----------- vswitchd/vswitch.xml | 11 ----- 4 files changed, 2 insertions(+), 108 deletions(-) diff --git a/Documentation/topics/dpdk/vhost-user.rst b/Documentation/topics/dpdk/vhost-user.rst index 4af738d11..595e40cde 100644 --- a/Documentation/topics/dpdk/vhost-user.rst +++ b/Documentation/topics/dpdk/vhost-user.rst @@ -553,78 +553,6 @@ shown with:: $ ovs-vsctl get Interface dpdkvhostclient0 statistics:ovs_tx_retries -vhost-user Dequeue Zero Copy (experimental) -------------------------------------------- - -.. warning:: - - vhost-user Dequeue Zero Copy is deprecated in OVS and will be removed in - the next release. - -Normally when dequeuing a packet from a vHost User device, a memcpy operation -must be used to copy that packet from guest address space to host address -space. This memcpy can be removed by enabling dequeue zero-copy like so:: - - $ ovs-vsctl add-port br0 dpdkvhostuserclient0 -- set Interface \ - dpdkvhostuserclient0 type=dpdkvhostuserclient \ - options:vhost-server-path=/tmp/dpdkvhostclient0 \ - options:dq-zero-copy=true - -With this feature enabled, a reference (pointer) to the packet is passed to -the host, instead of a copy of the packet. Removing this memcpy can give a -performance improvement for some use cases, for example switching large packets -between different VMs. However additional packet loss may be observed. - -Note that the feature is disabled by default and must be explicitly enabled -by setting the ``dq-zero-copy`` option to ``true`` while specifying the -``vhost-server-path`` option as above. If you wish to split out the command -into multiple commands as below, ensure ``dq-zero-copy`` is set before -``vhost-server-path``:: - - $ ovs-vsctl set Interface dpdkvhostuserclient0 options:dq-zero-copy=true - $ ovs-vsctl set Interface dpdkvhostuserclient0 \ - options:vhost-server-path=/tmp/dpdkvhostclient0 - -The feature is only available to ``dpdkvhostuserclient`` port types. - -A limitation exists whereby if packets from a vHost port with -``dq-zero-copy=true`` are destined for a ``dpdk`` type port, the number of tx -descriptors (``n_txq_desc``) for that port must be reduced to a smaller number, -128 being the recommended value. This can be achieved by issuing the following -command:: - - $ ovs-vsctl set Interface dpdkport options:n_txq_desc=128 - -Note: The sum of the tx descriptors of all ``dpdk`` ports the VM will send to -should not exceed 128. For example, in case of a bond over two physical ports -in balance-tcp mode, one must divide 128 by the number of links in the bond. - -Refer to :ref:`dpdk-queues-sizes` for more information. - -The reason for this limitation is due to how the zero copy functionality is -implemented. The vHost device's 'tx used vring', a virtio structure used for -tracking used ie. sent descriptors, will only be updated when the NIC frees -the corresponding mbuf. If we don't free the mbufs frequently enough, that -vring will be starved and packets will no longer be processed. One way to -ensure we don't encounter this scenario, is to configure ``n_txq_desc`` to a -small enough number such that the 'mbuf free threshold' for the NIC will be hit -more often and thus free mbufs more frequently. The value of 128 is suggested, -but values of 64 and 256 have been tested and verified to work too, with -differing performance characteristics. A value of 512 can be used too, if the -virtio queue size in the guest is increased to 1024 (available to configure in -QEMU versions v2.10 and greater). This value can be set like so:: - - $ qemu-system-x86_64 ... -chardev socket,id=char1,path=,server - -netdev type=vhost-user,id=mynet1,chardev=char1,vhostforce - -device virtio-net-pci,mac=00:00:00:00:00:01,netdev=mynet1, - tx_queue_size=1024 - -Because of this limitation, this feature is considered 'experimental'. - -.. note:: - - Post-copy Live Migration is not compatible with dequeue zero copy. - Further information can be found in the `DPDK documentation `__ diff --git a/NEWS b/NEWS index 2f67d5047..2db246d1a 100644 --- a/NEWS +++ b/NEWS @@ -1,5 +1,7 @@ Post-v2.14.0 --------------------- + - DPDK: + * Deprecated vhost-user dequeue zero-copy support removed. v2.14.0 - 17 Aug 2020 diff --git a/lib/netdev-dpdk.c b/lib/netdev-dpdk.c index 18c4adcc7..515ad612e 100644 --- a/lib/netdev-dpdk.c +++ b/lib/netdev-dpdk.c @@ -2032,12 +2032,6 @@ netdev_dpdk_vhost_client_set_config(struct netdev *netdev, if (!nullable_string_is_equal(path, dev->vhost_id)) { free(dev->vhost_id); dev->vhost_id = nullable_xstrdup(path); - /* check zero copy configuration */ - if (smap_get_bool(args, "dq-zero-copy", false)) { - dev->vhost_driver_flags |= RTE_VHOST_USER_DEQUEUE_ZERO_COPY; - } else { - dev->vhost_driver_flags &= ~RTE_VHOST_USER_DEQUEUE_ZERO_COPY; - } netdev_request_reconfigure(netdev); } } @@ -5028,7 +5022,6 @@ netdev_dpdk_vhost_client_reconfigure(struct netdev *netdev) int err; uint64_t vhost_flags = 0; uint64_t vhost_unsup_flags; - bool zc_enabled; ovs_mutex_lock(&dev->mutex); @@ -5054,19 +5047,6 @@ netdev_dpdk_vhost_client_reconfigure(struct netdev *netdev) vhost_flags |= RTE_VHOST_USER_POSTCOPY_SUPPORT; } - zc_enabled = dev->vhost_driver_flags - & RTE_VHOST_USER_DEQUEUE_ZERO_COPY; - /* Enable zero copy flag, if requested */ - if (zc_enabled) { - vhost_flags |= RTE_VHOST_USER_DEQUEUE_ZERO_COPY; - /* DPDK vHost library doesn't allow zero-copy with linear buffers. - * Hence disable Linear buffer. - */ - vhost_flags &= ~RTE_VHOST_USER_LINEARBUF_SUPPORT; - VLOG_WARN("Zero copy enabled, disabling linear buffer" - " check for vHost port %s", dev->up.name); - } - /* Enable External Buffers if TCP Segmentation Offload is enabled. */ if (userspace_tso_enabled()) { vhost_flags |= RTE_VHOST_USER_EXTBUF_SUPPORT; @@ -5083,11 +5063,6 @@ netdev_dpdk_vhost_client_reconfigure(struct netdev *netdev) VLOG_INFO("vHost User device '%s' created in 'client' mode, " "using client socket '%s'", dev->up.name, dev->vhost_id); - if (zc_enabled) { - VLOG_INFO("Zero copy enabled for vHost port %s", dev->up.name); - VLOG_WARN("Zero copy support is deprecated and will be " - "removed in the next OVS release."); - } } err = rte_vhost_driver_callback_register(dev->vhost_id, diff --git a/vswitchd/vswitch.xml b/vswitchd/vswitch.xml index 81c84927f..07da2ee8c 100644 --- a/vswitchd/vswitch.xml +++ b/vswitchd/vswitch.xml @@ -3236,17 +3236,6 @@ ovs-vsctl add-port br0 p0 -- set Interface p0 type=patch options:peer=p1 \

- -

- The value specifies whether or not to enable dequeue zero copy on - the given interface. - Must be set before vhost-server-path is specified. - Only supported by dpdkvhostuserclient interfaces. - The feature is considered experimental. -

-
-