virtio/user: negotiate VHOST_USER_PROTOCOL_F_MQ
Required by the vhost-user spec. Change-Id: Id7143a0f6cc34463ad5f22d8db96ac5c51e04081 Signed-off-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com> Reviewed-on: https://review.gerrithub.io/417457 Tested-by: SPDK Automated Test System <sys_sgsw@intel.com> Reviewed-by: Jim Harris <james.r.harris@intel.com> Reviewed-by: Ben Walker <benjamin.walker@intel.com> Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
This commit is contained in:
parent
5910855c68
commit
0b9e4c8ff7
@ -47,7 +47,7 @@
|
||||
#include "spdk_internal/virtio.h"
|
||||
|
||||
#define VIRTIO_USER_SUPPORTED_PROTOCOL_FEATURES \
|
||||
(0)
|
||||
((1ULL << VHOST_USER_PROTOCOL_F_MQ))
|
||||
|
||||
static int
|
||||
virtio_user_create_queue(struct virtio_dev *vdev, uint32_t queue_sel)
|
||||
@ -145,6 +145,15 @@ virtio_user_start_device(struct virtio_dev *vdev)
|
||||
uint64_t host_max_queues;
|
||||
int ret;
|
||||
|
||||
if ((dev->protocol_features & (1ULL << VHOST_USER_PROTOCOL_F_MQ)) == 0 &&
|
||||
vdev->max_queues > 1 + vdev->fixed_queues_num) {
|
||||
SPDK_WARNLOG("%s: requested %"PRIu16" request queues, but the "
|
||||
"host doesn't support VHOST_USER_PROTOCOL_F_MQ. "
|
||||
"Only one request queue will be used.\n",
|
||||
vdev->name, vdev->max_queues - vdev->fixed_queues_num);
|
||||
vdev->max_queues = 1 + vdev->fixed_queues_num;
|
||||
}
|
||||
|
||||
/* negotiate the number of I/O queues. */
|
||||
ret = dev->ops->send_request(dev, VHOST_USER_GET_QUEUE_NUM, &host_max_queues);
|
||||
if (ret < 0) {
|
||||
|
@ -43,6 +43,10 @@
|
||||
|
||||
#define VHOST_USER_MAX_CONFIG_SIZE 256
|
||||
|
||||
#ifndef VHOST_USER_PROTOCOL_F_MQ
|
||||
#define VHOST_USER_PROTOCOL_F_MQ 0
|
||||
#endif
|
||||
|
||||
enum vhost_user_request {
|
||||
VHOST_USER_NONE = 0,
|
||||
VHOST_USER_GET_FEATURES = 1,
|
||||
|
Loading…
x
Reference in New Issue
Block a user