From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from MRWPR03CU001.outbound.protection.outlook.com (mail-francesouthazon11021099.outbound.protection.outlook.com [40.107.130.99]) by lore.virtuozzo.com (Postfix) with ESMTPS id DE3B781075 for ; Sat, 31 Oct 2026 15:35:37 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=g/8ommYqGoJ0Kuiz1SqhylHlPgNYv4HdEH8null0pLHiJtPP3E3SLfpdBdCcEM9++QrNSwJAIw9D4dyZstxx1AIdYyOg6GBnAXI/fg747Dxmap8MplFLwPFhWWPl6mDT6U08YKsWOpNdHinGwX1rH0xxNQSeRmp6lusjugpzzCvM06+0sNDIOw9JVXQJkk1V+w0XdaV/AuEhx6ylnb3Lhe9V4K/mkdc6EKThd+MwHNcECAkllJ8yOccyuHlDx6SQojnKBtkHE5HYQv348HKT2LLdOSgCRhUG57VKbG1Wi74FIeAqPwPUKYgASudFjMcQ5iex35m7BlxaCeunMeMn9A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=a0YzWkTemUdHPdrPSzIBbiKisxF97iPuPWMHcyCZ4sc=; b=GKYuApc5/Xmrlv0qqdiJEYwRBwJL37oA8pbKcGkRI0Uc1rFCl1ozPz+K45XZXoNGMDNs1PTW5rcVZSo7ZMyePhaxHw4MXoON4PP0IheHjupg8/GjZfgvkSq2vMyRCNa3ctmM1L6GtgTinAZwDhKxcsUgQQ5sSl0wucOf47OCg14InV5FAq/nPm8GGBTOguenrlSCk+Xqvdkv58pAdXgifyLGWk1otML59Bu6QKWnCaYW8jkap7GTOdrE+rVYivQMelFEQsV0h/UDpDNvwowVMTPF3SIQNEPSCcZLcHjJzWy+GUljlb0mwT6BfnEt2VZgakyGYaJcOrf3pNjqTqwIQw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 130.117.225.111) smtp.rcpttodomain=virtuozzo.com smtp.mailfrom=virtuozzo.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=virtuozzo.com; dkim=pass (signature was verified) header.d=virtuozzo.com; arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=virtuozzo.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=a0YzWkTemUdHPdrPSzIBbiKisxF97iPuPWMHcyCZ4sc=; b=XRvMvgMtIlPtfMU8dYpCLAkwCd8JcETU5V9TexhjFJQVsp49J6M8+VmjPZMVF1D5QVWdrWLLvh08T2lgkkOv9D/ubeIUIOUzzue7vVXKStPhozkuU3PJ8y0wFEMuN4hr+zGqj8aTM6woVNubwqCBm9Nm8GHRwCnEMrJ0aeOTNc8F2tO+NriluVpvhzjR3HVnbKEcDFD+E/HRsrY3fAnbDPqMrxk9ff5+7y9QMD/sEahLhqpXs9JI7zGLbR+XGeUdCYWMZXZzfOLIT3ohsUd4elfNkCMKh3EM1xM3hhSukTQeVC+hkwWZts33Ng5zghWRCRpI0+ZJCmWOdoaCv4QasA== Received: from PR1P264CA0192.FRAP264.PROD.OUTLOOK.COM (2603:10a6:102:34d::17) by VI1PR08MB5309.eurprd08.prod.outlook.com (2603:10a6:803:133::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.569.11; Sat, 31 Oct 2026 15:35:34 +0000 Received: from MI3PEPF0000855C.eurprd05.prod.outlook.com (2603:10a6:102:34d:cafe::48) by PR1P264CA0192.outlook.office365.com (2603:10a6:102:34d::17) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.21.546.22 via Frontend Transport; Sat, 31 Oct 2026 15:35:34 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 130.117.225.111) smtp.mailfrom=virtuozzo.com; dkim=pass (signature was verified) header.d=virtuozzo.com;dmarc=pass action=none header.from=virtuozzo.com; Received-SPF: Pass (protection.outlook.com: domain of virtuozzo.com designates 130.117.225.111 as permitted sender) receiver=protection.outlook.com; client-ip=130.117.225.111; helo=relay.virtuozzo.com; pr=C Received: from relay.virtuozzo.com (130.117.225.111) by MI3PEPF0000855C.mail.protection.outlook.com (10.167.240.24) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.21.592.5 via Frontend Transport; Sat, 31 Oct 2026 15:35:33 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=virtuozzo.com; s=relay; h=MIME-Version:Message-ID:Date:Subject:From: Content-Type; bh=a0YzWkTemUdHPdrPSzIBbiKisxF97iPuPWMHcyCZ4sc=; b=KFvUVt/HeP8R NwKAY3Wjh7iXlZlLAqaARPnhgBVhwUMvUJlvEHNuAsshPyha1TiHRQBuzdWw8munaLdI2rytmZP7a w4277UfJrWxrdkhOY72fSuMbi4IHelNCBuV8Zt8yuTYnm/C58Nh5tomdpmqo0GnryMVg6BMaIwLaZ i9iihsynSenghYkziW7cMZigaP+aj0lXWs112Eh9yXKFIGD8MBWR/LWm+E0iwRSL+Q8/Lu8ALJomy P4r71DiukdIJsDnROxCewGdaYw26B7xAlw2K+i4VPU/QcmXklxPXLXkMcuU1yOciqERKeGGGNZap8 RbVQCR+GRXtRXZFwWBNjvA==; Received: from ch-vpn.virtuozzo.com ([130.117.225.6] helo=sky) by relay.virtuozzo.com with esmtps (TLS1.3) tls TLS_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1xNB3N-00CuDQ-2u; Sat, 31 Oct 2026 16:35:27 +0100 From: Alexander Ivanov To: andrey.zhadchenko@virtuozzo.com Cc: andrey.drobyshev@virtuozzo.com, svt-core@virtuozzo.com Subject: [PATCH hci-8.1 v5 0/5] vhost-blk: switch from VHOST_SET_NWORKERS to the mainstream worker ioctls Date: Sat, 31 Oct 2026 16:35:23 +0100 Message-ID: <20261031153528.3857823-1-alexander.ivanov@virtuozzo.com> X-Mailer: git-send-email 2.53.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: MI3PEPF0000855C:EE_|VI1PR08MB5309:EE_ X-MS-Office365-Filtering-Correlation-Id: 0e10f679-7c6a-4275-86f5-08df37649a18 X-LD-Processed: 0bc7f26d-0264-416e-a6fc-8352af79c58f,ExtAddr List-Id: svt-core@virtuozzo.com X-MS-Exchange-Transport-Rules-Loop: 1 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|376014|36860700016|82310400026|23010399003|1800799024|5113699003|10067099003|57112099003|18002099003|13003099007|261021121427099003|261021123027099003|261026121527099003|261022105027099003|261026140227099003|261009223027099003|261009221227099003|261028144727099003; X-Microsoft-Antispam-Message-Info: ECMjdBG4eg8bqN75p0+Pa3Wru9eI/aBIMz/OsCDAU3FlevTh8Aik9GJ22daxnqnIGwhvkjdg9JFayOznXcw95sve3FGXu/eyncu3nO3xEYh90lsFufV4GWn45Ye1sVPCRpajmXbzbFE4rCdXLQi8YQQb29ueZKCIwooazBIgXGsWXAWf2IHLEysZKmo2O7wBQz4FxsXJHQDutQdPOLFbJbbgkHNdpgr70WfmyQoczz6k5ieRUZ/JfCecWxUnhc4TandwH7kgVY3PShVBNQ3H4dpVwGN1y7kNvLZTt0YtmYDv30V+xwwvxwMAsBYDYR3nq16XQeU2wrBXDmXynKLdxYgnU5GxaeFdJ9R4euwMc18AZ93l6Cpht+3H9MfJgFYgcN/tuQ67J0oixF0aW0Bzp0hfX40f3RynJ1ZlFWIFAg9Sopy8FLP/Y6IgYWXXDfCfBz9pz25zR0rITrQxj4lq7S9FOwmelDm9FTl9U47yiS0urxombQwDJ1zVWln8iRbm0x8lwhe4DOvMN3AO17iYiCxJOZV1rUyQi3nNzRhKBZtSkBKDNHlvn6VwzZvZzMKBg12axMHrwAt8xIU4QkwzbsHM25b4zlwdtPXHfycspvW5uIp8RKp1VAtDUX37VvmueCq8ux1RW9FYux2QG636xLoUNNWGxJhod3AaVH1ewMkzU+AcvonUvzIeyxKcsiaCGKscK9lGGmyyr8CbXfBwBGKgfUIwMcaKaiRz4c4pgGrdRTujHzl6lBR60b6py6MOCkPMVlGCaFY6gAQBpfPTBpSSfN7S8YW62/rIywici/Ac5PCz2ipj2oQYt/se2oPgN48Iun94uFrz5xKHLkSxt6HS1Y8cpM0osmuV5vtyvhRcymWK0SWQMlmkPpqzratI X-Forefront-Antispam-Report: CIP:130.117.225.111;CTRY:CH;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:relay.virtuozzo.com;PTR:relay.virtuozzo.com;CAT:NONE;SFS:(13230040)(376014)(36860700016)(82310400026)(23010399003)(1800799024)(5113699003)(10067099003)(57112099003)(18002099003)(13003099007)(261021121427099003)(261021123027099003)(261026121527099003)(261022105027099003)(261026140227099003)(261009223027099003)(261009221227099003)(261028144727099003);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: WwZfiWWg7/1oR6krc8woAas6vqpY9gTZOIMiAnvxnG72LqyDeXF+7RtfVu8Vw3BJekJu3RegPHKl/cLBd1MRKlH7vKuZOt59Irs6cFtVnR5ZNH8xGfz7315/J38JmUFY0Qg7n4w2COGEy8UaekjG6PK4HJGvQm6HGQnV025uVmQ+gEvEs9Kys8KlZJ9GKDyGZkVJfUawzofgPgngcfg9D1pr/eRV26i4E6wAUSJmOopYUQBiUqzLgQl+e6MiKjQRnWYoOKN0rwIeX75O+ARUWvV56nZXr94s1l/44V97h4inI/TcXW2lJjoPuS1ZF1aNNBcZznrTQdlkSKKBrtLNeSt/MVERy2bb2eYE2jJWcQV9bcI98z1LgXTgkOpa0lDAU9pBwb9+tOARI/9L5N3XBzYb5dGbpe3LQTl7vAtMvFBX8Ew8lwpPsRFbUn0cNGuP X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 Oct 2026 15:35:33.1307 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 0e10f679-7c6a-4275-86f5-08df37649a18 X-MS-Exchange-CrossTenant-Id: 0bc7f26d-0264-416e-a6fc-8352af79c58f X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=0bc7f26d-0264-416e-a6fc-8352af79c58f;Ip=[130.117.225.111];Helo=[relay.virtuozzo.com] X-MS-Exchange-CrossTenant-AuthSource: MI3PEPF0000855C.eurprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR08MB5309 The kernel drops our VHOST_SET_NWORKERS ioctl in favour of the mainstream VHOST_NEW_WORKER/VHOST_ATTACH_VRING_WORKER, which vhost-blk now supports. Patch 1 wraps VHOST_SET_FORK_FROM_OWNER in a vhost backend op. Patch 2 refuses num-queues above VHOST_BLK_MAX_QUEUES at realize. Patch 3 is a cleanup taking &s->dev into a local pointer. Patch 4 makes vhost-blk create its num-threads workers with the mainstream ioctls, keeping the same worker layout, and fail to start if the kernel cannot provide them. Patch 5 drops VHOST_SET_NWORKERS from linux-headers. v5: - patch 4: fail to start vhost-blk on any worker ioctl failure instead of warning and running on fewer threads than requested - patch 4: switch to vhost_task mode for num-threads=1 as well, so the default thread is of the same kind whatever the number of workers v4: - new patch 3: split the &s->dev -> hdev conversion out of patch 4 - patch 2: quote the error realize fails with, add Fixes: - patch 4: do not key on the errno; on any worker ioctl failure warn and continue with the threads created so far instead of failing to start vhost-blk - patch 4: drop the comments, explain in the commit message instead v3: - new patch 1: call VHOST_SET_FORK_FROM_OWNER, VHOST_NEW_WORKER and VHOST_ATTACH_VRING_WORKER through vhost_ops instead of raw ioctls - new patch 2: refuse num-queues above VHOST_BLK_MAX_QUEUES at realize instead of clamping num-threads in patch 3 - patch 3: create each worker right before attaching its first vq v2: - patch 1: clamp num-threads to VHOST_BLK_MAX_QUEUES - patch 1: note in the commit message that our kernel, unlike mainline, defaults to kthreads https://virtuozzo.atlassian.net/browse/VSTOR-107537 Alexander Ivanov (5): vhost-backend: add vhost_set_fork_from_owner op vhost-blk: reject num-queues above VHOST_BLK_MAX_QUEUES vhost-blk: use a local vhost_dev pointer in start and stop vhost-blk: create kernel threads with the mainstream worker ioctls linux-headers: drop VHOST_SET_NWORKERS hw/block/vhost-blk.c | 95 ++++++++++++++++++++++++------- hw/virtio/vhost-backend.c | 7 +++ include/hw/virtio/vhost-backend.h | 3 + linux-headers/linux/vhost.h | 9 --- 4 files changed, 86 insertions(+), 28 deletions(-) -- 2.53.0