From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stephen Hemminger Subject: Re: [PATCH v2 02/24] virtio: Use weaker barriers Date: Tue, 27 Jan 2015 09:58:31 +0000 Message-ID: <20150127095831.1572b67a@uryu.home.lan> References: <1421298930-15210-1-git-send-email-changchun.ouyang@intel.com> <1422326164-13697-1-git-send-email-changchun.ouyang@intel.com> <1422326164-13697-3-git-send-email-changchun.ouyang@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: "dev-VfR2kkLFssw@public.gmane.org" To: "Xie, Huawei" Return-path: In-Reply-To: List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces-VfR2kkLFssw@public.gmane.org Sender: "dev" > I recall our original code is virtio_wmb(). > Use store fence to ensure all updates to entries before updating the index. > Why do we need virtio_rmb() here and add virtio_wmb after vq_update_avail_idx()? Store fence is unnecessary, Intel CPU's are cache coherent, please read the virtio Linux ring header file for explanation. A full fence WMB is more expensive and causes CPU stall > > vq->vq_ring.avail->idx = vq->vq_avail_idx; > > } > > > > @@ -255,7 +264,7 @@ static inline void > > virtqueue_notify(struct virtqueue *vq) > > { > > /* > > - * Ensure updated avail->idx is visible to host. mb() necessary? > > + * Ensure updated avail->idx is visible to host. > > * For virtio on IA, the notificaiton is through io port operation > > * which is a serialization instruction itself. > > */ > > -- > > 1.8.4.2 >