Re: [PATCH v2 2/6] vhost: introduce vhost_log_write
From: Peter Xu <peterx@redhat.com>
Date: 2015-12-22 05:11:12
From: Peter Xu <peterx@redhat.com>
Date: 2015-12-22 05:11:12
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