patches for DPDK stable branches
 help / color / mirror / Atom feed
From: Kevin Traynor <ktraynor@redhat.com>
To: Maxime Coquelin <maxime.coquelin@redhat.com>
Cc: Jens Freimann <jfreimann@redhat.com>,
	Tiwei Bie <tiwei.bie@intel.com>, dpdk stable <stable@dpdk.org>
Subject: [dpdk-stable] patch 'vhost: avoid memory barriers when no descriptors dequeued' has been queued to stable release 18.08.1
Date: Thu, 22 Nov 2018 16:49:46 +0000	[thread overview]
Message-ID: <20181122164957.13003-54-ktraynor@redhat.com> (raw)
In-Reply-To: <20181122164957.13003-1-ktraynor@redhat.com>

Hi,

FYI, your patch has been queued to stable release 18.08.1

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 11/28/18. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the patch applied
to the branch. If the code is different (ie: not only metadata diffs), due for example to
a change in context or macro names, please double check it.

Thanks.

Kevin Traynor

---
>From e0ac20188fdc6b7b0fddb4c813385dc5982fd3b4 Mon Sep 17 00:00:00 2001
From: Maxime Coquelin <maxime.coquelin@redhat.com>
Date: Tue, 23 Oct 2018 12:07:10 +0200
Subject: [PATCH] vhost: avoid memory barriers when no descriptors dequeued

[ upstream commit e988a6d84599f83321f8036dc45acf26a97ad7ea ]

In both split and packed dequeue paths, flush_shadow_used_ring
and vhost_ring_call variants gets called even if not packets
have been dequeued, and so no descriptors updates happened.

It has an impact on CPU pipeline, as memory barriers are used
in these functions.

This patch don't call these functions if no descriptors have
been dequeued. The performance gain with split ring when
dequeue zero-copy is disabled should be null, but should be
noticeable with packed ring or dequeue zero-copy enabled.

Fixes: ae999ce49dcb ("vhost: add Tx support for packed ring")
Fixes: 915cf9404225 ("vhost: use shadow used ring in dequeue path")

Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Reviewed-by: Jens Freimann <jfreimann@redhat.com>
Tested-by: Jens Freimann <jfreimann@redhat.com>
Reviewed-by: Tiwei Bie <tiwei.bie@intel.com>
---
 lib/librte_vhost/virtio_net.c | 24 ++++++++++++++++--------
 1 file changed, 16 insertions(+), 8 deletions(-)

diff --git a/lib/librte_vhost/virtio_net.c b/lib/librte_vhost/virtio_net.c
index 1c31c0562..8ad30c94a 100644
--- a/lib/librte_vhost/virtio_net.c
+++ b/lib/librte_vhost/virtio_net.c
@@ -1361,6 +1361,8 @@ virtio_dev_tx_split(struct virtio_net *dev, struct vhost_virtqueue *vq,
 		}
 
-		flush_shadow_used_ring_split(dev, vq);
-		vhost_vring_call_split(dev, vq);
+		if (likely(vq->shadow_used_idx)) {
+			flush_shadow_used_ring_split(dev, vq);
+			vhost_vring_call_split(dev, vq);
+		}
 	}
 
@@ -1441,6 +1443,8 @@ virtio_dev_tx_split(struct virtio_net *dev, struct vhost_virtqueue *vq,
 		if (unlikely(i < count))
 			vq->shadow_used_idx = i;
-		flush_shadow_used_ring_split(dev, vq);
-		vhost_vring_call_split(dev, vq);
+		if (likely(vq->shadow_used_idx)) {
+			flush_shadow_used_ring_split(dev, vq);
+			vhost_vring_call_split(dev, vq);
+		}
 	}
 
@@ -1477,6 +1481,8 @@ virtio_dev_tx_packed(struct virtio_net *dev, struct vhost_virtqueue *vq,
 		}
 
-		flush_shadow_used_ring_packed(dev, vq);
-		vhost_vring_call_packed(dev, vq);
+		if (likely(vq->shadow_used_idx)) {
+			flush_shadow_used_ring_packed(dev, vq);
+			vhost_vring_call_packed(dev, vq);
+		}
 	}
 
@@ -1556,6 +1562,8 @@ virtio_dev_tx_packed(struct virtio_net *dev, struct vhost_virtqueue *vq,
 		if (unlikely(i < count))
 			vq->shadow_used_idx = i;
-		flush_shadow_used_ring_packed(dev, vq);
-		vhost_vring_call_packed(dev, vq);
+		if (likely(vq->shadow_used_idx)) {
+			flush_shadow_used_ring_packed(dev, vq);
+			vhost_vring_call_packed(dev, vq);
+		}
 	}
 
-- 
2.19.0

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2018-11-22 16:47:33.690885454 +0000
+++ 0054-vhost-avoid-memory-barriers-when-no-descriptors-dequ.patch	2018-11-22 16:47:32.000000000 +0000
@@ -1,8 +1,10 @@
-From e988a6d84599f83321f8036dc45acf26a97ad7ea Mon Sep 17 00:00:00 2001
+From e0ac20188fdc6b7b0fddb4c813385dc5982fd3b4 Mon Sep 17 00:00:00 2001
 From: Maxime Coquelin <maxime.coquelin@redhat.com>
 Date: Tue, 23 Oct 2018 12:07:10 +0200
 Subject: [PATCH] vhost: avoid memory barriers when no descriptors dequeued
 
+[ upstream commit e988a6d84599f83321f8036dc45acf26a97ad7ea ]
+
 In both split and packed dequeue paths, flush_shadow_used_ring
 and vhost_ring_call variants gets called even if not packets
 have been dequeued, and so no descriptors updates happened.
@@ -17,7 +19,6 @@
 
 Fixes: ae999ce49dcb ("vhost: add Tx support for packed ring")
 Fixes: 915cf9404225 ("vhost: use shadow used ring in dequeue path")
-Cc: stable@dpdk.org
 
 Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
 Reviewed-by: Jens Freimann <jfreimann@redhat.com>

  parent reply	other threads:[~2018-11-22 16:53 UTC|newest]

Thread overview: 71+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-22 16:48 [dpdk-stable] patch 'crypto/mvsam: fix shared library build' " Kevin Traynor
2018-11-22 16:48 ` [dpdk-stable] patch 'crypto/mvsam: update hash digest sizes' " Kevin Traynor
2018-11-22 16:48 ` [dpdk-stable] patch 'compressdev: fix compression API description' " Kevin Traynor
2018-11-22 16:48 ` [dpdk-stable] patch 'cryptodev: fix pool element size for undefined operation' " Kevin Traynor
2018-11-22 16:48 ` [dpdk-stable] patch 'cryptodev: fix library version' " Kevin Traynor
2018-11-22 16:48 ` [dpdk-stable] patch 'common/qat: fix failure to create PMD' " Kevin Traynor
2018-11-22 16:48 ` [dpdk-stable] patch 'net/avf: fix build with debug enabled' " Kevin Traynor
2018-11-22 16:49 ` [dpdk-stable] patch 'doc: remove invalid config option from ena guide' " Kevin Traynor
2018-11-22 16:49 ` [dpdk-stable] patch 'doc: remove invalid config options from liquidio " Kevin Traynor
2018-11-22 16:49 ` [dpdk-stable] patch 'net/qede: remove invalid config option checks' " Kevin Traynor
2018-11-22 16:49 ` [dpdk-stable] patch 'app/testpmd: fix vdev socket initialization' " Kevin Traynor
2018-11-22 16:49 ` [dpdk-stable] patch 'vhost: fix notification for packed ring' " Kevin Traynor
2018-11-22 16:49 ` [dpdk-stable] patch 'vhost: fix error handling when mem table gets updated' " Kevin Traynor
2018-11-22 16:49 ` [dpdk-stable] patch 'mbuf: fix offload flag name and list' " Kevin Traynor
2018-11-22 17:00   ` Kevin Traynor
2018-11-30 10:18     ` Kevin Traynor
2018-12-03  5:52       ` Jerin Jacob
2018-12-03 17:12         ` Kevin Traynor
2018-11-22 16:49 ` [dpdk-stable] patch 'doc: clarify VLAN and QinQ Tx offload prerequisite' " Kevin Traynor
2018-11-22 16:49 ` [dpdk-stable] patch 'net/tap: fix reported number of Tx packets' " Kevin Traynor
2018-11-22 16:49 ` [dpdk-stable] patch 'app/testpmd: fix physical port socket initialization' " Kevin Traynor
2018-11-22 16:49 ` [dpdk-stable] patch 'mem: improve segment list preallocation' " Kevin Traynor
2018-11-26 11:16   ` Burakov, Anatoly
2018-11-26 11:36     ` Kevin Traynor
2018-11-22 16:49 ` [dpdk-stable] patch 'mem: fix resource leak' " Kevin Traynor
2018-11-22 16:49 ` [dpdk-stable] patch 'kvargs: fix processing a null list' " Kevin Traynor
2018-11-22 16:49 ` [dpdk-stable] patch 'ipc: fix undefined behavior in no-shconf mode' " Kevin Traynor
2018-11-22 16:49 ` [dpdk-stable] patch 'raw/skeleton: fix memory leak on test failure' " Kevin Traynor
2018-11-22 16:49 ` [dpdk-stable] patch 'igb_uio: fix unexpected removal for hot-unplug' " Kevin Traynor
2018-11-22 16:49 ` [dpdk-stable] patch 'devargs: fix variadic parsing memory leak' " Kevin Traynor
2018-11-22 16:49 ` [dpdk-stable] patch 'bus/vdev: fix multi-process IPC buffer leak on scan' " Kevin Traynor
2018-11-22 16:49 ` [dpdk-stable] patch 'latency: fix timestamp marking and latency calculation' " Kevin Traynor
2018-11-22 16:49 ` [dpdk-stable] patch 'bpf: fix a typo' " Kevin Traynor
2018-11-22 16:49 ` [dpdk-stable] patch 'mbuf: fix library version on meson build' " Kevin Traynor
2018-11-22 16:49 ` [dpdk-stable] patch 'ring: add library version to " Kevin Traynor
2018-11-22 16:49 ` [dpdk-stable] patch 'test/hash: fix bucket size in perf test' " Kevin Traynor
2018-11-22 16:49 ` [dpdk-stable] patch 'test/hash: fix r/w test with non-consecutive cores' " Kevin Traynor
2018-11-22 16:49 ` [dpdk-stable] patch 'test/hash: add missing file in meson build' " Kevin Traynor
2018-11-22 16:49 ` [dpdk-stable] patch 'hash: remove unused constant' " Kevin Traynor
2018-11-22 16:49 ` [dpdk-stable] patch 'hash: fix race condition in iterate' " Kevin Traynor
2018-11-22 16:49 ` [dpdk-stable] patch 'hash: fix key store element alignment' " Kevin Traynor
2018-11-22 16:49 ` [dpdk-stable] patch 'kni: fix build on Linux 4.19' " Kevin Traynor
2018-11-22 16:49 ` [dpdk-stable] patch 'kni: fix FIFO synchronization' " Kevin Traynor
2018-11-22 16:49 ` [dpdk-stable] patch 'kni: fix kernel " Kevin Traynor
2018-11-22 16:49 ` [dpdk-stable] patch 'test/kni: check module dependency' " Kevin Traynor
2018-11-22 16:49 ` [dpdk-stable] patch 'hash: remove unnecessary pause' " Kevin Traynor
2018-11-22 16:49 ` [dpdk-stable] patch 'kni: fix build on Linux < 3.14' " Kevin Traynor
2018-11-22 16:49 ` [dpdk-stable] patch 'app/testpmd: reserve NUMA node per port and per ring' " Kevin Traynor
2018-11-22 16:49 ` [dpdk-stable] patch 'net/i40e: keep promiscuous on if allmulticast is enabled' " Kevin Traynor
2018-11-22 16:49 ` [dpdk-stable] patch 'doc: fix spelling in PMD guides' " Kevin Traynor
2018-11-22 16:49 ` [dpdk-stable] patch 'net/enic: fix supported packet types' " Kevin Traynor
2018-11-22 16:49 ` [dpdk-stable] patch 'ethdev: fix doxygen comments of shared data fields' " Kevin Traynor
2018-11-22 16:49 ` [dpdk-stable] patch 'vhost/crypto: fix shared lib build without cryptodev' " Kevin Traynor
2018-11-22 16:49 ` [dpdk-stable] patch 'vhost: fix vector filling for packed ring' " Kevin Traynor
2018-11-22 16:49 ` [dpdk-stable] patch 'net/ixgbe: fix flow create in ntuple check' " Kevin Traynor
2018-11-22 16:49 ` [dpdk-stable] patch 'net/i40e: enable loopback function for X722 MAC' " Kevin Traynor
2018-11-22 16:49 ` [dpdk-stable] patch 'net/i40e: cancel alarm handler at the end of closure' " Kevin Traynor
2018-11-22 16:49 ` [dpdk-stable] patch 'net/ixgbe: fix RSS flow error return' " Kevin Traynor
2018-11-22 16:49 ` [dpdk-stable] patch 'net/i40e: update Tx offload mask' " Kevin Traynor
2018-11-22 16:49 ` Kevin Traynor [this message]
2018-11-22 16:49 ` [dpdk-stable] patch 'raw/ifpga: check probing error' " Kevin Traynor
2018-11-22 16:49 ` [dpdk-stable] patch 'net/ixgbe: update Tx offload mask' " Kevin Traynor
2018-11-22 16:49 ` [dpdk-stable] patch 'net/ena: recreate HW IO rings on start and stop' " Kevin Traynor
2018-11-22 16:49 ` [dpdk-stable] patch 'net/ena: fix passing RSS hash to mbuf' " Kevin Traynor
2018-11-22 16:49 ` [dpdk-stable] patch 'doc: fix typo in testpmd guide' " Kevin Traynor
2018-11-22 16:49 ` [dpdk-stable] patch 'app/testpmd: fix QinQ strip display option' " Kevin Traynor
2018-11-22 16:49 ` [dpdk-stable] patch 'common/qat: fix for invalid response from firmware' " Kevin Traynor
2018-11-22 16:49 ` [dpdk-stable] patch 'vfio: disable in FreeBSD build with meson' " Kevin Traynor
2018-11-22 16:49 ` [dpdk-stable] patch 'net/nfp: " Kevin Traynor
2018-11-22 16:49 ` [dpdk-stable] patch 'net/avp: " Kevin Traynor
2018-11-22 16:49 ` [dpdk-stable] patch 'net/softnic: " Kevin Traynor

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20181122164957.13003-54-ktraynor@redhat.com \
    --to=ktraynor@redhat.com \
    --cc=jfreimann@redhat.com \
    --cc=maxime.coquelin@redhat.com \
    --cc=stable@dpdk.org \
    --cc=tiwei.bie@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).