patches for DPDK stable branches
 help / color / mirror / Atom feed
From: Yuanhan Liu <yliu@fridaylinux.org>
To: Tiwei Bie <tiwei.bie@intel.com>
Cc: Xiao Wang <xiao.w.wang@intel.com>,
	Maxime Coquelin <maxime.coquelin@redhat.com>,
	dpdk stable <stable@dpdk.org>, Yuanhan Liu <yliu@fridaylinux.org>
Subject: [dpdk-stable] patch 'vhost: make page logging atomic' has been queued to LTS release 16.11.3
Date: Wed,  9 Aug 2017 11:44:00 +0800	[thread overview]
Message-ID: <1502250240-6599-18-git-send-email-yliu@fridaylinux.org> (raw)
In-Reply-To: <1502250240-6599-1-git-send-email-yliu@fridaylinux.org>

Hi,

FYI, your patch has been queued to LTS release 16.11.3

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

Thanks.

	--yliu

---
>From c2d9c76b26d6626979ada03206a268b55d8f1248 Mon Sep 17 00:00:00 2001
From: Tiwei Bie <tiwei.bie@intel.com>
Date: Tue, 1 Aug 2017 17:01:21 +0800
Subject: [PATCH] vhost: make page logging atomic

[ backported from upstream commit 897f13a1f726cefdc68762da83f9d2225a85c27e ]

Each dirty page logging operation should be atomic. But it's not
atomic in current implementation. So it's possible that some dirty
pages can't be logged successfully when different threads try to
log different pages into the same byte of the log buffer concurrently.
This patch fixes this issue.

Fixes: b171fad1ffa5 ("vhost: log used vring changes")

Reported-by: Xiao Wang <xiao.w.wang@intel.com>
Signed-off-by: Tiwei Bie <tiwei.bie@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
---
 lib/librte_vhost/virtio_net.c | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/lib/librte_vhost/virtio_net.c b/lib/librte_vhost/virtio_net.c
index ec9f1e5..0027f39 100644
--- a/lib/librte_vhost/virtio_net.c
+++ b/lib/librte_vhost/virtio_net.c
@@ -50,10 +50,19 @@
 #define MAX_PKT_BURST 32
 #define VHOST_LOG_PAGE	4096
 
+/*
+ * Atomically set a bit in memory.
+ */
+static inline void __attribute__((always_inline))
+vhost_set_bit(unsigned int nr, volatile uint8_t *addr)
+{
+	__sync_fetch_and_or_8(addr, (1U << nr));
+}
+
 static inline void __attribute__((always_inline))
 vhost_log_page(uint8_t *log_base, uint64_t page)
 {
-	log_base[page / 8] |= 1 << (page % 8);
+	vhost_set_bit(page % 8, &log_base[page / 8]);
 }
 
 static inline void __attribute__((always_inline))
-- 
2.7.4

      parent reply	other threads:[~2017-08-09  3:48 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-09  3:43 [dpdk-stable] patch 'crypto/aesni_mb: fix HMAC supported key sizes' " Yuanhan Liu
2017-08-09  3:43 ` [dpdk-stable] patch 'crypto/openssl: " Yuanhan Liu
2017-08-09  3:43 ` [dpdk-stable] patch 'mbuf: fix doxygen comment of bulk alloc' " Yuanhan Liu
2017-08-09  3:43 ` [dpdk-stable] patch 'net/bnxt: fix set link config' " Yuanhan Liu
2017-08-09  3:43 ` [dpdk-stable] patch 'net/bnxt: check invalid L2 filter id' " Yuanhan Liu
2017-08-09  3:43 ` [dpdk-stable] patch 'net/bnxt: free filter before reusing it' " Yuanhan Liu
2017-08-09  3:43 ` [dpdk-stable] patch 'net/ixgbe: fix mirror rule index overflow' " Yuanhan Liu
2017-08-09  3:43 ` [dpdk-stable] patch 'net/mlx5: fix inconsistent link status query' " Yuanhan Liu
2017-08-09  3:43 ` [dpdk-stable] patch 'net/i40e: fix PF notify when VF is not up' " Yuanhan Liu
2017-08-09  3:53   ` Li, Xiaoyun
2017-08-09  4:05     ` Yuanhan Liu
2017-08-09  3:43 ` [dpdk-stable] patch 'test/bonding: fix memory corruptions' " Yuanhan Liu
2017-08-09  3:43 ` [dpdk-stable] patch 'test/bonding: fix parameters of a balance Tx' " Yuanhan Liu
2017-08-09  3:43 ` [dpdk-stable] patch 'test/bonding: fix namespace of the RSS tests' " Yuanhan Liu
2017-08-09  3:43 ` [dpdk-stable] patch 'net/qede: fix chip details print' " Yuanhan Liu
2017-08-09  3:43 ` [dpdk-stable] patch 'net/vmxnet3: fix filtering on promiscuous disabling' " Yuanhan Liu
2017-08-09  3:43 ` [dpdk-stable] patch 'net/i40e: fix Rx data segment buffer length' " Yuanhan Liu
2017-08-09  3:43 ` [dpdk-stable] patch 'net/enic: fix crash when freeing 0 packet to mempool' " Yuanhan Liu
2017-08-09 19:27   ` John Daley (johndale)
2017-08-10  1:24     ` Yuanhan Liu
2017-08-09  3:43 ` [dpdk-stable] patch 'examples/l3fwd: fix IPv6 packet type parse' " Yuanhan Liu
2017-08-09  3:44 ` Yuanhan Liu [this message]

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=1502250240-6599-18-git-send-email-yliu@fridaylinux.org \
    --to=yliu@fridaylinux.org \
    --cc=maxime.coquelin@redhat.com \
    --cc=stable@dpdk.org \
    --cc=tiwei.bie@intel.com \
    --cc=xiao.w.wang@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).