Skip to content

Commit

Permalink
virtio/user: negotiate VHOST_USER_PROTOCOL_F_CONFIG
Browse files Browse the repository at this point in the history
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: Dariusz Stojaczyk <[email protected]>
Reviewed-on: https://review.gerrithub.io/417459
Tested-by: SPDK Automated Test System <[email protected]>
Reviewed-by: Jim Harris <[email protected]>
Reviewed-by: Ben Walker <[email protected]>
  • Loading branch information
darsto authored and jimharris committed Jul 5, 2018
1 parent 0b9e4c8 commit 48322f0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/virtio/virtio_user.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 4 additions & 0 deletions lib/virtio/virtio_user/vhost.h
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 48322f0

Please sign in to comment.