From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Xie, Huawei" Subject: Re: [PATCH 2/4] vhost: introduce vhost_log_write Date: Wed, 9 Dec 2015 05:44:11 +0000 Message-ID: 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> <20151209034251.GM29571@yliu-dev.sh.intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Cc: "dev@dpdk.org" , Victor Kaplansky , "Michael S. Tsirkin" To: Yuanhan Liu Return-path: Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by dpdk.org (Postfix) with ESMTP id 85B195683 for ; Wed, 9 Dec 2015 06:44:15 +0100 (CET) Content-Language: en-US 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 12/9/2015 11:41 AM, Yuanhan Liu wrote:=0A= > On Wed, Dec 09, 2015 at 03:33:16AM +0000, Xie, Huawei wrote:=0A= > ...=0A= >>>> +static inline void __attribute__((always_inline))=0A= >>>> +vhost_log_write(struct virtio_net *dev, struct vhost_virtqueue *vq,= =0A= >>>> + uint64_t offset, uint64_t len)=0A= >>>> +{=0A= >>>> + uint64_t addr =3D vq->log_guest_addr;=0A= >>>> + uint64_t page;=0A= >>>> +=0A= >>>> + if (unlikely(((dev->features & (1ULL << VHOST_F_LOG_ALL)) =3D=3D 0) = ||=0A= >>>> + !dev->log_base || !len))=0A= >>>> + return;=0A= >>> Isn't "likely" more appropriate in above, since the whole=0A= >>> expression is expected to be true most of the time?=0A= >> Victor:=0A= >> So we are not always logging, what is the message that tells the backend= =0A= >> the migration is started?=0A= > When log starts, VHOST_USER_SET_FEATURES request will be sent again,=0A= > with VHOST_F_LOG_ALL feature bit set.=0A= As the VHOST_USER_SET_FEATURES handling and rx/tx runs asynchronously,=0A= we have to make sure we don't miss logging anything when this feature is=0A= set. For example, I doubt like in virtio_dev_rx, is the dev->features=0A= volatile?=0A= > --yliu=0A= >=0A= =0A=