From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mailout4.w1.samsung.com (mailout4.w1.samsung.com [210.118.77.14]) by dpdk.org (Postfix) with ESMTP id 82E5E2BC8 for ; Wed, 24 Feb 2016 12:47:35 +0100 (CET) Received: from eucpsbgm2.samsung.com (unknown [203.254.199.245]) by mailout4.w1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0O31008OUVFABGA0@mailout4.w1.samsung.com> for dev@dpdk.org; Wed, 24 Feb 2016 11:47:34 +0000 (GMT) X-AuditID: cbfec7f5-f79b16d000005389-d4-56cd985606cd Received: from eusync4.samsung.com ( [203.254.199.214]) by eucpsbgm2.samsung.com (EUCPMTA) with SMTP id 02.79.21385.6589DC65; Wed, 24 Feb 2016 11:47:34 +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 <0O3100380VF3RS40@eusync4.samsung.com>; Wed, 24 Feb 2016 11:47:34 +0000 (GMT) From: Ilya Maximets To: dev@dpdk.org, Huawei Xie , Yuanhan Liu Date: Wed, 24 Feb 2016 14:47:16 +0300 Message-id: <1456314438-4021-2-git-send-email-i.maximets@samsung.com> X-Mailer: git-send-email 2.5.0 In-reply-to: <1456314438-4021-1-git-send-email-i.maximets@samsung.com> References: <1456314438-4021-1-git-send-email-i.maximets@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrBLMWRmVeSWpSXmKPExsVy+t/xa7phM86GGdztYbZ492k7k0X7zLNM Flfaf7JbTJxkYjH9aYTFsZ5PrBaTZ0tZfNk0nc3i+oQLrA6cHhf77zB6bDjRz+rxa8FSVo/G 5xIei/e8ZPK4c20Pm8e8k4EefVtWMQZwRHHZpKTmZJalFunbJXBl/P4dVdDBXXHj1yfGBsap nF2MnBwSAiYS6y5vYIOwxSQu3FsPZHNxCAksZZT4eHE+O4TTyiRx89h3JpAqNgEdiVOrjzCC 2CICCRJH9v9mBSliFvjNKLFjTxMzSEJYwFfiSfcbsAYWAVWJhm+fwWxeAVeJpZ1XgBo4gNbJ SSy4kA4S5hRwk1g8azFYqxBQydsXx5kmMPIuYGRYxSiaWppcUJyUnmukV5yYW1yal66XnJ+7 iRESfl93MC49ZnWIUYCDUYmH98GGM2FCrIllxZW5hxglOJiVRHjjpp0NE+JNSaysSi3Kjy8q zUktPsQozcGiJM47c9f7ECGB9MSS1OzU1ILUIpgsEwenVAOjfLZ2fVScSN5e3/wr1mKNa/fc yJayXxQr8yBadV/YEQfNB98/b7QVWj3V6H/+v+VHtVgcjWUe3/5hvMlo0bUN5+f+6HWflKC4 r3tNhuda9YdGVmc1ew9VqS78Hz799LtZthduse/brs3F/It5wrZP1sUfUsx92OYb5Rw8f3rx PscF2wXW3Vd6rsRSnJFoqMVcVJwIAC/zts87AgAA Cc: Dyasly Sergey , Ilya Maximets Subject: [dpdk-dev] [PATCH RFC v3 1/3] 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: Wed, 24 Feb 2016 11:47:36 -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 12ce0cc..14c2159 100644 --- a/lib/librte_vhost/vhost_rxtx.c +++ b/lib/librte_vhost/vhost_rxtx.c @@ -316,7 +316,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)) @@ -634,7 +634,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 @@ -979,7 +979,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; vhost_log_used_vring(dev, vq, offsetof(struct vring_used, idx), sizeof(vq->used->idx)); -- 2.5.0