DPDK patches and discussions
 help / color / mirror / Atom feed
From: Ilya Maximets <i.maximets@samsung.com>
To: dev@dpdk.org, Maxime Coquelin <maxime.coquelin@redhat.com>
Cc: HePeng <xnhp0320@icloud.com>, Tiwei Bie <tiwei.bie@intel.com>,
	Zhihong Wang <zhihong.wang@intel.com>
Subject: Re: [dpdk-dev] Missing an increment on vq->log_cache_nb_elem ?
Date: Fri, 15 Jun 2018 15:32:07 +0300	[thread overview]
Message-ID: <20180615123208eucas1p1e5d258f95e9621a31c2fcfbf1f494476~4VVxsfFEy3007530075eucas1p1f@eucas1p1.samsung.com> (raw)
In-Reply-To: <462941BC-FB45-46BD-8FB2-3455887D6BAB@icloud.com>

> 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 ?

Hi. Thanks for pointing that.

I looked through the code and I see no updates of 'vq->log_cache_nb_elem'.
Looks like it always equal to initial zero value.

Maxime, I'm afraid that this means that currently pages logging is not
performed at all. Could you please check?

Best regards, Ilya Maximets.

  parent reply	other threads:[~2018-06-15 12:32 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-14 12:44 HePeng
     [not found] ` <CGME20180615123208eucas1p1e5d258f95e9621a31c2fcfbf1f494476@eucas1p1.samsung.com>
2018-06-15 12:32   ` Ilya Maximets [this message]
2018-06-15 13:24     ` Maxime Coquelin
2018-06-15 13:28       ` HePeng

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='20180615123208eucas1p1e5d258f95e9621a31c2fcfbf1f494476~4VVxsfFEy3007530075eucas1p1f@eucas1p1.samsung.com' \
    --to=i.maximets@samsung.com \
    --cc=dev@dpdk.org \
    --cc=maxime.coquelin@redhat.com \
    --cc=tiwei.bie@intel.com \
    --cc=xnhp0320@icloud.com \
    --cc=zhihong.wang@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).