All of lore.kernel.org
 help / color / mirror / Atom feed
* missing vq->log_cache_nb_elem ++ ?
@ 2018-06-13  9:55 HePeng
  0 siblings, 0 replies; only message in thread
From: HePeng @ 2018-06-13  9:55 UTC (permalink / raw)
  To: dev

Hi, 


In the latest dpdk master branch, in the function *vhost_log_cache_page*:


static __rte_always_inline void
vhost_log_cache_page(struct virtio_net *dev, struct vhost_virtqueue *vq,
			uint64_t page)
{
	uint32_t bit_nr = page % (sizeof(unsigned long) << 3);
	uint32_t offset = page / (sizeof(unsigned long) << 3);
	int i;

	for (i = 0; i < vq->log_cache_nb_elem; i++) {
		struct log_cache_entry *elem = vq->log_cache + i;

		if (elem->offset == offset) {
			elem->val |= (1UL << bit_nr);
			return;
		}
	}

	if (unlikely(i >= VHOST_LOG_CACHE_NR)) {
		/*
		 * No more room for a new log cache entry,
		 * so write the dirty log map directly.
		 */
		rte_smp_wmb();
		vhost_log_page((uint8_t *)(uintptr_t)dev->log_base, page);

		return;
	}

	vq->log_cache[i].offset = offset;
	vq->log_cache[i].val = (1UL << bit_nr);
}

Did it just miss an increment on vq->log_cache_nb_elem ?

Looks like a vq->log_cache_nb_elem++ is needed here.

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2018-06-13  9:55 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-06-13  9:55 missing vq->log_cache_nb_elem ++ ? HePeng

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.