vhost: fix used descriptors number of mergeable enqueue
authorIlya Maximets <i.maximets@samsung.com>
Fri, 15 Jul 2016 11:15:04 +0000 (14:15 +0300)
committerThomas Monjalon <thomas.monjalon@6wind.com>
Fri, 15 Jul 2016 20:12:37 +0000 (22:12 +0200)
commit8729de6092cac2f4945c6bd81c997e8e1d41ed2b
treeff9ba4c93fa33585295d6e323a97ea76fd720a5d
parenteb68811af7185a2e5b582dfed8afd9840cf92854
vhost: fix used descriptors number of mergeable enqueue

Return value on error changed from '-1' to '0' because it returns
unsigned value and it means number of used descriptors.

Also fixed updating of 'last_used_idx' by using actual number of
used descriptors.

Fixes: 623bc47054d0 ("vhost: do sanity check for ring descriptor length")

Signed-off-by: Ilya Maximets <i.maximets@samsung.com>
Acked-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
lib/librte_vhost/vhost_rxtx.c