vhost: introduce last available index for dequeue
authorYuanhan Liu <yuanhan.liu@linux.intel.com>
Sun, 9 Oct 2016 07:27:56 +0000 (15:27 +0800)
committerYuanhan Liu <yuanhan.liu@linux.intel.com>
Wed, 12 Oct 2016 07:45:12 +0000 (09:45 +0200)
commitf6be82d7259ee35683721092d61283d99a47aff1
treea3d78f144b68ce0f6ec651dc2fbace2a76314f5d
parente246896178e69c31e2f589b45d3acf1e307efe58
vhost: introduce last available index for dequeue

So far, we retrieve both the used ring and avail ring idx by the var
last_used_idx; it won't be a problem because the used ring is updated
immediately after those avail entries are consumed.

But that's not true when dequeue zero copy is enabled, that used ring is
updated only when the mbuf is consumed. Thus, we need use another var to
note the last avail ring idx we have consumed.

Therefore, last_avail_idx is introduced.

Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Tested-by: Qian Xu <qian.q.xu@intel.com>
lib/librte_vhost/vhost.h
lib/librte_vhost/vhost_user.c
lib/librte_vhost/virtio_net.c