Skip to content

Commit 56e7188

Browse files
mcoquelinmstsirkin
authored andcommitted
vduse: Temporarily fail if control queue feature requested
Virtio-net driver control queue implementation is not safe when used with VDUSE. If the VDUSE application does not reply to control queue messages, it currently ends up hanging the kernel thread sending this command. Some work is on-going to make the control queue implementation robust with VDUSE. Until it is completed, let's fail features check if control-queue feature is requested. Signed-off-by: Maxime Coquelin <[email protected]> Message-Id: <[email protected]> Signed-off-by: Michael S. Tsirkin <[email protected]> Acked-by: Eugenio Pérez <[email protected]> Reviewed-by: Xie Yongji <[email protected]> Acked-by: Jason Wang <[email protected]>
1 parent a115b57 commit 56e7188

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

drivers/vdpa/vdpa_user/vduse_dev.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
*
99
*/
1010

11+
#include "linux/virtio_net.h"
1112
#include <linux/init.h>
1213
#include <linux/module.h>
1314
#include <linux/cdev.h>
@@ -28,6 +29,7 @@
2829
#include <uapi/linux/virtio_config.h>
2930
#include <uapi/linux/virtio_ids.h>
3031
#include <uapi/linux/virtio_blk.h>
32+
#include <uapi/linux/virtio_ring.h>
3133
#include <linux/mod_devicetable.h>
3234

3335
#include "iova_domain.h"
@@ -1714,6 +1716,9 @@ static bool features_is_valid(struct vduse_dev_config *config)
17141716
if ((config->device_id == VIRTIO_ID_BLOCK) &&
17151717
(config->features & BIT_ULL(VIRTIO_BLK_F_CONFIG_WCE)))
17161718
return false;
1719+
else if ((config->device_id == VIRTIO_ID_NET) &&
1720+
(config->features & BIT_ULL(VIRTIO_NET_F_CTRL_VQ)))
1721+
return false;
17171722

17181723
return true;
17191724
}

0 commit comments

Comments
 (0)