From mboxrd@z Thu Jan 1 00:00:00 1970 From: Yuanhan Liu Subject: Re: [PATCH v2 2/6] vhost: introduce vhost_log_write Date: Tue, 22 Dec 2015 14:09:35 +0800 Message-ID: <20151222060935.GL18863@yliu-dev.sh.intel.com> References: <1449027793-30975-1-git-send-email-yuanhan.liu@linux.intel.com> <1450321921-27799-1-git-send-email-yuanhan.liu@linux.intel.com> <1450321921-27799-3-git-send-email-yuanhan.liu@linux.intel.com> <20151222051102.GB7532@pxdev.xzpeter.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: "Michael S. Tsirkin" , dev@dpdk.org, Victor Kaplansky To: Peter Xu Return-path: Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by dpdk.org (Postfix) with ESMTP id A7C1D568D for ; Tue, 22 Dec 2015 07:08:24 +0100 (CET) Content-Disposition: inline In-Reply-To: <20151222051102.GB7532@pxdev.xzpeter.org> 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 Tue, Dec 22, 2015 at 01:11:02PM +0800, Peter Xu wrote: > On Thu, Dec 17, 2015 at 11:11:57AM +0800, Yuanhan Liu wrote: > > +static inline void __attribute__((always_inline)) > > +vhost_log_write(struct virtio_net *dev, uint64_t addr, uint64_t len) > > +{ > > + uint64_t page; > > + > > + if (likely(((dev->features & (1ULL << VHOST_F_LOG_ALL)) == 0) || > > + !dev->log_base || !len)) > > + return; > > + > > + if (unlikely(dev->log_size < ((addr + len - 1) / VHOST_LOG_PAGE / 8))) > > Should it be "<="? Right, thanks for catching it. --yliu