vhost: fix default value of kickfd and callfd
authorTetsuya Mukawa <mukawa@igel.co.jp>
Mon, 14 Mar 2016 08:53:32 +0000 (17:53 +0900)
committerThomas Monjalon <thomas.monjalon@6wind.com>
Mon, 14 Mar 2016 23:20:29 +0000 (00:20 +0100)
commitfb871d0a4dc1c038a381c524cdb86fe83d21d842
tree841cf102ef809abe50e68a660b08b2d5c7c7b70b
parenta436f53ebfeb5a76df1e2248db8064e9dab8e739
vhost: fix default value of kickfd and callfd

Currently, default values of kickfd and callfd are -1.
If the values are -1, current code guesses kickfd and callfd haven't
been initialized yet. Then vhost library will guess the virtqueue isn't
ready for processing.

But callfd and kickfd will be set as -1 when "--enable-kvm"
isn't specified in QEMU command line. It means we cannot treat -1 as
uninitialized state.

The patch defines -1 and -2 as VIRTIO_INVALID_EVENTFD and
VIRTIO_UNINITIALIZED_EVENTFD, and uses VIRTIO_UNINITIALIZED_EVENTFD for
the default values of kickfd and callfd.

Signed-off-by: Tetsuya Mukawa <mukawa@igel.co.jp>
Acked-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
lib/librte_vhost/rte_virtio_net.h
lib/librte_vhost/vhost_rxtx.c
lib/librte_vhost/vhost_user/virtio-net-user.c
lib/librte_vhost/virtio-net.c