From mboxrd@z Thu Jan 1 00:00:00 1970 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) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga102.fm.intel.com with ESMTP; 08 Dec 2015 19:41:46 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.20,401,1444719600"; d="scan'208";a="837299611" Received: from yliu-dev.sh.intel.com (HELO yliu-dev) ([10.239.66.49]) by orsmga001.jf.intel.com with ESMTP; 08 Dec 2015 19:41:42 -0800 Date: Wed, 9 Dec 2015 11:42:51 +0800 From: Yuanhan Liu To: "Xie, Huawei" 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 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Cc: "dev@dpdk.org" , Victor Kaplansky , "Michael S. Tsirkin" Subject: Re: [dpdk-dev] [PATCH 2/4] vhost: introduce vhost_log_write 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, 09 Dec 2015 03:41:47 -0000 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