From nobody Wed Nov 27 07:47:12 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; arc=pass (i=1 dmarc=pass fromdomain=oracle.com); dmarc=pass(p=none dis=none) header.from=oracle.com ARC-Seal: i=2; a=rsa-sha256; t=1699922298; cv=pass; d=zohomail.com; s=zohoarc; b=Ry2cHhSwS1mpQUy8Cd/9MD2qHMHZ3MJarPfSgLJ+TAmpHghTARy/vu/ACXlSNLsioIsCo1PChS299Jo9C9QKB/cLEEQ02E4mtppNgn/+iNtLTTrQLgvk/F4mpm+N+TLs34MXgQs3THDs3WR5myn5Iz0ruVjzhIq+r9976Y9ndbQ= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1699922298; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=g7jhaoxx5+XFdL07NL9vjufvwtMVG3ZjGk+HdbxAgng=; b=azVBRur70KpV9t5fM98WbDdjE2m8J+6UGzwfmtPN42yb6QyaKjhmo7Rm8g3z42lu2lldsZNKpNrAVOCCDmly8y6Mp2jIAWpWBEDoqAK6csb1nmmY+Zk7z93PZ4qcT8MX522iGAjPpdGi+7fM8LAwrLbC9m1wZ6YLlAIwlbST+vE= ARC-Authentication-Results: i=2; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; arc=pass (i=1 dmarc=pass fromdomain=oracle.com); dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1699922298805433.83989364733316; Mon, 13 Nov 2023 16:38:18 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1r2hQP-0005d5-0u; Mon, 13 Nov 2023 19:37:05 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1r2hQN-0005bL-DM for qemu-devel@nongnu.org; Mon, 13 Nov 2023 19:37:03 -0500 Received: from mx0a-00069f02.pphosted.com ([205.220.165.32]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1r2hQK-0007Vs-Tj for qemu-devel@nongnu.org; Mon, 13 Nov 2023 19:37:03 -0500 Received: from pps.filterd (m0246629.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 3ADNsSdr000731; Tue, 14 Nov 2023 00:36:51 GMT Received: from iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta02.appoci.oracle.com [147.154.18.20]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3ua2n3c1qd-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 14 Nov 2023 00:36:51 +0000 Received: from pps.filterd (iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (8.17.1.19/8.17.1.19) with ESMTP id 3ADN8iQb029937; Tue, 14 Nov 2023 00:36:50 GMT Received: from nam04-bn8-obe.outbound.protection.outlook.com (mail-bn8nam04lp2040.outbound.protection.outlook.com [104.47.74.40]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3uaxqqqn7c-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 14 Nov 2023 00:36:50 +0000 Received: from CY8PR10MB7243.namprd10.prod.outlook.com (2603:10b6:930:7c::10) by SJ0PR10MB5645.namprd10.prod.outlook.com (2603:10b6:a03:3e2::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6977.31; Tue, 14 Nov 2023 00:36:48 +0000 Received: from CY8PR10MB7243.namprd10.prod.outlook.com ([fe80::449f:4fd9:2d3e]) by CY8PR10MB7243.namprd10.prod.outlook.com ([fe80::449f:4fd9:2d3e%4]) with mapi id 15.20.6977.029; Tue, 14 Nov 2023 00:36:48 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-transfer-encoding : content-type : mime-version; s=corp-2023-03-30; bh=g7jhaoxx5+XFdL07NL9vjufvwtMVG3ZjGk+HdbxAgng=; b=GsBe8r5CMdaXdZ8FcAjsg1v2PmYxTRR3veZmPxusBODHZH9a7qsEMl7TdXqWTaMLT+RW gTL20WagWp313So4XD61KEyLBnOu6qmQC9x2n+79aj9nS1Loo6sAxPx48Nh96rzaBinZ AeRbpsJqU3h22SAuMtfACz8pIkHggpUjDIpm/Qu5/9x+5lx4nXzLMA/uwDaSLaLkcx/z C1nEWz4rDibvjCT4NuShCrAaAWTu8gIV6wio6X7WAcwBmwF1mxJNjX9xx+l1mbDFA4O2 sn8yil89sb0KlDS8Qe9OgZA4BYTNVeVw2yQiDvSuyzjINWRZCrb1WKs06BJpimRH76GD PQ== ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Ja5MXq85BwboGc4M0fFxsfolxhJB3bxuLsXYq1lPkyP7htgjVncESe62JDIU+fWbE9DsaCDCsNOezdfKa6/GU4PUMliTd3qXHufiLfXLPS/08dZugIUSEjs1UcrPW2gnGe5nV1wVS3lPthBLfbAyWxPEYOqVVglv6hC1ucnOUixNC2g0W1TgBwIOjSXLZzxEg/dCHqc8DHD9AUH+3zCbBz4/i5UxWjfDh7q2UfHBqriE35FbJhNjmPS1VRoKdiwRtJCrGnI3d7pud4Vtj/ZMEiUCdtsQAZwQfHqaj9ZCvLNKla3RxdROS+UimULZamlizZnIhel4+tZG5y3qzu/BDQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=g7jhaoxx5+XFdL07NL9vjufvwtMVG3ZjGk+HdbxAgng=; b=Ii4IvbNptLPLTTjOGKPFWIPUJpI9Np0pYoluuzaVjTg6Zp9QHEBfZJxLSxINjxiP1sEU5xnks9QlzIH9JtppcXtHsq77nyhWpeI1OB+XKkhO4cWTnDv0TapD/WbKzX7orDkUYKDKdyRARYSwvzSuI/9B0oyaExbh2FSSAEFAUo4Hou3srGRA75oFJ6Q78JhiJaa3ehCUrAhpBF/HedORjSZd3VfRIri5lvcG9PQv9lyKnQt43jXklzRaBncip3FOW6x6f/goZ8HND2qNVoco5qvgyEnZFTKj/N2blIJ9Z5GuYOByjacB80cOVhpiUKplChr4YuTmfPlcq/SgdFrp0A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=g7jhaoxx5+XFdL07NL9vjufvwtMVG3ZjGk+HdbxAgng=; b=GheIDmby+Wf6nItp3eStoY++riW1CfScR1c81P6YlhcHruvBuPj4j1J2gftm3kCBaI5+ILEUlQVV4RKLyvhrFyJyfpkJaI77ofCv1nx3ITPDr6mjjm+DOJ8wjl64UF3opBwhIs37u+qXrn/WOCfuQRaxHBG9zFt4mdinnt1zAgc= From: Mike Christie To: fam@euphon.net, stefanha@redhat.com, jasowang@redhat.com, mst@redhat.com, sgarzare@redhat.com, pbonzini@redhat.com, qemu-devel@nongnu.org Cc: Mike Christie Subject: [PATCH 1/2] vhost: Add worker backend callouts Date: Mon, 13 Nov 2023 18:36:43 -0600 Message-Id: <20231114003644.7026-2-michael.christie@oracle.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231114003644.7026-1-michael.christie@oracle.com> References: <20231114003644.7026-1-michael.christie@oracle.com> Content-Transfer-Encoding: quoted-printable X-ClientProxiedBy: DS7PR05CA0008.namprd05.prod.outlook.com (2603:10b6:5:3b9::13) To CY8PR10MB7243.namprd10.prod.outlook.com (2603:10b6:930:7c::10) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CY8PR10MB7243:EE_|SJ0PR10MB5645:EE_ X-MS-Office365-Filtering-Correlation-Id: 47773d82-130f-47bd-5022-08dbe4a9c94b X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: GRja5FPB8zOgLQ64LkkEAtF7mUAXnsH1yMdPCvkF4oGBPVBAAlDc9EZq1vSnRMcCu2+ZN63eY3rDrRanZs9GMDTHjRgp8XaemizS3QIb9gEVj4a4MP78NelW++HE7Fp/vBEVUkDOt6RpLEjxyQovKEljr/m6a1YHSvZDl4hcsvL53NrQ3+54yOjuZ5wyx5EetCSpTxxaRVE0NLxl+mSmBB97StAREso7jWR4DqkbYDlThoGaS/2ktZvASd7EZOh1rCHkcKU7r/W3UbPc+dcNhFJzlIk7tn4pDxmJ8cIgr22NyIDwhJt25FsZYmlrD9KFE9RxMO/MK++7hjrlnX8+mylv/tgiTiL61cat1ASikv7kDR+hrGlEOzUFId0KdPBW8iBCcKRUMWmYrVXeZOlmkVO4q6f8+oCMuyIWBPb7Zj6FxOk7+WlCg/ZlrW/ydCYdx+ak/qHGfE2qHMRSYkC7B/GgvQ01TMCx5m+TN5ufXVbD31WLh3LDxtRQpuM8X0+fhhP8lHMfzdsc4bJ3MTpyp37x+iTMVwQxmsz61a4vYPG+hJokm1rnGM5IRFMRGP9B X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:CY8PR10MB7243.namprd10.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230031)(136003)(39860400002)(396003)(376002)(366004)(346002)(230922051799003)(64100799003)(451199024)(186009)(1800799009)(5660300002)(2906002)(26005)(38100700002)(6486002)(8676002)(4326008)(66556008)(66946007)(66476007)(316002)(1076003)(6512007)(2616005)(107886003)(8936002)(6666004)(6506007)(478600001)(41300700001)(86362001)(36756003); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?5rejU/fTaUKlIUL/7icSvD/VM8Wn959MI9MBufBNtH79g93JxT1OGXj4Xa5X?= =?us-ascii?Q?gjhOWy42kb7t4igp+vZ6FjZgjUUwjorrr/Rxu7w7bgA5GuUUSZ+8yWmY4Dvo?= =?us-ascii?Q?niR2gs9L8uR3N/nlo1W9IvlWpFErER4Z+vkH97v/aK+4sY5ME02m8PI5UB/w?= =?us-ascii?Q?LBS9tT2mi2O4QgdcRkMi71knvzNYS6STq2hav98qulLqRudp4pQAoNP5+hb8?= =?us-ascii?Q?qRqGtGDyQVTb9H3g2R4G+TfzlJZzLmlW9KBdRpQ7O9c9LkTa1JDOQygeXRp/?= =?us-ascii?Q?R/RvpZ7cw5F2ZpSI8VijnaO/GEw6KaJfRfEdh+xbriTFM7uR59SLGcwXhMIJ?= =?us-ascii?Q?JfOe244j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1J8tIJMudn7ZJUx8nrsJKyVPfSFpjr9WI34mkI2zpF9Mq6sVLJMh8Ej/MtFtvFn5BK8jcvtaa6K4LgKJxQ2W5SZjPsNaLw4uxawE+3evbMYS2GOsjwA+Uf3lhzkfU8RB/Z7rHxAOnK91MgVknwhtmL26VHwjzqTmxoI25db8Jw0sPWpGa6gW8FqyxOPaf9NaYEJl8q/dv9Q8uqKpbJkIn2Oge59AkFp0TsOsvZ248i2q/F0aSK1bbo3HprGIZ9ewMVC/imWijObnBDpjWmecD5g9SauZEx/bQw5fGm7Jd3ExHPxTMCGG7Km X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 47773d82-130f-47bd-5022-08dbe4a9c94b X-MS-Exchange-CrossTenant-AuthSource: CY8PR10MB7243.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Nov 2023 00:36:48.1854 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: taaeaoBVbovRoz6TrHjnRpRfynKj+uOJVUrTtjKCp4JaOfWe6fx13HrC8XWM7hTB7prxqdE/9e2Xg9XahQPWsZz1jX4CT5DghYa3vepxpkw= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR10MB5645 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.987,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2023-11-13_14,2023-11-09_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 mlxscore=0 adultscore=0 suspectscore=0 mlxlogscore=999 phishscore=0 malwarescore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2311060000 definitions=main-2311140001 X-Proofpoint-GUID: T74wTKrPx6GcuIW5Wz7ftjgEiGyoFPRn X-Proofpoint-ORIG-GUID: T74wTKrPx6GcuIW5Wz7ftjgEiGyoFPRn Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=205.220.165.32; envelope-from=michael.christie@oracle.com; helo=mx0a-00069f02.pphosted.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @oracle.com) X-ZM-MESSAGEID: 1699922299410100001 Content-Type: text/plain; charset="utf-8" This adds the vhost backend callouts for the worker ioctls added in the 6.4 linux kernel commit: c1ecd8e95007 ("vhost: allow userspace to create workers") Signed-off-by: Mike Christie --- hw/virtio/vhost-backend.c | 28 ++++++++++++++++++++++++++++ include/hw/virtio/vhost-backend.h | 14 ++++++++++++++ 2 files changed, 42 insertions(+) diff --git a/hw/virtio/vhost-backend.c b/hw/virtio/vhost-backend.c index 17f3fc6a0823..833804dd40f2 100644 --- a/hw/virtio/vhost-backend.c +++ b/hw/virtio/vhost-backend.c @@ -158,6 +158,30 @@ static int vhost_kernel_set_vring_busyloop_timeout(str= uct vhost_dev *dev, return vhost_kernel_call(dev, VHOST_SET_VRING_BUSYLOOP_TIMEOUT, s); } =20 +static int vhost_kernel_new_worker(struct vhost_dev *dev, + struct vhost_worker_state *worker) +{ + return vhost_kernel_call(dev, VHOST_NEW_WORKER, worker); +} + +static int vhost_kernel_free_worker(struct vhost_dev *dev, + struct vhost_worker_state *worker) +{ + return vhost_kernel_call(dev, VHOST_FREE_WORKER, worker); +} + +static int vhost_kernel_attach_vring_worker(struct vhost_dev *dev, + struct vhost_vring_worker *wor= ker) +{ + return vhost_kernel_call(dev, VHOST_ATTACH_VRING_WORKER, worker); +} + +static int vhost_kernel_get_vring_worker(struct vhost_dev *dev, + struct vhost_vring_worker *worker) +{ + return vhost_kernel_call(dev, VHOST_GET_VRING_WORKER, worker); +} + static int vhost_kernel_set_features(struct vhost_dev *dev, uint64_t features) { @@ -313,6 +337,10 @@ const VhostOps kernel_ops =3D { .vhost_set_vring_err =3D vhost_kernel_set_vring_err, .vhost_set_vring_busyloop_timeout =3D vhost_kernel_set_vring_busyloop_timeout, + .vhost_get_vring_worker =3D vhost_kernel_get_vring_worker, + .vhost_attach_vring_worker =3D vhost_kernel_attach_vring_worker, + .vhost_new_worker =3D vhost_kernel_new_worker, + .vhost_free_worker =3D vhost_kernel_free_worker, .vhost_set_features =3D vhost_kernel_set_features, .vhost_get_features =3D vhost_kernel_get_features, .vhost_set_backend_cap =3D vhost_kernel_set_backend_cap, diff --git a/include/hw/virtio/vhost-backend.h b/include/hw/virtio/vhost-ba= ckend.h index 96ccc18cd33b..9f16d0884e8f 100644 --- a/include/hw/virtio/vhost-backend.h +++ b/include/hw/virtio/vhost-backend.h @@ -33,6 +33,8 @@ struct vhost_memory; struct vhost_vring_file; struct vhost_vring_state; struct vhost_vring_addr; +struct vhost_vring_worker; +struct vhost_worker_state; struct vhost_scsi_target; struct vhost_iotlb_msg; struct vhost_virtqueue; @@ -73,6 +75,14 @@ typedef int (*vhost_set_vring_err_op)(struct vhost_dev *= dev, struct vhost_vring_file *file); typedef int (*vhost_set_vring_busyloop_timeout_op)(struct vhost_dev *dev, struct vhost_vring_stat= e *r); +typedef int (*vhost_attach_vring_worker_op)(struct vhost_dev *dev, + struct vhost_vring_worker *wor= ker); +typedef int (*vhost_get_vring_worker_op)(struct vhost_dev *dev, + struct vhost_vring_worker *worker= ); +typedef int (*vhost_new_worker_op)(struct vhost_dev *dev, + struct vhost_worker_state *worker); +typedef int (*vhost_free_worker_op)(struct vhost_dev *dev, + struct vhost_worker_state *worker); typedef int (*vhost_set_features_op)(struct vhost_dev *dev, uint64_t features); typedef int (*vhost_get_features_op)(struct vhost_dev *dev, @@ -151,6 +161,10 @@ typedef struct VhostOps { vhost_set_vring_call_op vhost_set_vring_call; vhost_set_vring_err_op vhost_set_vring_err; vhost_set_vring_busyloop_timeout_op vhost_set_vring_busyloop_timeout; + vhost_new_worker_op vhost_new_worker; + vhost_free_worker_op vhost_free_worker; + vhost_get_vring_worker_op vhost_get_vring_worker; + vhost_attach_vring_worker_op vhost_attach_vring_worker; vhost_set_features_op vhost_set_features; vhost_get_features_op vhost_get_features; vhost_set_backend_cap_op vhost_set_backend_cap; --=20 2.34.1 From nobody Wed Nov 27 07:47:12 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; arc=pass (i=1 dmarc=pass fromdomain=oracle.com); dmarc=pass(p=none dis=none) header.from=oracle.com ARC-Seal: i=2; a=rsa-sha256; t=1699922299; cv=pass; d=zohomail.com; s=zohoarc; b=hPRHTmF4/DpBgPSQlNHrnP+XuOrS51P5cUgxCSfOtn8Mdt6VwTMnJhG0UBhO2iprMZNmz2ke3XrxWUZluxlW6sKJVuFIj7qi1Gf6wdN2LwjD+hna3q4JZ4TP0YjOlB/m0oScggxun90HZ4ttfrihMPvMOWK9XfPNWiIZO1rdzZk= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1699922299; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=68cxwzCaLx7aCsBdyJEuSGtZ3YS5/lR1tMf1Gy5xa0E=; b=dr1utOhrCWu0/klN4Z6pFTEEAdttTyE/cD9o+pwsQa+kWRAGMu+LUvllbMC8LrK5vZMCtxmdC4E5czEN9fiFso/pDKtA+6nQ1eDkD+J8HwOHQGns6IDM8K9Du99uDxGDcviHXMg0g1g8bMWCOy340Hu4+L2jZTzPkHgi9Run2QI= ARC-Authentication-Results: i=2; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; arc=pass (i=1 dmarc=pass fromdomain=oracle.com); dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1699922299125846.6094330074036; Mon, 13 Nov 2023 16:38:19 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1r2hQO-0005bV-Ah; Mon, 13 Nov 2023 19:37:04 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1r2hQL-0005ZA-Tr for qemu-devel@nongnu.org; Mon, 13 Nov 2023 19:37:01 -0500 Received: from mx0a-00069f02.pphosted.com ([205.220.165.32]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1r2hQJ-0007Vu-PR for qemu-devel@nongnu.org; Mon, 13 Nov 2023 19:37:01 -0500 Received: from pps.filterd (m0246629.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 3ADNsroR001097; Tue, 14 Nov 2023 00:36:54 GMT Received: from iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta02.appoci.oracle.com [147.154.18.20]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3ua2n3c1qg-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 14 Nov 2023 00:36:53 +0000 Received: from pps.filterd (iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (8.17.1.19/8.17.1.19) with ESMTP id 3ADN3g2h029776; Tue, 14 Nov 2023 00:36:52 GMT Received: from nam10-mw2-obe.outbound.protection.outlook.com (mail-mw2nam10lp2101.outbound.protection.outlook.com [104.47.55.101]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3uaxqqqn89-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 14 Nov 2023 00:36:52 +0000 Received: from CY8PR10MB7243.namprd10.prod.outlook.com (2603:10b6:930:7c::10) by PH0PR10MB6436.namprd10.prod.outlook.com (2603:10b6:510:21c::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6977.31; Tue, 14 Nov 2023 00:36:49 +0000 Received: from CY8PR10MB7243.namprd10.prod.outlook.com ([fe80::449f:4fd9:2d3e]) by CY8PR10MB7243.namprd10.prod.outlook.com ([fe80::449f:4fd9:2d3e%4]) with mapi id 15.20.6977.029; Tue, 14 Nov 2023 00:36:49 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-transfer-encoding : content-type : mime-version; s=corp-2023-03-30; bh=68cxwzCaLx7aCsBdyJEuSGtZ3YS5/lR1tMf1Gy5xa0E=; b=CRMOXv77H0W2ko1HXrxipxUSgshibT81nwPCBzmYZw8bzxNGmT1AFqsl6tCzjFg1w0jw 0IHNHotlcUO+nwyjfubjXqgj6elKD/72NzlytyZhzLaDk5jPdUfncPFAecu5CrW3otzk ZP8yMdgculr1OH4vURFNt1yWMtniLwqz0AbjhH3ssEQOHKBbaqLmzxZaQFqHlDbHkdza LjOpQ1x9dQ7lGWrPeAHRLdHh0vtTZe3PvAjmc41K88wBDodlCRbfmgwWjFxcyROUMf9u r3X+GD3kZ1ihYg42mxtYpkwYPyhmDVB3yjC4L4tg7YGxasOKpjnXTwYjqzPZsxSqBLyf hA== ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=dNzGtj/m20GrvZEXiros5Zow0v2bBlUik/nFuaeMx1+KFi3hbbnGhW9mhznvSwux0v08OC+BTT5xSuCNoDXcilFTVtgdE0aV/gYrKPXloblYwPIBGoCtkMTbaw5y0VdPb4qkuHZxYRlur7yz9bU7htXp3/eEjQIttApxnhosB5YSwWg4BO6UGwUabHr0WPxSy3PL4tMD/Dwh03SBSWz+WLmSZL1X1+I4yAaaw51tWR8P7xPxPlVXG4BWjDazU3B7YsdMoYjcRhn93e0w1D0ixXRU/5ET/wOm36ZNQmCEFb4qhjsiKGCyJnBz7XvPnX9oPKg98h8XKnvA3dTgu3ZA5A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=68cxwzCaLx7aCsBdyJEuSGtZ3YS5/lR1tMf1Gy5xa0E=; b=BN8+SklWEywcDrFi1TY0vriuHi8VrCeG2tJ70tJZ1q05FKWHPEl2dexyZ5pN4VGWS6usOn0K51q+KxNUhQPKERT4QpWao7xOm/eo55YBatQ0Pl5ubIWMExV2CGdg3bWSFJPFW7uQA3r/k/Z2TKcaI+Ai7eX0IhQTHpl2eYaq8oMduzRJfXbMEdgspqJ1dhg/OdsR39VidbYH58BQzWBbfMhSjOzbiI3YGOlrblD62D06VCM5OMQnG1RVQvji+0snyRAe4BPTOomsH8JLsv2dsHy1Qlz35h++L35ui5TbBwhA/LIBHxJTmmHCcyFiq/VFdAYyxbQVGthR4jyAOU1+UQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=68cxwzCaLx7aCsBdyJEuSGtZ3YS5/lR1tMf1Gy5xa0E=; b=Aa8C6Gf2xDBURmp2315TJmsPiyKuP26oTcvgE1pdxumID27tmMjwtJMxHwrLvM9lvCwdxNIs0xpyTIoiNw98LdFPeHuZrs3cTi+LQ0XbtWHKikQaT96iTotp/wgULCAdbvledE0ko0PJYdTbqGZOxj9ngr6Nr/8jYTBVPeRBKqM= From: Mike Christie To: fam@euphon.net, stefanha@redhat.com, jasowang@redhat.com, mst@redhat.com, sgarzare@redhat.com, pbonzini@redhat.com, qemu-devel@nongnu.org Cc: Mike Christie Subject: [PATCH 2/2] vhost-scsi: Add support for a worker thread per virtqueue Date: Mon, 13 Nov 2023 18:36:44 -0600 Message-Id: <20231114003644.7026-3-michael.christie@oracle.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231114003644.7026-1-michael.christie@oracle.com> References: <20231114003644.7026-1-michael.christie@oracle.com> Content-Transfer-Encoding: quoted-printable X-ClientProxiedBy: DM5PR08CA0047.namprd08.prod.outlook.com (2603:10b6:4:60::36) To CY8PR10MB7243.namprd10.prod.outlook.com (2603:10b6:930:7c::10) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CY8PR10MB7243:EE_|PH0PR10MB6436:EE_ X-MS-Office365-Filtering-Correlation-Id: 5cd5b690-1d70-4944-fec4-08dbe4a9c9f6 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Jjo8cqTb6uYYLa1nlgHV6W0oj+DzAKFZ81B7FSEtZnUisgRd3nMSqBiK9L+d6Zaj5pKqbmSlzcOXwLYsS9KkYj5lBSF1JrstOfYhjJUDwceWw60o/qHNW74oxs0Duc1IWivfaSMasUepB5630M7r+EpAb9Vd6GPffMIYJFOLy6m4j3kqsYjIi8pkJFSoEwfdhcfCLq7Drw8Ccq3YQt2URifXWbqa20j0sZtiv5KgeSI7adkWrKpMsaFQ+VnkbS/PGEgCpys6SVLoAMjqc47/OHhmac9rLqzpm42vEbR0RSyJQ/SrUI/Pxqz5UHAB9QptaXobd6M/RuuNDOqv3D8Ukk8jnbp23TOIFpVzjKjZ3YKvRo19uvY8gIR4Ady+Zhg1qV/atX5kFeoMXaIHbz+/o+wOdKFUx7MG1KPEVZmgTDwUaH3hTlvdTUQC9l1wZpAalT1lzyLQcROTpK2OWYuFbcHql8S0vMaHqfBkBCW2iM9upNvTSWgpuxgMgOkisyRsoj6J1z1v9o1iJ+OXgHatx9DmXOHG60Wi6IGE1d+TJu4Ibyi9iPfYC3Ocb6f6eNMo X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:CY8PR10MB7243.namprd10.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230031)(376002)(396003)(136003)(366004)(39860400002)(346002)(230922051799003)(64100799003)(186009)(1800799009)(451199024)(26005)(66476007)(66946007)(66556008)(38100700002)(86362001)(36756003)(6512007)(107886003)(1076003)(2616005)(6506007)(6666004)(2906002)(478600001)(316002)(4326008)(6486002)(5660300002)(8936002)(8676002)(41300700001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?B7TPiQvG8LRGIVasguCWc5LM+xe7UhhRJ3xGbZdbppgFFqJ0kJOYZHc1vB+0?= =?us-ascii?Q?1GWH/U5XAzGWctHzbI7rSuTcHLWk4ndQiQjQHawrmhhdGKgkZC3QCXMRW8RZ?= =?us-ascii?Q?GwgrEsPc//A13rB5F78aqqmVVDsclmcz6+ecxsx/itqw45puJenkJivN7iBI?= =?us-ascii?Q?/5ShnwV54HYsB82GI6noHiED2seVGCMpxs0mDLlC1ZiR34H7YbS1K8VC2Iix?= =?us-ascii?Q?/SgEd/fiLTirTxtmfQRin8+nQ9PoMcAn9nIH1eGTIh9ZLO3nqC2N/p51n/49?= =?us-ascii?Q?lYc7uvkywFVy6z34rjT7AXwXKUHoSUX3G1nq4wpKzFNp3X9ebfL+0aUklaBE?= =?us-ascii?Q?xgMm5v4IJ7t9I+guWf1Z4AT0QabpT5ZM4YMrljlspQbWQBDbQK5QKFsUO80Z?= =?us-ascii?Q?b506z46+Lee/7IKbyYJA2OGesFslI5QjVDsltbwJitCfxxIq3l6log7V6oub?= =?us-ascii?Q?8qhi1F0bf5uBJmRGHhsoToo2JumckvYgyCN6e4gnHqUh2lLgFDvCotIPixIX?= =?us-ascii?Q?NG/mGS0dZo/d7/PSIdZr1YUiXMdETxJfmMPFkoP16OKqdNwX2pd5s0rlYHZZ?= =?us-ascii?Q?1cLEtFdJYNkjsx0lIGi+sUcw6kQnScTnbjaEDJ2EicBABPxP++x2jGDRdaeO?= =?us-ascii?Q?Gl8GN3BLpXlJJQuNzhccu/qlaRxd+lZB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D8HKGmf7++0emsbMXFiydYcTsyi12sYtQq9LD8Yx3UHMZz/?= =?us-ascii?Q?Pw=3D=3D?= X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: 5bdfu5KJowgTAbEKHSx54Ftrc4sTsHxIr0kR4m6s/0foLrv92XkqAhb1YOMT6DdwWKh4/yt2k/KbzrXtolCvMVvASofVycGzalqKFxDG1b5NnrfogFdAMSqDxHf34f92EWSXVLMZyGp60kJ/HClXtTLW4pRKHcI9ulLIUPB8AZbK3Wk+OjMvxYqkIYDDGSzwosrITI09Ika1e0HLcjCzCP1EC4R4n7ixVolhPmLW4BCeFtnGQv9/AHDsnUFTUcz8FnyH1+juzGblD6CluFYSHuvNjFsH5dt0TspC7Uy4jiylEppdzb6JdZ+hg03tIkbJiTop9vRo/MXw6e2dBjlIyt6tmQEo6aCBcfFLv0fh9vXrXtbzm1Gi1ewOvOSGs7U1iCs1sKl4NWfefJyhKF4AShdGUE3reoqMArqVNdNx7evmbOvX+4dM9CCUfj9tlOZOGa4OD9IrEkTc79ucf403jfY6crd3vjLl7B4ZvEdjjOs+4f6KYfSKvNATpB1S0TAWiZo8tac3m0q46swn/S6+Gd+08OeuWwciKWQv0m1IGRAoVVLS5uSA+fYppi7b+qP5D+sDrCx2IL1ZkBZ4Y4Bax6Qf/v9Q0e6mcigqrzph0k1IUX4RZNKCrXAv+kvjCi98XXAoCrOP6I71JP2yzeneSeElqflMsejz8NGQ8S7SJBz7GzcGUUCa/Z+vXWXtH5uMIVO0bt/Vq7YYytXd/WlaRxsGgiWTz8/WoH4WABg+MUK9NzRC+XxJOEOy0j87aRzgzRm5cMcOOvlkrDJCwbGMCm6VmRTr7Uqk8AIFiEnJI0gD4YAoqXB0MIUeCcbPMK15 X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 5cd5b690-1d70-4944-fec4-08dbe4a9c9f6 X-MS-Exchange-CrossTenant-AuthSource: CY8PR10MB7243.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Nov 2023 00:36:49.3032 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: ogkrSyPewLLRidXbWJ8K3lkaG/cP/7Sf16MPxbY0AocGZpUVuI8Pcpsy7p/3j8o3ay7pcHaSWkLvVnKsFkyYPE0eDpbf8YNBrRCM4jyG9YM= X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR10MB6436 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.987,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2023-11-13_14,2023-11-09_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 mlxscore=0 adultscore=0 suspectscore=0 mlxlogscore=999 phishscore=0 malwarescore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2311060000 definitions=main-2311140001 X-Proofpoint-GUID: YQU-153nSkQ-sFSPjLt_hExVSuEKPQzf X-Proofpoint-ORIG-GUID: YQU-153nSkQ-sFSPjLt_hExVSuEKPQzf Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=205.220.165.32; envelope-from=michael.christie@oracle.com; helo=mx0a-00069f02.pphosted.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @oracle.com) X-ZM-MESSAGEID: 1699922299418100002 Content-Type: text/plain; charset="utf-8" This adds support for vhost-scsi to be able to create a worker thread per virtqueue. Right now for vhost-net we get a worker thread per tx/rx virtqueue pair which scales nicely as we add more virtqueues and CPUs, but for scsi we get the single worker thread that's shared by all virtqueues. When trying to send IO to more than 2 virtqueues the single thread becomes a bottlneck. This patch adds a new setting, virtqueue_workers, which can be set to: 1: Existing behavior whre we get the single thread. -1: Create a worker per IO virtqueue. Signed-off-by: Mike Christie --- hw/scsi/vhost-scsi.c | 68 +++++++++++++++++++++++++++++++++ include/hw/virtio/virtio-scsi.h | 1 + 2 files changed, 69 insertions(+) diff --git a/hw/scsi/vhost-scsi.c b/hw/scsi/vhost-scsi.c index 3126df9e1d9d..5cf669b6563b 100644 --- a/hw/scsi/vhost-scsi.c +++ b/hw/scsi/vhost-scsi.c @@ -31,6 +31,9 @@ #include "qemu/cutils.h" #include "sysemu/sysemu.h" =20 +#define VHOST_SCSI_WORKER_PER_VQ -1 +#define VHOST_SCSI_WORKER_DEF 1 + /* Features supported by host kernel. */ static const int kernel_feature_bits[] =3D { VIRTIO_F_NOTIFY_ON_EMPTY, @@ -165,6 +168,62 @@ static const VMStateDescription vmstate_virtio_vhost_s= csi =3D { .pre_save =3D vhost_scsi_pre_save, }; =20 +static int vhost_scsi_set_workers(VHostSCSICommon *vsc, int workers_cnt) +{ + struct vhost_dev *dev =3D &vsc->dev; + struct vhost_vring_worker vq_worker; + struct vhost_worker_state worker; + int i, ret; + + /* Use default worker */ + if (workers_cnt =3D=3D VHOST_SCSI_WORKER_DEF || + dev->nvqs =3D=3D VHOST_SCSI_VQ_NUM_FIXED + 1) { + return 0; + } + + if (workers_cnt !=3D VHOST_SCSI_WORKER_PER_VQ) { + return -EINVAL; + } + + /* + * ctl/evt share the first worker since it will be rare for them + * to send cmds while IO is running. + */ + for (i =3D VHOST_SCSI_VQ_NUM_FIXED + 1; i < dev->nvqs; i++) { + memset(&worker, 0, sizeof(worker)); + + ret =3D dev->vhost_ops->vhost_new_worker(dev, &worker); + if (ret =3D=3D -ENOTTY) { + /* + * worker ioctls are not implemented so just ignore and + * and continue device setup. + */ + ret =3D 0; + break; + } else if (ret) { + break; + } + + memset(&vq_worker, 0, sizeof(vq_worker)); + vq_worker.worker_id =3D worker.worker_id; + vq_worker.index =3D i; + + ret =3D dev->vhost_ops->vhost_attach_vring_worker(dev, &vq_worker); + if (ret =3D=3D -ENOTTY) { + /* + * It's a bug for the kernel to have supported the worker crea= tion + * ioctl but not attach. + */ + dev->vhost_ops->vhost_free_worker(dev, &worker); + break; + } else if (ret) { + break; + } + } + + return ret; +} + static void vhost_scsi_realize(DeviceState *dev, Error **errp) { VirtIOSCSICommon *vs =3D VIRTIO_SCSI_COMMON(dev); @@ -232,6 +291,13 @@ static void vhost_scsi_realize(DeviceState *dev, Error= **errp) goto free_vqs; } =20 + ret =3D vhost_scsi_set_workers(vsc, vs->conf.virtqueue_workers); + if (ret < 0) { + error_setg(errp, "vhost-scsi: vhost worker setup failed: %s", + strerror(-ret)); + goto free_vqs; + } + /* At present, channel and lun both are 0 for bootable vhost-scsi disk= */ vsc->channel =3D 0; vsc->lun =3D 0; @@ -297,6 +363,8 @@ static Property vhost_scsi_properties[] =3D { VIRTIO_SCSI_F_T10_PI, false), DEFINE_PROP_BOOL("migratable", VHostSCSICommon, migratable, false), + DEFINE_PROP_INT32("virtqueue_workers", VirtIOSCSICommon, + conf.virtqueue_workers, VHOST_SCSI_WORKER_DEF), DEFINE_PROP_END_OF_LIST(), }; =20 diff --git a/include/hw/virtio/virtio-scsi.h b/include/hw/virtio/virtio-scs= i.h index 779568ab5d28..f70624ece564 100644 --- a/include/hw/virtio/virtio-scsi.h +++ b/include/hw/virtio/virtio-scsi.h @@ -51,6 +51,7 @@ typedef struct virtio_scsi_config VirtIOSCSIConfig; struct VirtIOSCSIConf { uint32_t num_queues; uint32_t virtqueue_size; + int virtqueue_workers; bool seg_max_adjust; uint32_t max_sectors; uint32_t cmd_per_lun; --=20 2.34.1