From patchwork Tue Dec 7 02:51:06 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Christie X-Patchwork-Id: 521855 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id C0B3DC43217 for ; Tue, 7 Dec 2021 02:51:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231765AbhLGCzG (ORCPT ); Mon, 6 Dec 2021 21:55:06 -0500 Received: from mx0b-00069f02.pphosted.com ([205.220.177.32]:44836 "EHLO mx0b-00069f02.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229838AbhLGCzB (ORCPT ); Mon, 6 Dec 2021 21:55:01 -0500 Received: from pps.filterd (m0246630.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.16.1.2/8.16.1.2) with SMTP id 1B6M5HmN012536; Tue, 7 Dec 2021 02:51:29 GMT 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-2021-07-09; bh=JGPKg5pR9JfEbo2Vntm8ShT4Bu7HYXnrVufWNfM16FQ=; b=Hlxki2aXLB9Fha7e3KM8dueLE5RzPkLQmg9lgfg8dGI1E40l+a4Af+/N/YVwTj9A4ADV G/qfalP/rdoqMNv3yvVT5tIvax/21o+nei1o0o2cQ+M8l30buDzZaq2cmgJ70EK8SsHJ UFZsen6s/upEEqclcSWpdTjYOg2kqi/uyzPmnnjBFUAF3gxduR7MrgodfokxPR8EoQXI +O0B0bZi6bGCJ21BmD0FT5pQVG51voIW1znr1SUm7ryJ0s28t9Fw8227ufEh02Be5eyA j+KF00Uegp1EhxNBNvmleRGM2auxYCMYzHo2tDb0lwmGdPC6WyiiYmEbQujHMWNsuc3J nQ== Received: from userp3020.oracle.com (userp3020.oracle.com [156.151.31.79]) by mx0b-00069f02.pphosted.com with ESMTP id 3csc72c354-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 07 Dec 2021 02:51:28 +0000 Received: from pps.filterd (userp3020.oracle.com [127.0.0.1]) by userp3020.oracle.com (8.16.1.2/8.16.1.2) with SMTP id 1B72kglW153019; Tue, 7 Dec 2021 02:51:27 GMT Received: from nam12-dm6-obe.outbound.protection.outlook.com (mail-dm6nam12lp2173.outbound.protection.outlook.com [104.47.59.173]) by userp3020.oracle.com with ESMTP id 3cr1sn5w2j-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 07 Dec 2021 02:51:27 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=iswVlnbeV87E4HdLfchAiU4m1jSHmDx2ZCCF9FRRI37ht9oDOoAKOJO3yC8LHI8pndMpYZmWrfTZUXiqRSlNy54GFmdLgqDiUd7f7uSwinEWmIxzdjBdgEsO2mjWAGS9SfndnF0Nj4epZZaEY2z5GsNCA0rBMq9Ph/IPe7JGYn/O+I/6CdRsPqHYcsdEsCy+IrG04L87VRVt189iqZKB9cTFU7V28INzqbVWvzZ5JGdWac4Q3HbAaLLCFbt6P5EYIGeNvZN0JJOSZTyiSmb03uJqkCDhcXAELI087/vbJL4+N/Fi5WEgmuDqBfNSXyXR5XJDGR16P+YxttAYGRDIVg== 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=JGPKg5pR9JfEbo2Vntm8ShT4Bu7HYXnrVufWNfM16FQ=; b=DXJk8GXZx92Tgtl7bgtNeE38r9QMsZUj+Qy1jexsbwgEMNzEGYSHDb0xe8hg5tdZufCKKxcN+klS5VaQ4cntcOrtCxU0NwyH0bi8gN1l8VMxV8rvGztLRYDwbT7Dhve5rZw0brLs7o9HnIsyFi9dGAW62ldejpYSo8cGqnBXNMrleLW6Ne8yptRY59R+VM/DLLWBc3YnJ+qJg9yY9VvOrWVF/lLXzbbEwyOdbLPTz5dUuKOMlQERrsb37INYHBIv1YQM5CCiO4LCb4ObZhfvzW74+P2qohZQqcizQBfw1nrMpn/46LSskCJZBHfUu6kV0No63sLkc0LIJEkgB4YdpQ== 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=JGPKg5pR9JfEbo2Vntm8ShT4Bu7HYXnrVufWNfM16FQ=; b=nqCqS5WsUUc7Ys3l/KJ+e/5+BJTiS8apoYHlnssWKeYjh4vUobWPExabRu3zmT8O6lUk2xHWpYUjTncReIUKM72inVufw1+Tx8Lokbml8TIKuNcnA3HoTESEOty8fMRjIFyyEYui8Vhm2tyBqXyFk4udZzgH2gMVgRVvSTYqBIA= Received: from DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) by DM6PR10MB4347.namprd10.prod.outlook.com (2603:10b6:5:211::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4755.21; Tue, 7 Dec 2021 02:51:26 +0000 Received: from DM5PR10MB1466.namprd10.prod.outlook.com ([fe80::601a:d0f6:b9db:f041]) by DM5PR10MB1466.namprd10.prod.outlook.com ([fe80::601a:d0f6:b9db:f041%11]) with mapi id 15.20.4755.022; Tue, 7 Dec 2021 02:51:25 +0000 From: Mike Christie To: target-devel@vger.kernel.org, linux-scsi@vger.kernel.org, stefanha@redhat.com, jasowang@redhat.com, mst@redhat.com, sgarzare@redhat.com, virtualization@lists.linux-foundation.org Cc: Mike Christie Subject: [PATCH V5 01/12] vhost: add vhost_worker pointer to vhost_virtqueue Date: Mon, 6 Dec 2021 20:51:06 -0600 Message-Id: <20211207025117.23551-2-michael.christie@oracle.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20211207025117.23551-1-michael.christie@oracle.com> References: <20211207025117.23551-1-michael.christie@oracle.com> X-ClientProxiedBy: DS7P222CA0021.NAMP222.PROD.OUTLOOK.COM (2603:10b6:8:2e::20) To DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) MIME-Version: 1.0 Received: from localhost.localdomain (73.88.28.6) by DS7P222CA0021.NAMP222.PROD.OUTLOOK.COM (2603:10b6:8:2e::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4755.14 via Frontend Transport; Tue, 7 Dec 2021 02:51:25 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: ec105093-91f9-4111-51e2-08d9b92c75ec X-MS-TrafficTypeDiagnostic: DM6PR10MB4347:EE_ X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:2449; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: +eLMtsR4jlP3KJxT6hH6qK44zkjyyoz9rGUP8MaBhsGOLyNksDFz7835u/rB6ckar4WgHzgjD8/Ls5U10Tfrg2Ns8mhDkN2Xn/+8uqSGc7VzVt9a3CBNReQLhynHWs0wehOJiW/inY2raZe82wKnWbR9Etku7JeBO0X44DzLuPXt9SRWGqi+rDXvW5g3WJqhX6BpAmKVAtSX+lnK5+go1bsVFWo6oKQeq3T0Ay6ILkDtTfC5MUoEYEfL+UeOlB11eanqip0RNfsQWDGMjr8PnZlLuHbpwR0YpndQTUKZI21tvLFlduMOq7WvZbCVGFb8D5gUpX6kz9XDF1+0S7wiP5PFlZmKXrXjpKf8liuFRnIK+yNBEfJWznTvCAhi0bh13XujF5VqLd5rZrWyzTFnyXFammbqUP3cGxQ4DzQk5N8R4tQU2+jDjoaeRBJweT40OIrpMbvStEXETZ/n3/CUzvmkzsefXDzWa+hPQE2FnfejOIEUx8AG0A6LZV2ZuWCYom/794gJT6OiRwaedwnxT2hXkHvJ+GMgmU/QhjKC4m4Qplk99NoBsgTyHn/ki7apn4GiXs85wfxzzvScp/cN70q63friUNPyuTb1YXCNmiTncS+NWhgbTgMHynWcbaPweq5OgDC4G5vD8Z43MjNSOFGtcQHecllFsDEZAfZQ6COvBZAQwgL25i3DiU+At0Mlfm1CFniOCBKKUKdIDBoQ+A== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM5PR10MB1466.namprd10.prod.outlook.com; PTR:; CAT:NONE; SFS:(366004)(52116002)(6486002)(956004)(107886003)(83380400001)(4326008)(5660300002)(1076003)(2616005)(508600001)(2906002)(6512007)(86362001)(66946007)(8936002)(6506007)(316002)(36756003)(8676002)(26005)(186003)(66476007)(66556008)(6666004)(38350700002)(38100700002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: Mo73JLi7lKwodgHCMMFjw67t/mjSIugC/Wpc3U0UpREiysK88VAUFtgYPupX/+oiEZ1DrNAxiXRkXM3IRTdEFzLBPxYeeUmmzwFnF2gQrVpGtNlCFN1p7SKiL29AQql2JSgZNTAdZWCuxkwlUDz8buw1sU1lmDDLm5NSXf+TEfm0Q4th2UawG6b8ioFG0tsi2rB/86+0JZ35ill6WmhiOJpQsxaUYBsdbFbmf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2AKdwp9PGpgKfz/4v2BuBGqDB0Xlkbgkpfy086VQfAriIVjVLJWpi4tNC+vZFIiAIPA9iuu+QNyFnQt26tCXATgTKi/jdiF8iMtXQrJv/9EXH2E72/zVt/MTJOzfDf6K+SOAH2GykWeFxDUupPR/Qg7jQoXBz6J2uU0XVk496tITBn8aPUkstzz/Pv2UArRH9teUr3nh58siBqS0FRe/FIsL8zjf65OxQWkf+k6Y7K5Y/QaBMeu4JxhrJowAXMGvMY4bxQSxYbKHjh/dnZrJYVAPsOvmq+91fPS9jXcpJwE72g6vVhrtpYtWBuxcjeqIdq7eo7IRHm0O1FTv1Sl7LcGxtb2h6yT5RVLDagYJ9aJTgZSg== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: ec105093-91f9-4111-51e2-08d9b92c75ec X-MS-Exchange-CrossTenant-AuthSource: DM5PR10MB1466.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Dec 2021 02:51:25.9126 (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: sUANM54RfDT47YhRppwo2TqAOFn1SRrCL4yk4wNJcDYuMhlxa1i9Bvfv/N1HT3iYb6eUDlCjKv7/i+nz5RHeleHLy5a7wb4MUJHguJGNfag= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR10MB4347 X-Proofpoint-Virus-Version: vendor=nai engine=6300 definitions=10190 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxlogscore=999 mlxscore=0 spamscore=0 phishscore=0 bulkscore=0 suspectscore=0 malwarescore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2110150000 definitions=main-2112070016 X-Proofpoint-ORIG-GUID: uk7zEP5tgM5C29OZuVq-uOWDQaPALIXx X-Proofpoint-GUID: uk7zEP5tgM5C29OZuVq-uOWDQaPALIXx Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org This patchset allows userspace to map vqs to different workers. This patch adds a worker pointer to the vq so we can store that info. Signed-off-by: Mike Christie --- drivers/vhost/vhost.c | 24 +++++++++++++----------- drivers/vhost/vhost.h | 1 + 2 files changed, 14 insertions(+), 11 deletions(-) diff --git a/drivers/vhost/vhost.c b/drivers/vhost/vhost.c index 17e5956e7424..a314f050413a 100644 --- a/drivers/vhost/vhost.c +++ b/drivers/vhost/vhost.c @@ -488,6 +488,7 @@ void vhost_dev_init(struct vhost_dev *dev, vq->log = NULL; vq->indirect = NULL; vq->heads = NULL; + vq->worker = NULL; vq->dev = dev; mutex_init(&vq->mutex); vhost_vq_reset(dev, vq); @@ -566,15 +567,14 @@ static void vhost_worker_free(struct vhost_dev *dev) kfree(worker); } -static int vhost_worker_create(struct vhost_dev *dev) +static struct vhost_worker *vhost_worker_create(struct vhost_dev *dev) { struct vhost_worker *worker; struct task_struct *task; - int ret; worker = kzalloc(sizeof(*worker), GFP_KERNEL_ACCOUNT); if (!worker) - return -ENOMEM; + return NULL; dev->worker = worker; worker->kcov_handle = kcov_common_handle(); @@ -586,25 +586,24 @@ static int vhost_worker_create(struct vhost_dev *dev) */ task = user_worker_create(vhost_worker, worker, NUMA_NO_NODE, CLONE_FS, USER_WORKER_NO_FILES | USER_WORKER_SIG_IGN); - if (IS_ERR(task)) { - ret = PTR_ERR(task); + if (IS_ERR(task)) goto free_worker; - } worker->task = task; user_worker_start(task, "vhost-%d", current->pid); - return 0; + return worker; free_worker: kfree(worker); dev->worker = NULL; - return ret; + return NULL; } /* Caller should have device mutex */ long vhost_dev_set_owner(struct vhost_dev *dev) { - int err; + struct vhost_worker *worker; + int err, i; /* Is there an owner already? */ if (vhost_dev_has_owner(dev)) { @@ -615,9 +614,12 @@ long vhost_dev_set_owner(struct vhost_dev *dev) vhost_attach_mm(dev); if (dev->use_worker) { - err = vhost_worker_create(dev); - if (err) + worker = vhost_worker_create(dev); + if (!worker) goto err_worker; + + for (i = 0; i < dev->nvqs; i++) + dev->vqs[i]->worker = worker; } err = vhost_dev_alloc_iovecs(dev); diff --git a/drivers/vhost/vhost.h b/drivers/vhost/vhost.h index 67b23e178812..31d074724fe8 100644 --- a/drivers/vhost/vhost.h +++ b/drivers/vhost/vhost.h @@ -79,6 +79,7 @@ struct vhost_vring_call { /* The virtqueue structure describes a queue attached to a device. */ struct vhost_virtqueue { struct vhost_dev *dev; + struct vhost_worker *worker; /* The actual ring of buffers. */ struct mutex mutex; From patchwork Tue Dec 7 02:51:10 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Christie X-Patchwork-Id: 521854 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3579CC43217 for ; Tue, 7 Dec 2021 02:51:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231866AbhLGCzI (ORCPT ); Mon, 6 Dec 2021 21:55:08 -0500 Received: from mx0b-00069f02.pphosted.com ([205.220.177.32]:47342 "EHLO mx0b-00069f02.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230427AbhLGCzD (ORCPT ); Mon, 6 Dec 2021 21:55:03 -0500 Received: from pps.filterd (m0246631.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.16.1.2/8.16.1.2) with SMTP id 1B6M56v4019273; Tue, 7 Dec 2021 02:51:31 GMT 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-2021-07-09; bh=TvoMJoiphXhAX84Y0IH80GMqhjqUhR7mOvEu4dNx8K0=; b=VEX943fT/ZBaFSKA/hJ449awj4z9ftmIUh4MSQxJ03F0eALoj/cIcb7yrI727pybXP9q OUng/F3m57TbYzWS6A85OUluHLWxYg/+Muh775s7jsvVBrs7KBfyE6/swOqRiHQCkFE+ 2BlLMPStpBRbdc9Neo9SJrAygJH1WDLdubGweyBv8+nyvpG7tYyF3DUZnNZ2TgwuKw9s 4y0FH779oLdtnhmCd8PSE5xyZ+/5PCNARGppElqy0jVWQRBxi/dN1LwHh8y4jwb0OA0e 3GV4D++ZEvxusnUeG4SW7gqOEYnXYcpyf9zX8NwNd3fTVM8Bj+92wPdHwux9oT1uC8tc kw== Received: from userp3020.oracle.com (userp3020.oracle.com [156.151.31.79]) by mx0b-00069f02.pphosted.com with ESMTP id 3csbbqmefa-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 07 Dec 2021 02:51:31 +0000 Received: from pps.filterd (userp3020.oracle.com [127.0.0.1]) by userp3020.oracle.com (8.16.1.2/8.16.1.2) with SMTP id 1B72kgla153019; Tue, 7 Dec 2021 02:51:30 GMT Received: from nam12-dm6-obe.outbound.protection.outlook.com (mail-dm6nam12lp2173.outbound.protection.outlook.com [104.47.59.173]) by userp3020.oracle.com with ESMTP id 3cr1sn5w2j-6 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 07 Dec 2021 02:51:29 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=UVZnUvUfe9na/hfr6nOxO96vR60Nh9iWkD8tJaqbJA5XmBgg0z04o1XMX48RaFCCbnCYrh66+eBNpqbXHur32737RvdxtDPEhGybF5f4kyTTLuslRj4u4b5C3HLZIeYXZy8YUfEkxvqOdxK3W7DqZyALAX1zB9zcYUlTSt4ok/en5rKdkiiLY/93r5amUHnJnzsAQ7DFwznzpfdRowvL9EluSxcBmJlpc8FETNkhmKBsQN4DiSKPWi02YeihClIfUaXDw9HD4ZyjzemP9UEVQSM9xUm4Pld1BEXG4eQt1N5jcUUvM+jjec545cWxifdVt3GzUc21MycZt9IOnVEw2Q== 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=TvoMJoiphXhAX84Y0IH80GMqhjqUhR7mOvEu4dNx8K0=; b=nCK3rUkllVIoc4V7xu0NiczLDENEiOV+e78QpfLkjerq3lq/Q10axU4bADvGsTmb0b/PmYUxAMb/rk5T/8nXP7PLRH2DaOIBtC7DDkrKOmGsVpX7N626vUijXT6wFycsPlJsR3iY+To7njNokcWpDLlVp+W1Fl4SVsnB/mmQQxgSkdeMD0oQ413SuFeiWQ3Bm8JUYchI1PYxY3Yi0hZIqay/Zj/zzVR859xFFojwkBDf82BMADgF8Bh0QR8Twb64CwyB8LKRCAfjBiOSgJlwjck34WsH9+YDiZ1A8Bg8lnnTACuEdqzg3k7k6mBMygEEB5a5XAOPTgZvifLdbEwQjw== 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=TvoMJoiphXhAX84Y0IH80GMqhjqUhR7mOvEu4dNx8K0=; b=kaZGlAEV5iAl/JLp8PFI0jrlMCKi98D94sdRaSkT4cHAD0EsLNdlwlxKc06Q0gu+480fPV0C4J0Hdp3dcrX0Qj+ZDmbzY6BU16EG/GAKgmzb1qIqQqGUKhgxKlqFJx1rpifs9e3U4x9jJvQkxoBa3qdhP6E0CHHQLO3zS5jicCw= Received: from DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) by DM6PR10MB4347.namprd10.prod.outlook.com (2603:10b6:5:211::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4755.21; Tue, 7 Dec 2021 02:51:28 +0000 Received: from DM5PR10MB1466.namprd10.prod.outlook.com ([fe80::601a:d0f6:b9db:f041]) by DM5PR10MB1466.namprd10.prod.outlook.com ([fe80::601a:d0f6:b9db:f041%11]) with mapi id 15.20.4755.022; Tue, 7 Dec 2021 02:51:27 +0000 From: Mike Christie To: target-devel@vger.kernel.org, linux-scsi@vger.kernel.org, stefanha@redhat.com, jasowang@redhat.com, mst@redhat.com, sgarzare@redhat.com, virtualization@lists.linux-foundation.org Cc: Mike Christie Subject: [PATCH V5 05/12] vhost: convert poll work to be vq based Date: Mon, 6 Dec 2021 20:51:10 -0600 Message-Id: <20211207025117.23551-6-michael.christie@oracle.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20211207025117.23551-1-michael.christie@oracle.com> References: <20211207025117.23551-1-michael.christie@oracle.com> X-ClientProxiedBy: DS7P222CA0021.NAMP222.PROD.OUTLOOK.COM (2603:10b6:8:2e::20) To DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) MIME-Version: 1.0 Received: from localhost.localdomain (73.88.28.6) by DS7P222CA0021.NAMP222.PROD.OUTLOOK.COM (2603:10b6:8:2e::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4755.14 via Frontend Transport; Tue, 7 Dec 2021 02:51:27 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: f241fe70-d75e-4f15-3e7a-08d9b92c76fe X-MS-TrafficTypeDiagnostic: DM6PR10MB4347:EE_ X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:3968; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: pDRyKnV4+cSBlCB5h4no5Zqy4n0TVZeooGOriiiLXCL0zkVv49Lr1DFMfKa1ZEwMSyEq+RKyY4bGMbvHjDxO4qQ5am9zqd/m0NXqnEUjgoYYoYPGQsp1RkhjvfozuHE1UJ7YD2Wemwspaua/ppYVipQE69CuLpRC9mBZGv4WWc33h58uNjnlkYljv2rxJlmw+V2xEWhg/tZhWZGmWv2t1SFE4aP/NpPx0VADSbKDTwUo4tUiGGbOLTkk3CvvlORGL7OdC4aWdJXUiVg7zMXqDQ5K0wpMSH9WBXaMlw3/zPyo9Pu5d5Pt8stqiia0Mrylh3id3eZ6X+e68Ssed09g9srPC/WHEdwYL0xEZQT6w5U1OUgr/ugX/NHZsJIaqN2PAuwrCi3isnqWIBEr4O7qbfJucfbRpjWZ7+q5ErU1LpMuFwRSa7mfk/ASRjjDTlj8WrR7O6rrO+ZApZhRrDJIjixk67t7IxUsnyIqteijJZmBvdNpwlT3veE0524TBE5s4HP8I1TuEQrRf8j0qy13DhQDMKhEmDJfTaNEUmsukTz5IhBkGQTsahg08pE4ilygTWQonLwoJPTnjmsUiIJU6LUL03D3YX75/7TgntEB2mMxPs8GS3hUEixqfiKIhDoT1OTmEBsbeOVAGSWvphW+AJ+PsvAUcwxtQwtBpC0xav2nSxbW3CN/4dnce0/E+ElZRuO78moLQrS1+SNp6Z7vsQ== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM5PR10MB1466.namprd10.prod.outlook.com; PTR:; CAT:NONE; SFS:(366004)(52116002)(6486002)(956004)(107886003)(83380400001)(4326008)(5660300002)(1076003)(2616005)(508600001)(2906002)(6512007)(86362001)(66946007)(8936002)(6506007)(316002)(36756003)(8676002)(26005)(186003)(66476007)(66556008)(6666004)(38350700002)(38100700002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: FA0QWYRZNT2+kowBHx/PuCwrnAidII7dGMpmUOCL8qMFB07jsPwL77RCoGybOMBAV2yM2bBnRzXSPV+mtSYDm2zjzqitQ6B2ryh9bLDOK16FS/58LDmsLzF4UDI2LW0KvQN5SGdWnJVCEylDcmn/bRQ3mVATRyJ4ltanegBABkBCrRi/NWt7zcRraS6mC4FF6zmHtfoJBQSTKMN4SOH42w4COgELnspb9fOqRSgbHFQMVhZ94QS0DYQiPKHCoaQP8jfItfHO70nIZJsl72ZXpP21ykItSiihSmAfYCjVYKtmy5iFeLVaQDi75Q1vhTyeDvxhcwU6Y45gUQ66ItZ6xiGNqcE3vloPgh4ht98+CfjqrF2YHnvhJFHAWIaJLlEh5pTkQMIJICWEhIwTFCMaFVyFiey70X9m11Tx0PXYYgwBQmRgRnTOEx6t2jkxk2Bm3+V72IK0SHgoZHwukMsxzDlf2hg1AEPkKBIKm55hN4qGLPnf5QVeATOYaHI4psGdiRuyxupdOFguXnxbpPQf3x00kowfUGE2uv89XF7G36+yDDJ0KmCaJBxAiyRSkYcjYaTmAM1sFMpQhZSgiANJHc790e6CKJOWa060nZpJFF4WxGWG0RheFoNADeRB/wMDzgcSZjoGQvrbYkDADCs79lXTRYAqXx66Z9TZ/0DdEuPpL6MABadR/jGJwOlMFkVDKN6nGIL2VawMNTDD7nfoW4W5h1+DI3q1cr5JY0RRJ35pQn02my2v5V+X5n61ZHMy2V3NjYoK673cSSNV8S9qFtKBYgXQ+cW9CudSuBk5Zr78nwJLzENM8jDzbYLDZYDkxOXmzGFHAIAC1N7y/WMoLhPN+hMkrrfSzsqDZbsgmD1zjLeiqNiJ9kdmr2Cep6dGUd7CIdHQ1Z3ytdZdh/2+VWXrNnu8eYLnG+9L+k9B8sLo6RAgmOPTzCl6I4sYVTou0kg95OjZ+KFcIrC66P8U114nWA3MOuc2s6OZdaGW8X/H0PL3Xw6B19Kw4/PdZiIInwtcu3JqU69uijRmNIJ3k3XRBzp4yH+Yeqq2MkFYpPpK3zpS+/53ECPTAJTX4u5WTBao8oC5WBmmd75AL59ZVMgXxsMLeWGHxP47JzztlSrwR841NBWcaJKMk4zpR3e1wZSRQ5B7oP9zS5cJYI88I4PFrgtdMQFU6VmhBnqYET1pDOY46yXHHxe7yz5elMjY2M3ZgGlOuXZ9CW98e6sEGkT5eCNkcfHqZ1VLJ8jxkEgEQZDnJaFAfiRI17O7zjPgMi9e3xA+ehYjdRtrYPEp6lREuicLU62FgFpx2HVDifDarpcWmTC5kHgbEG1DdjPn33Mhhud5kE5MmDSls/wZAhTc0ZK8LexssHqsyXQMytS+sp5U/5aXWbwcMrK/5qFk2E1VY/7KAUivkqoRLe6FOoNFlFhyok5hIBzCFZGG8aJG0YJOpMJK8tRwBJBTsiSXLnd5zXph9oKKHjTqCmPYB7g8qMQ2MImxWFOZzizXtTq9WkbCt8zbDc8x1W5SIOmDR0vUEif2HsZ4cWmBbdhP71wpFSVVWNQT6iMj5tYAL7MLIb4BUu2QhAJxjsZCOIo3Cl+MIIopU+AUJh0u64l5HIY6tRAkfViQ43DzLbnmx6QnmKSFzxkoA9UITfdkSFBnpxP8+GDAtr8KL2cFHDAaOQ== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: f241fe70-d75e-4f15-3e7a-08d9b92c76fe X-MS-Exchange-CrossTenant-AuthSource: DM5PR10MB1466.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Dec 2021 02:51:27.7938 (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: T+iaXx/BHCxJyjAVcMPyjjLoNVqer88mdsoE4EIdmIshA+u/pT7XF5Fw2a4SePJng1kHJ7tEWxicUHj1AuQ3ZcYoPjnSExJ1iXChxeqCWLA= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR10MB4347 X-Proofpoint-Virus-Version: vendor=nai engine=6300 definitions=10190 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxlogscore=999 mlxscore=0 spamscore=0 phishscore=0 bulkscore=0 suspectscore=0 malwarescore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2110150000 definitions=main-2112070016 X-Proofpoint-GUID: MFfM8a35uiWFJpnPmCoYPR7KTUQjrDbk X-Proofpoint-ORIG-GUID: MFfM8a35uiWFJpnPmCoYPR7KTUQjrDbk Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org This has the drivers pass in their poll to vq mapping and then converts the core poll code to use the vq based helpers. Signed-off-by: Mike Christie --- drivers/vhost/net.c | 6 ++++-- drivers/vhost/vhost.c | 8 +++++--- drivers/vhost/vhost.h | 4 +++- 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/drivers/vhost/net.c b/drivers/vhost/net.c index f225cb9dcb10..6e2b1670ae51 100644 --- a/drivers/vhost/net.c +++ b/drivers/vhost/net.c @@ -1339,8 +1339,10 @@ static int vhost_net_open(struct inode *inode, struct file *f) VHOST_NET_PKT_WEIGHT, VHOST_NET_WEIGHT, true, NULL); - vhost_poll_init(n->poll + VHOST_NET_VQ_TX, handle_tx_net, EPOLLOUT, dev); - vhost_poll_init(n->poll + VHOST_NET_VQ_RX, handle_rx_net, EPOLLIN, dev); + vhost_poll_init(n->poll + VHOST_NET_VQ_TX, handle_tx_net, EPOLLOUT, dev, + vqs[VHOST_NET_VQ_TX]); + vhost_poll_init(n->poll + VHOST_NET_VQ_RX, handle_rx_net, EPOLLIN, dev, + vqs[VHOST_NET_VQ_RX]); f->private_data = n; n->page_frag.page = NULL; diff --git a/drivers/vhost/vhost.c b/drivers/vhost/vhost.c index e5f5acc7e648..e9f78f0d72cb 100644 --- a/drivers/vhost/vhost.c +++ b/drivers/vhost/vhost.c @@ -186,13 +186,15 @@ EXPORT_SYMBOL_GPL(vhost_work_init); /* Init poll structure */ void vhost_poll_init(struct vhost_poll *poll, vhost_work_fn_t fn, - __poll_t mask, struct vhost_dev *dev) + __poll_t mask, struct vhost_dev *dev, + struct vhost_virtqueue *vq) { init_waitqueue_func_entry(&poll->wait, vhost_poll_wakeup); init_poll_funcptr(&poll->table, vhost_poll_func); poll->mask = mask; poll->dev = dev; poll->wqh = NULL; + poll->vq = vq; vhost_work_init(&poll->work, fn); } @@ -287,7 +289,7 @@ EXPORT_SYMBOL_GPL(vhost_vq_has_work); void vhost_poll_queue(struct vhost_poll *poll) { - vhost_work_queue(poll->dev, &poll->work); + vhost_vq_work_queue(poll->vq, &poll->work); } EXPORT_SYMBOL_GPL(vhost_poll_queue); @@ -512,7 +514,7 @@ void vhost_dev_init(struct vhost_dev *dev, vhost_vq_reset(dev, vq); if (vq->handle_kick) vhost_poll_init(&vq->poll, vq->handle_kick, - EPOLLIN, dev); + EPOLLIN, dev, vq); } } EXPORT_SYMBOL_GPL(vhost_dev_init); diff --git a/drivers/vhost/vhost.h b/drivers/vhost/vhost.h index f5251cf902ce..58032429bd05 100644 --- a/drivers/vhost/vhost.h +++ b/drivers/vhost/vhost.h @@ -46,13 +46,15 @@ struct vhost_poll { struct vhost_work work; __poll_t mask; struct vhost_dev *dev; + struct vhost_virtqueue *vq; }; void vhost_work_init(struct vhost_work *work, vhost_work_fn_t fn); void vhost_work_queue(struct vhost_dev *dev, struct vhost_work *work); void vhost_poll_init(struct vhost_poll *poll, vhost_work_fn_t fn, - __poll_t mask, struct vhost_dev *dev); + __poll_t mask, struct vhost_dev *dev, + struct vhost_virtqueue *vq); int vhost_poll_start(struct vhost_poll *poll, struct file *file); void vhost_poll_stop(struct vhost_poll *poll); void vhost_poll_queue(struct vhost_poll *poll); From patchwork Tue Dec 7 02:51:11 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Christie X-Patchwork-Id: 521853 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id B7FF6C4167B for ; Tue, 7 Dec 2021 02:51:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231987AbhLGCzL (ORCPT ); Mon, 6 Dec 2021 21:55:11 -0500 Received: from mx0b-00069f02.pphosted.com ([205.220.177.32]:47686 "EHLO mx0b-00069f02.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230500AbhLGCzD (ORCPT ); Mon, 6 Dec 2021 21:55:03 -0500 Received: from pps.filterd (m0246632.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.16.1.2/8.16.1.2) with SMTP id 1B6M5GGY004565; Tue, 7 Dec 2021 02:51:31 GMT 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-2021-07-09; bh=MwZRw6oDUAORsomxtWes8Zatl7shBgHayG0LrD3NZiY=; b=CfToDDpv+ZjnXKHxUplNodAl7JyGXvdEqcNBPUdm7F7QFgi49RZ045+y0zJLokAlft/J XTHNPvPL7kS9vtx4DEF5DbNDybdiXM1Kj2gFac+UK35hT7DWhT30TmYsUH6gKCDIW3+s XFSa0Bc/MfUk8P6BaRZb6AQMQKMOwcyI/s9FVwW4IYLnr6tCL9LYIovgmyu8OVpg03gx KP9Xlkb0ueyvA7Ayj8i84jPCu7InFB6pTm1sYR32drSkeMY0gbQs7eKl6pvbEqNa+hGY jFqouKZqe+mUJj09ANH2JwvorQlKLEXx9fgKldz5T+3cGKpt7UDvns8I35WVcqcANnkO zg== Received: from userp3020.oracle.com (userp3020.oracle.com [156.151.31.79]) by mx0b-00069f02.pphosted.com with ESMTP id 3csdfjbwyn-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 07 Dec 2021 02:51:31 +0000 Received: from pps.filterd (userp3020.oracle.com [127.0.0.1]) by userp3020.oracle.com (8.16.1.2/8.16.1.2) with SMTP id 1B72kglb153019; Tue, 7 Dec 2021 02:51:30 GMT Received: from nam12-dm6-obe.outbound.protection.outlook.com (mail-dm6nam12lp2173.outbound.protection.outlook.com [104.47.59.173]) by userp3020.oracle.com with ESMTP id 3cr1sn5w2j-7 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 07 Dec 2021 02:51:30 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ViwFcRD7sHhcc54LlkmWZUZ38uveKrzvEpyDoSnjuYUaMTHDgq5LCGZvotiw2jd4wXHT3bn6uxOLbjoA6HAKhygq98I/ycdg3+dz3CpwpZBz7wqWDv8OiUBqebRU/tco2l6XObfI0sz4s8cS+onYwfxpU9HbuzhwXl4idhpwcRTyvmMHKyzquwDezmkYc8OEew1YpHNbucb+Ncwn/2U8+GA5gjP96Gf+YGGySGqQckwGZsZhl1nPjgCsmkVdlUqPRwcmKW8o+kywJVYfp5Ns3rbmHHGZzfjJD60JF4SRroQsJbQGxHq0u0Tvua5EZZNPc/XpOE7lfwWfQBWmx38Gjg== 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=MwZRw6oDUAORsomxtWes8Zatl7shBgHayG0LrD3NZiY=; b=MflkoU8f0Nicq6gWxoS5OjEOJIrlJLyGWC8VytyyZgJppLOYwDW8gmTV79AhfyNl9f+1152AEPBjjdigRuxXFSeEgw0eNbLOIbNAjOTJ6N/lhe5yCB/NmbANntMVPhuqalKkiYqWLM4I3/MseKiLDW3/6aU1pwFfa68qgUrzeoDc+oJZbRGMwUVSa0ZGOWSDsGnATvIEWvg2eebF8YYNxQ6wZtL4bOLy4VQnlSp0ISHqlMZ8Ng7NRTxQE/WfMNGUJemOphM8HIBr6rGZf/70uLUhiSaOgPkKCpPUhcQlNH710m2yqWtOiyttwx5BzK+6qx+MsfszZFHJXnNZZkDbzQ== 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=MwZRw6oDUAORsomxtWes8Zatl7shBgHayG0LrD3NZiY=; b=nU+PPJNpvuKhUDDCqQg8kNI3MdYFMMtEZ50mlwONQsa8ibQnAEcHVscIYR9dKeQq5k4ZFGgeqBKQvA3GNDA/cG7LksfVJ0Asri1RsF8jFtSbJknaVF2mgj/k+HerwXV/nyBCJLNszZCB+QfG3odTep9kZfgxR5op685bo0uc4Qc= Received: from DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) by DM6PR10MB4347.namprd10.prod.outlook.com (2603:10b6:5:211::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4755.21; Tue, 7 Dec 2021 02:51:28 +0000 Received: from DM5PR10MB1466.namprd10.prod.outlook.com ([fe80::601a:d0f6:b9db:f041]) by DM5PR10MB1466.namprd10.prod.outlook.com ([fe80::601a:d0f6:b9db:f041%11]) with mapi id 15.20.4755.022; Tue, 7 Dec 2021 02:51:28 +0000 From: Mike Christie To: target-devel@vger.kernel.org, linux-scsi@vger.kernel.org, stefanha@redhat.com, jasowang@redhat.com, mst@redhat.com, sgarzare@redhat.com, virtualization@lists.linux-foundation.org Cc: Mike Christie Subject: [PATCH V5 06/12] vhost-sock: convert to vhost_vq_work_queue Date: Mon, 6 Dec 2021 20:51:11 -0600 Message-Id: <20211207025117.23551-7-michael.christie@oracle.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20211207025117.23551-1-michael.christie@oracle.com> References: <20211207025117.23551-1-michael.christie@oracle.com> X-ClientProxiedBy: DS7P222CA0021.NAMP222.PROD.OUTLOOK.COM (2603:10b6:8:2e::20) To DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) MIME-Version: 1.0 Received: from localhost.localdomain (73.88.28.6) by DS7P222CA0021.NAMP222.PROD.OUTLOOK.COM (2603:10b6:8:2e::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4755.14 via Frontend Transport; Tue, 7 Dec 2021 02:51:27 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 113ebff9-0986-4c46-d312-08d9b92c7751 X-MS-TrafficTypeDiagnostic: DM6PR10MB4347:EE_ X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:2150; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: G1QaOqRlEMz6dMfXXjoRNc+dAQ7yYnvQA346IN3T7q/MBdZRIZhDloBlF7VZ+aNEqclhu8RVTKpjoPCqQ4IerD9B7uZyNNhaalYgcYnfufHyU2RPPeuFnHytPGWHFbth4/fSKOx9vSGn2KxrNRhnWJpcxeMKti6tOLynKiqezyIF+1nTDINVmiHsEq74RWeR1Hpe0eHFGUTnEdMFcYqV6yPOCFft7zEe2lz4R4KeZXHTe3alt9bNJfjuf2zr35r8FZXa8Bk/i/F4bB1nX/McPOO4+RqOT/sfYIwL/T8G0KiScgVj0m32goukiD/apkZd9Ao81OsX2p5bTqB/RLjhC3qOznttXhyFQPaeuqGA5CC/X7ByuQt6A4c69BFuAAhFZAGQghIWAgj1vP/vgoe5Y6bB66Gxh9xoT/IOZJOluyIiK7Y8ALW1rTR+CeNp90OmXCJakvxuiOE+xRxa7IBwc82oBLfBgnE7gsVdrwuuFevgQJpIRZLL3FUW9JIxbioed9osnu6mHuMB0aV9r5IiJJufwdeQ3BSxooTPPAw3DMKp1gru45UYKI4Mj5mg11FKANu95JHCrxqEL8MEYESkVLkDbATooLThDs8M6fiPpW3xN8UOUMcSDtcjo4z1W/+w6tOB2hPX5PKUT+JYp/8yXRvP6QRro4JCYphbue4wBraUrpeCsN6h+3AHzfKheWXM6rEQlGJbC/0xGNbsRYz/uA== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM5PR10MB1466.namprd10.prod.outlook.com; PTR:; CAT:NONE; SFS:(366004)(52116002)(6486002)(956004)(107886003)(83380400001)(4326008)(5660300002)(1076003)(2616005)(508600001)(2906002)(6512007)(86362001)(66946007)(8936002)(6506007)(316002)(36756003)(8676002)(26005)(186003)(66476007)(66556008)(6666004)(38350700002)(38100700002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 6c48UqYskyQZUXippFYYSCM2yC974sYj65Q9Sl3m982qsIjDM3ABibM4R0zIKY/UnK0xmRKzikxSRXpEaEL/I8fBCeE3NQJMqI+m0UI/oG3aV46izWadOD/a7qIvsermXHdW5KpKS91fDx0/boEG0c+a0NcNFX8n21eX4SMc25OusSxeOvQKxVkQivlBgSuuLyqN2aonbwIOtfcyCP7ReBiwz+p5+GzlDgcL4jNbm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kU1uLpd+8UpjMVicMvTiVOnuZ3wdOxVpijzPUJ0HJqnwWps/0beOjiECAVv8W/Yj2bZGqQFg7nl3al0QrfgW+N4vd+dLOLD7t0w7tHw7UYUDvWZwmsdRQFeyszIkbXcZIglzIVUzsRHdpnciwz9zgI8z19hLxVz9ReP8cgSflJmMraqeUwzKRgB1wnJsXWff/o4cmpYVEo06opIF9elh+f8dP0MHTEAs6qIafFIsgwI8anCM3pAedxKZ9uBQsJXlTI6deGSKwnvx1A9I9wIFKIXlR2ExqJr4poYHJCObcjEgv3B0hoPQaikSb9bA4uVHxMiGqxKwEi+sWkn+GNJOLFT/ByMBkmcck+3MwnynfFF63TTA== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 113ebff9-0986-4c46-d312-08d9b92c7751 X-MS-Exchange-CrossTenant-AuthSource: DM5PR10MB1466.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Dec 2021 02:51:28.2705 (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: c/Hts8e+PjjVBo37baC0AUgXDe6yqFnxUwEHs7YifCP/Pkj+kcHZ1PFUsxjAQkTA5PHpnVv3r9SPWH9/acugtTJVGh3kdK87A1LN+/Qeobg= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR10MB4347 X-Proofpoint-Virus-Version: vendor=nai engine=6300 definitions=10190 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxlogscore=999 mlxscore=0 spamscore=0 phishscore=0 bulkscore=0 suspectscore=0 malwarescore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2110150000 definitions=main-2112070016 X-Proofpoint-GUID: 4vlhbb4SQhC9CTe8Bj7yyVoNnJVicZDs X-Proofpoint-ORIG-GUID: 4vlhbb4SQhC9CTe8Bj7yyVoNnJVicZDs Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org Convert from vhost_work_queue to vhost_vq_work_queue. Signed-off-by: Mike Christie --- drivers/vhost/vsock.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/vhost/vsock.c b/drivers/vhost/vsock.c index 1f38160b249d..068ccdbd3bcd 100644 --- a/drivers/vhost/vsock.c +++ b/drivers/vhost/vsock.c @@ -300,7 +300,7 @@ vhost_transport_send_pkt(struct virtio_vsock_pkt *pkt) list_add_tail(&pkt->list, &vsock->send_pkt_list); spin_unlock_bh(&vsock->send_pkt_list_lock); - vhost_work_queue(&vsock->dev, &vsock->send_pkt_work); + vhost_vq_work_queue(&vsock->vqs[VSOCK_VQ_RX], &vsock->send_pkt_work); rcu_read_unlock(); return len; @@ -608,7 +608,7 @@ static int vhost_vsock_start(struct vhost_vsock *vsock) /* Some packets may have been queued before the device was started, * let's kick the send worker to send them. */ - vhost_work_queue(&vsock->dev, &vsock->send_pkt_work); + vhost_vq_work_queue(&vsock->vqs[VSOCK_VQ_RX], &vsock->send_pkt_work); mutex_unlock(&vsock->dev.mutex); return 0; From patchwork Tue Dec 7 02:51:13 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Christie X-Patchwork-Id: 521852 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 71F45C43217 for ; Tue, 7 Dec 2021 02:51:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230500AbhLGCzP (ORCPT ); Mon, 6 Dec 2021 21:55:15 -0500 Received: from mx0b-00069f02.pphosted.com ([205.220.177.32]:49260 "EHLO mx0b-00069f02.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231669AbhLGCzF (ORCPT ); Mon, 6 Dec 2021 21:55:05 -0500 Received: from pps.filterd (m0246631.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.16.1.2/8.16.1.2) with SMTP id 1B6M56v5019273; Tue, 7 Dec 2021 02:51:33 GMT 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-2021-07-09; bh=n9igVpBgk9JOAb2qnFZRgyxT2Xy2Czyi0qJcVvkU+qg=; b=PuFS1pdx0/A7nGWqCcsuiQp24SFXfc9Dtv5UdxyOlwh1BZsChpRSqhJFaAdoRqu5dRmO unWTM9OdLUeDs+vVRNF6NMkx6f+m4vid4buKMHznUTP3ncwDN6uYlMeRHk708GNAfeHE bPC1VDKRa/2icBc8ZP4VMg3l3RoZPjZgYIhTZkekwSpKpnhqMN+0g3H0USlcLKEPrDDu jBzNIf1GXqjb11PKbGuZyKO7FBuGH2zCmvOELtBvxLik5SsIMIjp0BU3gc07tb5QkjOr GFLapearbzmZY8jaHpMJWcJ7LIAEQr2lLd8IWiVx3nuCaidaGZlUhWy22WNEKY/u6dcQ Fg== Received: from userp3020.oracle.com (userp3020.oracle.com [156.151.31.79]) by mx0b-00069f02.pphosted.com with ESMTP id 3csbbqmefc-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 07 Dec 2021 02:51:32 +0000 Received: from pps.filterd (userp3020.oracle.com [127.0.0.1]) by userp3020.oracle.com (8.16.1.2/8.16.1.2) with SMTP id 1B72kgld153019; Tue, 7 Dec 2021 02:51:31 GMT Received: from nam12-dm6-obe.outbound.protection.outlook.com (mail-dm6nam12lp2173.outbound.protection.outlook.com [104.47.59.173]) by userp3020.oracle.com with ESMTP id 3cr1sn5w2j-9 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 07 Dec 2021 02:51:31 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=fU9EFChevjslWzDWF/wEQ3PkGtqtgs3eDjK2h/5t0630B56GnCo+2G4aycrjA2lORSQS/2lUOOHUgoFqK5vHjas6qOD2282PEKCTGIavi34bdOJwaWV1JErmvS15Te1UiCCBqWbhGaR8yE2M73d4Fh7pK8dod+eWpid9LyLoo4vNbbL+ecvjoR6xwrNEZ4sMBfT2bHb0L2cv9NRiZgHLkIqPZb3+m4phwLppFqTzNN2mZn3y1GYH0svc6zXxThqYKIrlztvjO/S2wrj6KtgEw2/v/QEqw/eWPlJoDGMqIV6k42NhPjn55W9iyorPYtW1Wl/P6/Ea3IpDX9+qhXRkbA== 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=n9igVpBgk9JOAb2qnFZRgyxT2Xy2Czyi0qJcVvkU+qg=; b=Z2qqWnErN8sLyyUoaoAV7bh3mP1uciLqLwQY1V66nV5s/iEAcchMTYUuGz6QS/WkqvJrGt4Wd4inQGdA0EF0qKwAlbnpkKiqRMyJJTe2PUaldX692128EqIFJKfay9aCvE/60lugImyj72Ttp7Ik56kQ9y5yXQr5+zjacmptf+vhbt3LZVhtIqnYJYWqMhN9vpmEoN6juzA2vpWwKAwfzGKxcTdjtDFECJor3pHFnQEkWD1L7dahBorEe+uiXzLTFytwiyUjbOy9im3xG1VvU2GV3WwdALrYx1qx7NIFdPmjl9hSgooCj2tumeISGSQhpiuzrARoVN69VDDhfuZeTA== 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=n9igVpBgk9JOAb2qnFZRgyxT2Xy2Czyi0qJcVvkU+qg=; b=q+It34C2+ZxZYh+mIPLtKTO8/j1vnHqXa58Iybsk3VjfCCxbL5WXlApBVCtYJ6h6hr8kcjObVpfeQ31+awhJtLhAYUAwx/GpCOW+iQsvwb7Rd8kWaU8MsLy69Ts8svwl6Yh3NMKqWB69lQoxpLvweklpoFqu6/D7Him3MgD/byU= Received: from DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) by DM6PR10MB4347.namprd10.prod.outlook.com (2603:10b6:5:211::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4755.21; Tue, 7 Dec 2021 02:51:29 +0000 Received: from DM5PR10MB1466.namprd10.prod.outlook.com ([fe80::601a:d0f6:b9db:f041]) by DM5PR10MB1466.namprd10.prod.outlook.com ([fe80::601a:d0f6:b9db:f041%11]) with mapi id 15.20.4755.022; Tue, 7 Dec 2021 02:51:29 +0000 From: Mike Christie To: target-devel@vger.kernel.org, linux-scsi@vger.kernel.org, stefanha@redhat.com, jasowang@redhat.com, mst@redhat.com, sgarzare@redhat.com, virtualization@lists.linux-foundation.org Cc: Mike Christie Subject: [PATCH V5 08/12] vhost-scsi: convert to vhost_vq_work_queue Date: Mon, 6 Dec 2021 20:51:13 -0600 Message-Id: <20211207025117.23551-9-michael.christie@oracle.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20211207025117.23551-1-michael.christie@oracle.com> References: <20211207025117.23551-1-michael.christie@oracle.com> X-ClientProxiedBy: DS7P222CA0021.NAMP222.PROD.OUTLOOK.COM (2603:10b6:8:2e::20) To DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) MIME-Version: 1.0 Received: from localhost.localdomain (73.88.28.6) by DS7P222CA0021.NAMP222.PROD.OUTLOOK.COM (2603:10b6:8:2e::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4755.14 via Frontend Transport; Tue, 7 Dec 2021 02:51:28 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: d20dbcb3-df89-42b9-c4e8-08d9b92c77dc X-MS-TrafficTypeDiagnostic: DM6PR10MB4347:EE_ X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:551; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: ghT9Zmr2WUSxsyYi0tHgI4MY/0vC6FTWLT3Ujk056cmSIKfDYFNsCuFXkFIwiS+oW/8J8ExvvzxlF6zZcRNISWjXDT1qeVV/bJkiWEqp/x7RK9Sghomp3oYPVR2EtF879xi4Bc/Neyzlan4rWoECZTRvKFmRV+Fzm2BwncjnrpUcGDot+86rcbAbJr/vO5atpgKAfTTiI47IzkOpO7mBJNKzqV7oIFEmCYvGStqVTd650PGxDdW6JJnKeKGNP19XLNkT/U2QsRueoOPKJg5XCeCx3pnMYC62Bmp6IzOd4vyNaPeowEdYZyjstf2UXtGnas8rTf/b1Iw1vETDaFTDd4kO9REVcQ/aDaJhA9mlC3NpzomG8ihWebQbxzV5m+Rh2vBGMhX57klwhZOZ9n6zzyCCn+ThZHFQRcpU1cOnrxjXaPjKidvVXTlVICy13eTjDQhkri9ubo/ycxKWuMY/snAvWLiqYsUuDdbepaIeehyREWx+yRd7vZ7ybMFn65pl3pIKqh34pN96vF59minp4kelu9v0lR7u2fRRy0pxxRgCnylKUFcyuHapQWzLFKlNtrOJfLcNA0gLZD6IiQ3bG0LVyT20K/e/fppPfXGXF0IxVOU/KcyLrTRXy3ofENlrEtvUFesEshkHfK7xMczhQbPr8c0zTxrHxV1Zs8GS2WF/4K1frKMPUMCMY2VoK8DG8K1Mj0CuNPhrVFVNhkZ40A== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM5PR10MB1466.namprd10.prod.outlook.com; PTR:; CAT:NONE; SFS:(366004)(52116002)(6486002)(956004)(107886003)(83380400001)(4326008)(5660300002)(1076003)(2616005)(508600001)(2906002)(6512007)(86362001)(66946007)(8936002)(6506007)(316002)(36756003)(8676002)(26005)(186003)(66476007)(66556008)(6666004)(38350700002)(38100700002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: AUi7kHlSgtfFdr6FFQkCJPki5ILgy4rioXyljdp5W+6/eNrMo184xdQmGRRiuX6TNHYqK7nBaEtVWicvBHBtRW9g66otJ18CrdzYtS9pisdCPKKVKHqg2EqfdPf2D1FQb3h7SGaVo5o5MBQIAYO+qW5yIEJKpemHw9KLTA3cP1y+/kc9r7bRVMXC4z0bPDjeyoEZCViGydFhykj8dsd6yjWnMrVfbvzjrZrZphboYyCTfGyLmY7D2idXMGd1dx3kX2xhVFP6k3dRRrGAEUjc9rP03KDNMvYQYp4YLl/zb9g3mxXOSjSsjBEKsxRGbrtKpze43uWyOk7AxYimd5qxly/UdZHBZBzhVL6W4/HfabkyVEm2JMEBci4tbwDwWtv8RKRU5JvIZLkXXydy5RUuq6l8gSdK9i6tz0To14GP+LHomqElvnCOUmmgalIvU5m2vTwkWf/7zLxKcgJ7c/Zt0rCCUKW9jGFCTItYcboHl9fWeKEjBTIYi8vbcCmzhQGFqLB0nQ7OWD9hXlG2BfWJMOEO754Gtpd/6zsCOsXLJLQaHhGdr60qKimccT+PJKwDiOrD7teheSjsDUhUuhkye3hG6CLBgU48NN+7DvtIabTmj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rg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: d20dbcb3-df89-42b9-c4e8-08d9b92c77dc X-MS-Exchange-CrossTenant-AuthSource: DM5PR10MB1466.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Dec 2021 02:51:29.1761 (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: TLoc79Uq5SpBM1SrKFCkWrlgtmMlWqLWPCEDXtaZXV97ZLkIP9IK5l4aBRp4gC8dhraVivCA141FulTaGc1VYdHUiMY+F+z7mBTjkSJ6Cfo= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR10MB4347 X-Proofpoint-Virus-Version: vendor=nai engine=6300 definitions=10190 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxlogscore=999 mlxscore=0 spamscore=0 phishscore=0 bulkscore=0 suspectscore=0 malwarescore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2110150000 definitions=main-2112070016 X-Proofpoint-GUID: BC8Yn1-zKo5nlKOmCbcUtkEJR6Mb-LcM X-Proofpoint-ORIG-GUID: BC8Yn1-zKo5nlKOmCbcUtkEJR6Mb-LcM Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org Convert from vhost_work_queue to vhost_vq_work_queue. Signed-off-by: Mike Christie --- drivers/vhost/scsi.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/drivers/vhost/scsi.c b/drivers/vhost/scsi.c index b2592e927316..93c6ad1246eb 100644 --- a/drivers/vhost/scsi.c +++ b/drivers/vhost/scsi.c @@ -361,8 +361,9 @@ static void vhost_scsi_release_cmd(struct se_cmd *se_cmd) if (se_cmd->se_cmd_flags & SCF_SCSI_TMR_CDB) { struct vhost_scsi_tmf *tmf = container_of(se_cmd, struct vhost_scsi_tmf, se_cmd); + struct vhost_virtqueue *vq = &tmf->svq->vq; - vhost_work_queue(&tmf->vhost->dev, &tmf->vwork); + vhost_vq_work_queue(vq, &tmf->vwork); } else { struct vhost_scsi_cmd *cmd = container_of(se_cmd, struct vhost_scsi_cmd, tvc_se_cmd); @@ -1360,11 +1361,9 @@ static void vhost_scsi_ctl_handle_kick(struct vhost_work *work) } static void -vhost_scsi_send_evt(struct vhost_scsi *vs, - struct vhost_scsi_tpg *tpg, - struct se_lun *lun, - u32 event, - u32 reason) +vhost_scsi_send_evt(struct vhost_scsi *vs, struct vhost_virtqueue *vq, + struct vhost_scsi_tpg *tpg, struct se_lun *lun, + u32 event, u32 reason) { struct vhost_scsi_evt *evt; @@ -1386,7 +1385,7 @@ vhost_scsi_send_evt(struct vhost_scsi *vs, } llist_add(&evt->list, &vs->vs_event_list); - vhost_work_queue(&vs->dev, &vs->vs_event_work); + vhost_vq_work_queue(vq, &vs->vs_event_work); } static void vhost_scsi_evt_handle_kick(struct vhost_work *work) @@ -1400,7 +1399,8 @@ static void vhost_scsi_evt_handle_kick(struct vhost_work *work) goto out; if (vs->vs_events_missed) - vhost_scsi_send_evt(vs, NULL, NULL, VIRTIO_SCSI_T_NO_EVENT, 0); + vhost_scsi_send_evt(vs, vq, NULL, NULL, VIRTIO_SCSI_T_NO_EVENT, + 0); out: mutex_unlock(&vq->mutex); } @@ -1965,8 +1965,8 @@ vhost_scsi_do_plug(struct vhost_scsi_tpg *tpg, vq = &vs->vqs[VHOST_SCSI_VQ_EVT].vq; mutex_lock(&vq->mutex); if (vhost_has_feature(vq, VIRTIO_SCSI_F_HOTPLUG)) - vhost_scsi_send_evt(vs, tpg, lun, - VIRTIO_SCSI_T_TRANSPORT_RESET, reason); + vhost_scsi_send_evt(vs, vq, tpg, lun, + VIRTIO_SCSI_T_TRANSPORT_RESET, reason); mutex_unlock(&vq->mutex); mutex_unlock(&vs->dev.mutex); } From patchwork Tue Dec 7 02:51:14 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Christie X-Patchwork-Id: 521851 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7700FC43219 for ; Tue, 7 Dec 2021 02:51:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232070AbhLGCzR (ORCPT ); Mon, 6 Dec 2021 21:55:17 -0500 Received: from mx0b-00069f02.pphosted.com ([205.220.177.32]:50002 "EHLO mx0b-00069f02.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231694AbhLGCzG (ORCPT ); Mon, 6 Dec 2021 21:55:06 -0500 Received: from pps.filterd (m0246632.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.16.1.2/8.16.1.2) with SMTP id 1B6M5CPn004499; Tue, 7 Dec 2021 02:51:33 GMT 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-2021-07-09; bh=DkoqjtSG2ATYucz2O/6b9MD6Cz3yAAid8gBClUM0Bug=; b=TykCfqJkJsRmngVCXfkJVwF+RWXXXPdEE4R6atUFbJxr9x7rvhcVdt7XvhecQFr6rXcf utPooisrU5FgIEtVi2w1Zl3rf9Rm1TB7kcbDcTZaBA7oUJKHa/EswZPfHqz3O+CB4/P5 o5e77iC254CK7M3QwaCwLkvu2QF/HD5BkNd2wCFmKP3vWm5rmz36vQ/gopzSyAO7mdyW 7CIyYeQsqo/wn+FrmGHktTb0JRiFQb71e+kUZoNZElpjZBSTXvsZhHWrt+KqtXbEcbtn oyhORhCvQ2+fE8QxJelfm+OCAlpldjtJHkh/uy3vuQ5oY4+ZMvbjmVedZdANi9wP+oMY fw== Received: from userp3020.oracle.com (userp3020.oracle.com [156.151.31.79]) by mx0b-00069f02.pphosted.com with ESMTP id 3csdfjbwyr-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 07 Dec 2021 02:51:33 +0000 Received: from pps.filterd (userp3020.oracle.com [127.0.0.1]) by userp3020.oracle.com (8.16.1.2/8.16.1.2) with SMTP id 1B72kgle153019; Tue, 7 Dec 2021 02:51:32 GMT Received: from nam12-dm6-obe.outbound.protection.outlook.com (mail-dm6nam12lp2173.outbound.protection.outlook.com [104.47.59.173]) by userp3020.oracle.com with ESMTP id 3cr1sn5w2j-10 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 07 Dec 2021 02:51:32 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=dKvb5ANqeJTkUvNLPXYozS69evUJEtO6qhyGs7rLP319NHBN9ZiZXVM+0Xo8Oqe6Hqnt5LVNWSwObobkjFCmPxXi1eEa8KXU2+Vc+3gWTvcUMscocsk74dzs5qEnwlLJw+FcZ0+EXwV1o80tDmL5ANl5tc/gKMb4zfbiO15AyMn3QHePz6gtpntKDzFDwDjMWzZ9h9PgGaepZf0wRT6XM1zvv2dlPfl6t77IHCY/JPHB4wBBTbsoS/o5oLJfAEAQLip5nDGaFSmgZ5zyQ4yOt+TiWHw7WLU6V9wlhhT2HswTOxxTIZ9w7vF3oMQh0Zrob0r8tVoNAR7xdnmHocIBFQ== 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=DkoqjtSG2ATYucz2O/6b9MD6Cz3yAAid8gBClUM0Bug=; b=gjjdCnRLHPQ/aQRlk7N81nZMPZoyByXHTnImUNcqww7lBb1a0aD/owvub2X0CR7RfsdU9fmeKK38IlbNWNhsUra8u5embqIuz831S42DUuWGDdIfVX8A5FhP0ULFPJTh7syDr31sBDrX7LAwwlyvACHOgkRG9lnvbQibirD96LUE4fXVI6FNhTXQEwsjG/sijzHF4pIYMRqasTyikyPsrPdQgjTk2sDf8ESi2HRdSg85h6PQejSAYpa3GtbcBiunPu18jAqXUJdWCD1xrB8sfK2CCAwVu7dYVm6yatPaaDDE6B8J6ZBvIHiO0ATHEKDh+YeGeE2dXUjKtDksGmrHrQ== 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=DkoqjtSG2ATYucz2O/6b9MD6Cz3yAAid8gBClUM0Bug=; b=Xf7CIxLprJAHCCJea8vOC3TNia4Sc7qaKoNT/lTWI28UoEtuZekkPNatzyFWj6DsIMdTob/xYaqFZNq/9AZ2YBVqMblY89Bw5QrTMWylgFJxTupYZK7Lw7yUYyH+eMoewJrmMtDaEf6qOvTVEKxul81A/sOX0kstYnPE4+kALzo= Received: from DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) by DM6PR10MB4347.namprd10.prod.outlook.com (2603:10b6:5:211::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4755.21; Tue, 7 Dec 2021 02:51:29 +0000 Received: from DM5PR10MB1466.namprd10.prod.outlook.com ([fe80::601a:d0f6:b9db:f041]) by DM5PR10MB1466.namprd10.prod.outlook.com ([fe80::601a:d0f6:b9db:f041%11]) with mapi id 15.20.4755.022; Tue, 7 Dec 2021 02:51:29 +0000 From: Mike Christie To: target-devel@vger.kernel.org, linux-scsi@vger.kernel.org, stefanha@redhat.com, jasowang@redhat.com, mst@redhat.com, sgarzare@redhat.com, virtualization@lists.linux-foundation.org Cc: Mike Christie Subject: [PATCH V5 09/12] vhost: remove vhost_work_queue Date: Mon, 6 Dec 2021 20:51:14 -0600 Message-Id: <20211207025117.23551-10-michael.christie@oracle.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20211207025117.23551-1-michael.christie@oracle.com> References: <20211207025117.23551-1-michael.christie@oracle.com> X-ClientProxiedBy: DS7P222CA0021.NAMP222.PROD.OUTLOOK.COM (2603:10b6:8:2e::20) To DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) MIME-Version: 1.0 Received: from localhost.localdomain (73.88.28.6) by DS7P222CA0021.NAMP222.PROD.OUTLOOK.COM (2603:10b6:8:2e::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4755.14 via Frontend Transport; Tue, 7 Dec 2021 02:51:29 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 2589c4c6-8f31-4f1c-2ec1-08d9b92c7820 X-MS-TrafficTypeDiagnostic: DM6PR10MB4347:EE_ X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:2733; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Y6bFa4kHRAWek9x9G/9tJqiLU0f3CV2bcKReURGt7eetvHvftlfmAnD3dUL4dwzRGKPp4B2rM3S9CN2TJJzrs2DbrkhzQTagzyitZORL4OQWJmL7+iCGqa839SameY5Ml2oIgsuZJCi9+0F6xI4jIfBZDa5l0Eobsx3bGvqqJPapdic5Z+uHnsmfkoyPrzVwnWes4r86FXm9+CjImtUJJHee4oajHkM+UVct9GAivmx6oAq1/d8moFVoRJWeWBWgfTlgYCEfIhr9K29+dth4Z/gQFkjfpTC5kWUik371KKUwEK6JhD60yf5lTlvdI+5M/wEcIQ4AEtco0sUyORhi6R/jRtroKylCNQ3KCiXydgWbiH4+UFasopaFHC6hp/UbOiFJXsRL/5Yd0UYkSls/cZ/3E1eVJcOtWq4UG76AdCM3Fx94uX3/+KXfWjPX0tARrYipELmxbX4p9Xg+slVB91Ib4qFF7VsSaTjBRCioYUpORrnCXHqf8i/j6jg/GQ9P8RJXYlgdrF6ondpJCwKeEkWSUw34fzTBbRZMIHqFuHa3vIfJVuI5Qdqbk6J1zunWlRQe1Up+phx1uKyGLgItG+FlZ3AVvjwXjSqDxQgDF4r2JyRWGUOCPkRFcT1/RvpXyeidWj3BWMu94fkBJheesXAk00QcS2iJCZU7yM17HHbWMrKkeXCbo7jeE7mWzMKQUni0fT2CW+6Vz+3mYhzy5Q== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM5PR10MB1466.namprd10.prod.outlook.com; PTR:; CAT:NONE; SFS:(366004)(52116002)(6486002)(956004)(107886003)(83380400001)(4326008)(5660300002)(1076003)(2616005)(508600001)(2906002)(6512007)(86362001)(66946007)(8936002)(6506007)(316002)(36756003)(8676002)(26005)(186003)(66476007)(66556008)(6666004)(38350700002)(38100700002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 9FjvqGzpiabesWKIyAZp6V8n+ypmBUSh7qnvUPrp62fbly7JnNhEScQ70UQu4SonCSTwrfScyT+8KPqXOpfnR6ZL0rDQkSITaia9JHIkt7wAkmlA0nCF8kPNmBVH2k3k9y346nuTpBJf+q968MEK0k5bH75MQgVUHToYTHf2RWQ2E4DXhI4GHW/zI1MwEnO2R+QUTgzO6RRd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TdNUXpSe4EoID0e8EwLTzZiYIdr4hEP/Qv/jyaWgSkyFr4DsA/ZMvF+/2tnhTbx6e1N3n07R94Hc9Hwk1XcKPF7Y3+07/3zw6aFH4VYw+SFXEd1scaOekoT6q/uBleJUmi4A1MepuCPVlO697qd52ql/TP9A5Qnyh2MMQdJsIFkXXQOeyNX0EMoCDszQQ3CpQ3kDmZ8/uI85Ml16SmiSLAnEmKmyj5d01hjk1PjeZyILI3N4WbuALI6dEyfFGGAHzEVFV+AXmYmlWNh8gk52QZdpb3JqvsuUAJoXhBjZFF+d+jTSNJp5SYRkK1uKtXD94/ghzGXmEqX06FCu/gooSSQZayFYu0Mo0eeh0zMOrXbEPdAdsgenOZdQVP0SE3/au3dPOcbAI8tWeE7RrJSRHfbA== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 2589c4c6-8f31-4f1c-2ec1-08d9b92c7820 X-MS-Exchange-CrossTenant-AuthSource: DM5PR10MB1466.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Dec 2021 02:51:29.5859 (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: 9AZnRSe9Ob59ERgXjDh3a2CsEYMLuJns/1HXGiZtocoVXNGmZ+HaAgRxmgHqS14fWvuVA2J9Qa84fTrarLjKKm9ja03S1f4nT8Bfvtgs8Bg= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR10MB4347 X-Proofpoint-Virus-Version: vendor=nai engine=6300 definitions=10190 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxlogscore=999 mlxscore=0 spamscore=0 phishscore=0 bulkscore=0 suspectscore=0 malwarescore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2110150000 definitions=main-2112070016 X-Proofpoint-GUID: -QOCfylhPAFnhSkrI9I3bcgtOfb4SKAH X-Proofpoint-ORIG-GUID: -QOCfylhPAFnhSkrI9I3bcgtOfb4SKAH Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org vhost_work_queue is no longer used. Each driver is using the poll or vq based queueing, so remove vhost_work_queue. Signed-off-by: Mike Christie --- drivers/vhost/vhost.c | 6 ------ drivers/vhost/vhost.h | 1 - 2 files changed, 7 deletions(-) diff --git a/drivers/vhost/vhost.c b/drivers/vhost/vhost.c index e9f78f0d72cb..050b8007db8b 100644 --- a/drivers/vhost/vhost.c +++ b/drivers/vhost/vhost.c @@ -262,12 +262,6 @@ static void vhost_work_flush_on(struct vhost_worker *worker) wait_for_completion(&flush.wait_event); } -void vhost_work_queue(struct vhost_dev *dev, struct vhost_work *work) -{ - vhost_work_queue_on(dev->worker, work); -} -EXPORT_SYMBOL_GPL(vhost_work_queue); - void vhost_vq_work_queue(struct vhost_virtqueue *vq, struct vhost_work *work) { vhost_work_queue_on(vq->worker, work); diff --git a/drivers/vhost/vhost.h b/drivers/vhost/vhost.h index 58032429bd05..4423b2420c90 100644 --- a/drivers/vhost/vhost.h +++ b/drivers/vhost/vhost.h @@ -50,7 +50,6 @@ struct vhost_poll { }; void vhost_work_init(struct vhost_work *work, vhost_work_fn_t fn); -void vhost_work_queue(struct vhost_dev *dev, struct vhost_work *work); void vhost_poll_init(struct vhost_poll *poll, vhost_work_fn_t fn, __poll_t mask, struct vhost_dev *dev, From patchwork Tue Dec 7 02:51:15 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Christie X-Patchwork-Id: 521850 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 33FB5C43217 for ; Tue, 7 Dec 2021 02:51:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232178AbhLGCzT (ORCPT ); Mon, 6 Dec 2021 21:55:19 -0500 Received: from mx0b-00069f02.pphosted.com ([205.220.177.32]:54186 "EHLO mx0b-00069f02.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231868AbhLGCzJ (ORCPT ); Mon, 6 Dec 2021 21:55:09 -0500 Received: from pps.filterd (m0246630.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.16.1.2/8.16.1.2) with SMTP id 1B6M5GdV012529; Tue, 7 Dec 2021 02:51:37 GMT 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-2021-07-09; bh=WpJwM0XnAzdcT1gIhNOmvdnESVRp0Jp8i83DqV1c8g8=; b=n/lpzALwbk2BfhvMEbXkl4Jf59pDlOTiXj4/B9s4fS6g6Wktf7e1FeyLgbMg60mbmsKr cZ9Njaegk01HO7j+XV2Cde8FhPZSXxcennT5lZIAXjP+auFsS7hj87IIHGS/XA6nbXYc YiI4575VSDhUC301/LxwSwvqB4XGTHkYo9KadLGy6exZFpIi08QANIPibMa5YfFyCAPG IgTAlXWC/Q4oqIC9DugKd2u5xi08WrTtbvLb8G44H2bDO+47G4QU5tkuNxbL8uDcSJra 73+OFDi5wfetni4hHp56lO4zlB5so5QW/FV0qeb4BXKfqV301yxCCXwecIDChhDPiFTv ww== Received: from userp3020.oracle.com (userp3020.oracle.com [156.151.31.79]) by mx0b-00069f02.pphosted.com with ESMTP id 3csc72c35d-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 07 Dec 2021 02:51:36 +0000 Received: from pps.filterd (userp3020.oracle.com [127.0.0.1]) by userp3020.oracle.com (8.16.1.2/8.16.1.2) with SMTP id 1B72kh33153049; Tue, 7 Dec 2021 02:51:35 GMT Received: from nam11-bn8-obe.outbound.protection.outlook.com (mail-bn8nam11lp2174.outbound.protection.outlook.com [104.47.58.174]) by userp3020.oracle.com with ESMTP id 3cr1sn5w80-3 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 07 Dec 2021 02:51:35 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=oFqnET4kqrrYFMUWvXqFdWgqdVjjf9pd1bIuW8q3oyLktnxwUJ7Y3092uxXlNol2Bv4ZvAgMrwvWJJGcOQCWDh9YyI48kCdUioxSZ+FfYeL92xpZy4acn4KPFa/IEi9Pp4c8omC1cHsi4TmbpZ15tkjKnjhrQGKEsuo6ipQkxyBwUfjJmOHKUgEmTdLH9I6X4sT/e5xd+UNq0GGIfp+S688047rXMscYnwOYYO7z+bjDfmwP9c2GcTlOZUaLe52GaAdq5zodeUaes8x0WnU4pSedDTjPIVWtyalkPF7qE9zk9lAsvLqErW+ihaQOeyPLpcXyg88iiWoagor7k41FqA== 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=WpJwM0XnAzdcT1gIhNOmvdnESVRp0Jp8i83DqV1c8g8=; b=OuQc4fyrSYkhkev+qAfuM5xvGueEts/8ehy5TO2iG+YSlrvOvVF7YVpC5ibFYeQ5n2nPkta/4IPYPuPm9wiYUvtUToeVLBAkxGqbNzuVQKsr/wTqht0SlvaTq9rCedM/XmUiVOaM6kw1AB+DznQtozKXJ4V3DeBkLP9jVwP32vMuynq9M1bRLL4fXTS6y2jQ/xnc1bq9TJT2bECxhhqK8r8cVWvg0NSMnuDp9ZyPcPEcBaLC/z8bWEvpnw/Wblz0MG2Cwf3Vkl0FY9T4S2lT6io28V45navSiXJuRcGS3xKzS2dVfiItyzHV8F/qeAY41dUYELrOgGwtfgvGDaoKpg== 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=WpJwM0XnAzdcT1gIhNOmvdnESVRp0Jp8i83DqV1c8g8=; b=PEdAKbbqYAuxd58jz7/NCkffSD/83oietLbk5apF9UOGKOEh5vy+BmIuU9HMoNsPTSqAvCUDJRNv8U7DKpApKs5eAtep6BzKxbsGI3k0M8hV/+KluMfhLieHitxQiQnLTTAymPetaaNWCNeM7lhzUn0DtZvv+g0gTIizp/buiYE= Received: from DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) by DM6PR10MB4347.namprd10.prod.outlook.com (2603:10b6:5:211::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4755.21; Tue, 7 Dec 2021 02:51:30 +0000 Received: from DM5PR10MB1466.namprd10.prod.outlook.com ([fe80::601a:d0f6:b9db:f041]) by DM5PR10MB1466.namprd10.prod.outlook.com ([fe80::601a:d0f6:b9db:f041%11]) with mapi id 15.20.4755.022; Tue, 7 Dec 2021 02:51:30 +0000 From: Mike Christie To: target-devel@vger.kernel.org, linux-scsi@vger.kernel.org, stefanha@redhat.com, jasowang@redhat.com, mst@redhat.com, sgarzare@redhat.com, virtualization@lists.linux-foundation.org Cc: Mike Christie Subject: [PATCH V5 10/12] vhost-scsi: flush IO vqs then send TMF rsp Date: Mon, 6 Dec 2021 20:51:15 -0600 Message-Id: <20211207025117.23551-11-michael.christie@oracle.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20211207025117.23551-1-michael.christie@oracle.com> References: <20211207025117.23551-1-michael.christie@oracle.com> X-ClientProxiedBy: DS7P222CA0021.NAMP222.PROD.OUTLOOK.COM (2603:10b6:8:2e::20) To DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) MIME-Version: 1.0 Received: from localhost.localdomain (73.88.28.6) by DS7P222CA0021.NAMP222.PROD.OUTLOOK.COM (2603:10b6:8:2e::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4755.14 via Frontend Transport; Tue, 7 Dec 2021 02:51:29 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: d6d6a283-3125-4a5c-a9e4-08d9b92c7864 X-MS-TrafficTypeDiagnostic: DM6PR10MB4347:EE_ X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:2958; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: VD4n9OgKRlJbLNi2yd1YHwunteqNYKUHFlRg4bS45M1SiN/wG39BCgTbA+bbhNP+8ctYJTxxiL5lxROodo6TND6VGONF9jIzBbv0DMrx6yEymdMXYwHlG27XN+5PoBx6e7cGwIkysR0RnzYqgic6mcdIC/w2PY4n9ugmAKH0plBvP79+4k3Tb0NaNPIOnIaaGodDL8Yb9LA5LE6VEMgcKC6bpOZavkFvJIGh6GmXbGtu3CSJSlOfAJfuXnlqle5Pc1cbKrO5y3Pv9j+T1/ocoTU7fZDJjqMqpZpQxaDzcpfv52UCyXrtHSf82o9geGpObHrKvRL3LO5U8k75WUigIthvk9M7fgLrlVGfTgBi+ZjdaINwRQVFF0vwE97L2NI59UMWKjlJFnc6YaXt/O2tZjZ0JVdCo3FDAUrM+1yicP3KE0bKvlWEI2RUFLpW9432R9XmV9XkDY4i5lPsnhIDF0QDfIC2jQkWDTXZ6VgqAKWTVwstrH1lsgv2BQpcztLMl+XxHcOMWUVOwmQxmmkdHQff8Mt7xWvViv+2sQ8CmITue2kBO2TClKsDa6iv+MfzmQuzKKqr6l+cBy1Fm9GDuzMAn8zBdvudFNUzFSz6+Nz9LUst6Org+S5IKERqAuYU4hrfPeFqiJHCxSPyggk+1fL/wT7Bgl39NM/1WG0BBpjxhFM/OjkYlbRQ37GhRiGR0Wj+0K7D1ncPwNskabMIqg== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM5PR10MB1466.namprd10.prod.outlook.com; PTR:; CAT:NONE; SFS:(366004)(52116002)(6486002)(956004)(107886003)(83380400001)(4326008)(5660300002)(1076003)(2616005)(508600001)(2906002)(6512007)(86362001)(66946007)(8936002)(6506007)(316002)(36756003)(8676002)(26005)(186003)(66476007)(66556008)(6666004)(38350700002)(38100700002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: AoIYetrkpaypo10jrDBJxiGN3qSF7Vf64xkKQZVImvLVqzdSRRiCjJ1uZLRSDpRRuTZwSXp1ZSyPSFoK4v5n1f/q1M9du9X5q7lHe+4xKHWP2Wkf6JGMnCwQgOABiPToLSkFdtAjJXNCg4Ievx67smEGGjGCPOo0cGOTlGJWTnfBmMmJ36GTy7sdcRLDQRruJqjpA518hnGS3NqphUGGkvvDUlZWvyk2fLIATDq3FEu2LQUovEk7+w++l4cTAKMzuy2W2hpprXYUdK4mmASxXvpJS512AvLPBPP9PPIcGE+69tm38zFsRSqpE9cCatgMI7LsHM4MxH3Ay7fe42JugQSlwRxD4fRG7zeyjuA891faJF9yWddALQylQ/yATqtNG0desBUzuWRRJKv4HhQwgl50XPrMKBRpEAfANWPkptmzym2+rzPmFVlJp67TH89ChZIhKg3RdWhPgAP03+kx53DEI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UBGm50smZz9EE/wytm8/J4lev9FS5nWYBB9KNX9xKQprkyC585MC+tAD78TDjj6OPu/XZ77OZwFxaEreDlRdRuQ6ptCmn9lP+tVMcxQyre940WJuN7pWtCoMe2A4EwLwtE9A== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: d6d6a283-3125-4a5c-a9e4-08d9b92c7864 X-MS-Exchange-CrossTenant-AuthSource: DM5PR10MB1466.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Dec 2021 02:51:30.0297 (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: bG/9OpukN8LHSd+ZCriqg6wGtNHozQtipQtFxvG91UjaILkwlubS9HlQlwPKH7VggT06u0PaJNlm3NDt+Vl5HYl7F7kM2J9iz4tl+3vJL48= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR10MB4347 X-Proofpoint-Virus-Version: vendor=nai engine=6300 definitions=10190 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxlogscore=999 mlxscore=0 spamscore=0 phishscore=0 bulkscore=0 suspectscore=0 malwarescore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2110150000 definitions=main-2112070016 X-Proofpoint-ORIG-GUID: DVHLnu3GaCbUn6TfB_TVSGkSSw2x-vvy X-Proofpoint-GUID: DVHLnu3GaCbUn6TfB_TVSGkSSw2x-vvy Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org With one worker we will always send the scsi cmd responses then send the TMF rsp, because LIO will always complete the scsi cmds first then call into us to send the TMF response. With multiple workers, the IO vq workers could be running while the TMF/ctl vq worker is so this has us do a flush before completing the TMF to make sure cmds are completed when it's work is later queued and run. Signed-off-by: Mike Christie --- drivers/vhost/scsi.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/drivers/vhost/scsi.c b/drivers/vhost/scsi.c index 93c6ad1246eb..33e3ff4c1f38 100644 --- a/drivers/vhost/scsi.c +++ b/drivers/vhost/scsi.c @@ -413,7 +413,13 @@ static void vhost_scsi_queue_tm_rsp(struct se_cmd *se_cmd) { struct vhost_scsi_tmf *tmf = container_of(se_cmd, struct vhost_scsi_tmf, se_cmd); - + /* + * LIO will complete the cmds this TMF has cleaned up, then call + * this function. If we have vqs that do not share a worker with the + * ctl vq, then those cmds/works could still be completing. Do a + * flush here to make sure when the tmf work runs the cmds are done. + */ + vhost_work_dev_flush(&tmf->vhost->dev); tmf->scsi_resp = se_cmd->se_tmr_req->response; transport_generic_free_cmd(&tmf->se_cmd, 0); }