From mboxrd@z Thu Jan 1 00:00:00 1970 From: Yuanhan Liu Subject: Re: [PATCH 2/4] vhost: introduce vhost_log_write Date: Wed, 9 Dec 2015 11:42:51 +0800 Message-ID: <20151209034251.GM29571@yliu-dev.sh.intel.com> References: <1449027793-30975-1-git-send-email-yuanhan.liu@linux.intel.com> <1449027793-30975-3-git-send-email-yuanhan.liu@linux.intel.com> <20151202153050-mutt-send-email-victork@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: "dev@dpdk.org" , Victor Kaplansky , "Michael S. Tsirkin" To: "Xie, Huawei" Return-path: Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by dpdk.org (Postfix) with ESMTP id 0F82158D4 for ; Wed, 9 Dec 2015 04:41:46 +0100 (CET) Content-Disposition: inline In-Reply-To: List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On Wed, Dec 09, 2015 at 03:33:16AM +0000, Xie, Huawei wrote: ... > >> +static inline void __attribute__((always_inline)) > >> +vhost_log_write(struct virtio_net *dev, struct vhost_virtqueue *vq, > >> + uint64_t offset, uint64_t len) > >> +{ > >> + uint64_t addr = vq->log_guest_addr; > >> + uint64_t page; > >> + > >> + if (unlikely(((dev->features & (1ULL << VHOST_F_LOG_ALL)) == 0) || > >> + !dev->log_base || !len)) > >> + return; > > Isn't "likely" more appropriate in above, since the whole > > expression is expected to be true most of the time? > Victor: > So we are not always logging, what is the message that tells the backend > the migration is started? When log starts, VHOST_USER_SET_FEATURES request will be sent again, with VHOST_F_LOG_ALL feature bit set. --yliu