numam-spdk/lib/virtio
Dariusz Stojaczyk 7755bed389 virtio: split device initialization to separate functions
Previously we used to manually set
vdev->max_queues and called virtio_dev_restart
to go through all virtio init states, negotiate
features and allocate virtqueues. This is,
however, insufficient for Virtio-Blk, where we
e.g. need to check against negotiated multiqueue
flag before deciding how many queues we can use
(reading num_queues field from device config is
forbidden unless VIRTIO_BLK_F_MQ is negotiated).

This patch refactors queue-num related code
and also removes various restrictions. If device
supports less queues than requested, a warning
will be printed during initialization, but
the device will now continue to init normally.

The queue-num negotiation for virtio-user should
be eventually moved to upper layers, but that is
not necessary for now.

Change-Id: I418b56fa62c17b547243422ea077f0d76555bd13
Signed-off-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/393087
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2017-12-27 15:13:03 -05:00
..
virtio_user virtio: add new library virtio 2017-12-26 13:03:29 -05:00
Makefile virtio: add new library virtio 2017-12-26 13:03:29 -05:00
virtio_pci.c virtio: split device initialization to separate functions 2017-12-27 15:13:03 -05:00
virtio_user.c virtio: split device initialization to separate functions 2017-12-27 15:13:03 -05:00
virtio.c virtio: split device initialization to separate functions 2017-12-27 15:13:03 -05:00