From mboxrd@z Thu Jan 1 00:00:00 1970 From: Peter Xu Subject: Re: [PATCH v2 2/6] vhost: introduce vhost_log_write Date: Tue, 22 Dec 2015 13:11:02 +0800 Message-ID: <20151222051102.GB7532@pxdev.xzpeter.org> 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> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Cc: "Michael S. Tsirkin" , dev@dpdk.org, Victor Kaplansky To: Yuanhan Liu Return-path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by dpdk.org (Postfix) with ESMTP id 8CA375A24 for ; Tue, 22 Dec 2015 06:11:12 +0100 (CET) Content-Disposition: inline In-Reply-To: <1450321921-27799-3-git-send-email-yuanhan.liu@linux.intel.com> 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 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 "<="? Peter