From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mailout3.w1.samsung.com (mailout3.w1.samsung.com [210.118.77.13]) by dpdk.org (Postfix) with ESMTP id AB449C4AE for ; Fri, 19 Feb 2016 07:32:55 +0100 (CET) Received: from eucpsbgm2.samsung.com (unknown [203.254.199.245]) by mailout3.w1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0O2S00CFS7IU8Z70@mailout3.w1.samsung.com> for dev@dpdk.org; Fri, 19 Feb 2016 06:32:54 +0000 (GMT) X-AuditID: cbfec7f5-f79b16d000005389-4e-56c6b71506be Received: from eusync4.samsung.com ( [203.254.199.214]) by eucpsbgm2.samsung.com (EUCPMTA) with SMTP id 39.48.21385.517B6C65; Fri, 19 Feb 2016 06:32:53 +0000 (GMT) Received: from imaximets.rnd.samsung.ru ([106.109.129.180]) by eusync4.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0O2S00G447IL8D70@eusync4.samsung.com>; Fri, 19 Feb 2016 06:32:53 +0000 (GMT) From: Ilya Maximets To: dev@dpdk.org, Huawei Xie , Yuanhan Liu Date: Fri, 19 Feb 2016 09:32:40 +0300 Message-id: <1455863563-15751-2-git-send-email-i.maximets@samsung.com> X-Mailer: git-send-email 2.5.0 In-reply-to: <1455863563-15751-1-git-send-email-i.maximets@samsung.com> References: <1455863563-15751-1-git-send-email-i.maximets@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFprGLMWRmVeSWpSXmKPExsVy+t/xa7qi24+FGSw9o2fx7tN2Jov2mWeZ LK60/2S3mDjJxGL60wiLybOlLK5PuMDqwO6x4UQ/q8evBUtZPRbvecnkcefaHjaPeScDPfq2 rGIMYIvisklJzcksSy3St0vgypg54xhrQRN3Rc/LuSwNjL2cXYycHBICJhJ7J3xjgrDFJC7c W8/WxcjFISSwlFFiV+tkKKeVSWLb5152kCo2AR2JU6uPMILYIgIJEkf2/2YFKWIWWMYocfHE ZLBRwgJeEv8f3AcrYhFQldj79iMziM0r4CZx6+1+IJsDaJ2cxIIL6SBhTgF3iS+bWsDKhYBK +s7uYpzAyLuAkWEVo2hqaXJBcVJ6rpFecWJucWleul5yfu4mRkhofd3BuPSY1SFGAQ5GJR7e Cr1jYUKsiWXFlbmHGCU4mJVEeHX9gUK8KYmVValF+fFFpTmpxYcYpTlYlMR5Z+56HyIkkJ5Y kpqdmlqQWgSTZeLglGpgLFhw8MLb/8Hf37JGvzTXjVTrUai/GTtpU+EVu8VZldWX4jZWTkv3 ejInoMK5eM/qyvXbjvS8OeN9/AqLY+6JUMvG09wp3TxZzq2fFjAEb+A72n7n/N38it7bEqu4 U5aEulcLxn7s2+eRfOnjLYFw3acvF0uz3jwiudpwatJ1xx2Kv+KzFezilViKMxINtZiLihMB Z4vKOSkCAAA= Cc: Ilya Maximets , Dyasly Sergey Subject: [dpdk-dev] [PATCH RFC 1/4] vhost: use SMP barriers instead of compiler ones. X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Feb 2016 06:32:55 -0000 Since commit 4c02e453cc62 ("eal: introduce SMP memory barriers") virtio uses architecture dependent SMP barriers. vHost should use them too. Fixes: 4c02e453cc62 ("eal: introduce SMP memory barriers") Signed-off-by: Ilya Maximets --- lib/librte_vhost/vhost_rxtx.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/librte_vhost/vhost_rxtx.c b/lib/librte_vhost/vhost_rxtx.c index 5e7e5b1..411dd95 100644 --- a/lib/librte_vhost/vhost_rxtx.c +++ b/lib/librte_vhost/vhost_rxtx.c @@ -274,7 +274,7 @@ virtio_dev_rx(struct virtio_net *dev, uint16_t queue_id, } } - rte_compiler_barrier(); + rte_smp_wmb(); /* Wait until it's our turn to add our buffer to the used ring. */ while (unlikely(vq->last_used_idx != res_base_idx)) @@ -575,7 +575,7 @@ virtio_dev_merge_rx(struct virtio_net *dev, uint16_t queue_id, entry_success = copy_from_mbuf_to_vring(dev, queue_id, res_base_idx, res_cur_idx, pkts[pkt_idx]); - rte_compiler_barrier(); + rte_smp_wmb(); /* * Wait until it's our turn to add our buffer @@ -917,7 +917,7 @@ rte_vhost_dequeue_burst(struct virtio_net *dev, uint16_t queue_id, entry_success++; } - rte_compiler_barrier(); + rte_smp_rmb(); vq->used->idx += entry_success; /* Kick guest if required. */ if (!(vq->avail->flags & VRING_AVAIL_F_NO_INTERRUPT)) -- 2.5.0