[dpdk-dev] [PATCH v2] vhost: Fix default value of kickfd and callfd

Yuanhan Liu yuanhan.liu at linux.intel.com
Fri Mar 11 08:19:07 CET 2016


On Thu, Mar 10, 2016 at 04:06:05PM +0900, Tetsuya Mukawa wrote:
> 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. And 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 changes default values to -2. And the
> patch defines -2 as VIRTIO_UNINITIALIZED_EVENTFD.

This looks more like a workaround to me. Besides, this patch would make
following fail:

    eventfd_write(vq->callfd, (eventfd_t)1);

	--yliu


More information about the dev mailing list