Commit 48322f0c authored by Dariusz Stojaczyk's avatar Dariusz Stojaczyk Committed by Jim Harris
Browse files

virtio/user: negotiate VHOST_USER_PROTOCOL_F_CONFIG



It was introduced a while after the original GET/SET_CONFIG
implementation in QEMU, but within the same QEMU release (2.12?).
It is required by the vhost-user spec. Rte_vhost doesn't check
it, so everything worked so far, but other implementations
might (and should) reject our GET_CONFIG requests right now.

As a part of this feature, we should also check the same
flag before sending GET/SET_CONFIG messages to respect those
devices that really don't implement F_CONFIG. This is done
in a separate patch.

Change-Id: Ib7e9b11a0074f4aee70609af0cad2ef59a8bf427
Signed-off-by: default avatarDariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/417459


Tested-by: default avatarSPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
Reviewed-by: default avatarBen Walker <benjamin.walker@intel.com>
parent 0b9e4c8f
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -47,7 +47,8 @@
#include "spdk_internal/virtio.h"

#define VIRTIO_USER_SUPPORTED_PROTOCOL_FEATURES \
	((1ULL << VHOST_USER_PROTOCOL_F_MQ))
	((1ULL << VHOST_USER_PROTOCOL_F_MQ) | \
	(1ULL << VHOST_USER_PROTOCOL_F_CONFIG))

static int
virtio_user_create_queue(struct virtio_dev *vdev, uint32_t queue_sel)
+4 −0
Original line number Diff line number Diff line
@@ -47,6 +47,10 @@
#define VHOST_USER_PROTOCOL_F_MQ	0
#endif

#ifndef VHOST_USER_PROTOCOL_F_CONFIG
#define VHOST_USER_PROTOCOL_F_CONFIG	9
#endif

enum vhost_user_request {
	VHOST_USER_NONE = 0,
	VHOST_USER_GET_FEATURES = 1,