OpenVZ / Virtuozzo kernel development (devel@openvz.org)
 help / color / mirror / Atom feed
* [Devel] [PATCH hci-8.1] drivers/vhost/blk: add support for worker ioctls
@ 2026-10-29 11:05 Alexander Ivanov
  2026-10-29 11:10 ` no-reply
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Alexander Ivanov @ 2026-10-29 11:05 UTC (permalink / raw)
  To: andrey.zhadchenko; +Cc: devel

Let userspace create vhost workers and bind them to vhost-blk
virtqueues with the mainstream ioctls from c1ecd8e95007 ("vhost: allow
userspace to create workers"), the same way d74b55e65502 ("vhost_scsi:
add support for worker ioctls") does it for vhost-scsi.

VHOST_NEW_WORKER needs the device in vhost_task mode, so userspace has
to issue VHOST_SET_FORK_FROM_OWNER with VHOST_FORK_OWNER_TASK before
VHOST_SET_OWNER: our fork_from_owner_default is kthread.

https://virtuozzo.atlassian.net/browse/VSTOR-107537
Feature: vhost-blk: in-kernel accelerator for virtio-blk guests

Suggested-by: Pavel Tikhomirov <ptikhomirov@virtuozzo.com>
Signed-off-by: Alexander Ivanov <alexander.ivanov@virtuozzo.com>
---
 drivers/vhost/blk.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/drivers/vhost/blk.c b/drivers/vhost/blk.c
index b170439a1806..ab3b8c4c2d5a 100644
--- a/drivers/vhost/blk.c
+++ b/drivers/vhost/blk.c
@@ -909,6 +909,14 @@ static long vhost_blk_ioctl(struct file *f, unsigned int ioctl,
 		return vhost_blk_set_features(blk, features);
 	case VHOST_RESET_OWNER:
 		return vhost_blk_reset_owner(blk);
+	case VHOST_NEW_WORKER:
+	case VHOST_FREE_WORKER:
+	case VHOST_ATTACH_VRING_WORKER:
+	case VHOST_GET_VRING_WORKER:
+		mutex_lock(&blk->dev.mutex);
+		ret = vhost_worker_ioctl(&blk->dev, ioctl, argp);
+		mutex_unlock(&blk->dev.mutex);
+		return ret;
 	default:
 		mutex_lock(&blk->dev.mutex);
 		ret = vhost_dev_ioctl(&blk->dev, ioctl, argp);
-- 
2.53.0

_______________________________________________
Devel mailing list
Devel@openvz.org
https://lists.openvz.org/mailman/listinfo/devel

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2026-11-03 17:09 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-10-29 11:05 [Devel] [PATCH hci-8.1] drivers/vhost/blk: add support for worker ioctls Alexander Ivanov
2026-10-29 11:10 ` no-reply
2026-10-29 12:16   ` Alexander Ivanov
2026-10-29 11:15 ` Andrey Zhadchenko
2026-11-03 17:08 ` Konstantin Khorenko

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox