From mboxrd@z Thu Jan 1 00:00:00 1970 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 lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 8FCA9C433F5 for ; Tue, 7 Dec 2021 13:25:33 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.241100.417958 (Exim 4.92) (envelope-from ) id 1muaTF-0005ow-Ji; Tue, 07 Dec 2021 13:25:25 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 241100.417958; Tue, 07 Dec 2021 13:25:25 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1muaTF-0005lZ-Dt; Tue, 07 Dec 2021 13:25:25 +0000 Received: by outflank-mailman (input) for mailman id 241100; Tue, 07 Dec 2021 13:25:24 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1muaTE-0005E4-De for xen-devel@lists.xenproject.org; Tue, 07 Dec 2021 13:25:24 +0000 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 219b590d-5761-11ec-9d12-4777fae47e2b; Tue, 07 Dec 2021 14:25:23 +0100 (CET) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-580-DM0wwHUtMdKzxeYJFKTcpA-1; Tue, 07 Dec 2021 08:25:19 -0500 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 1414A94DC1; Tue, 7 Dec 2021 13:25:18 +0000 (UTC) Received: from localhost (unknown [10.39.194.90]) by smtp.corp.redhat.com (Postfix) with ESMTP id A37FF5DF2B; Tue, 7 Dec 2021 13:25:17 +0000 (UTC) X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 219b590d-5761-11ec-9d12-4777fae47e2b DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1638883522; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=/qrMGrCx4V1veFpfg1+YpXhPcgKpzBIeI/WEMjnuXFg=; b=QGACm8MVzmylj/KsiehQj6G5b9hc4UesX43BzaIR2TbYdOpDvFGTo3hMlC/+jKo5dcTSzR RHLY4TbUos8ICycm9W75F4EwCbDnAJryUvaMltfQFKtHS6EihLWxUhSlpLhqICPdNWaaCx o+MkX4x7zganFW17RxE7Xvt+4mTK7Eo= X-MC-Unique: DM0wwHUtMdKzxeYJFKTcpA-1 From: Stefan Hajnoczi To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , "Dr. David Alan Gilbert" , Julia Suvorova , "Michael S. Tsirkin" , Paolo Bonzini , Juan Quintela , xen-devel@lists.xenproject.org, Aarushi Mehta , Stefan Weil , Stefano Stabellini , Coiby Xu , "Richard W.M. Jones" , Stefano Garzarella , Kevin Wolf , Anthony Perard , Stefan Hajnoczi , Hanna Reitz , qemu-block@nongnu.org, Fam Zheng , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Paul Durrant , Ronnie Sahlberg , Peter Lieven Subject: [PATCH v3 4/6] virtio-scsi: prepare virtio_scsi_handle_cmd for dataplane Date: Tue, 7 Dec 2021 13:23:34 +0000 Message-Id: <20211207132336.36627-5-stefanha@redhat.com> In-Reply-To: <20211207132336.36627-1-stefanha@redhat.com> References: <20211207132336.36627-1-stefanha@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=stefanha@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII" Prepare virtio_scsi_handle_cmd() to be used by both dataplane and non-dataplane by making the condition for starting ioeventfd more specific. This way it won't trigger when dataplane has already been started. Signed-off-by: Stefan Hajnoczi --- hw/scsi/virtio-scsi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/scsi/virtio-scsi.c b/hw/scsi/virtio-scsi.c index 51fd09522a..34a968ecfb 100644 --- a/hw/scsi/virtio-scsi.c +++ b/hw/scsi/virtio-scsi.c @@ -720,7 +720,7 @@ static void virtio_scsi_handle_cmd(VirtIODevice *vdev, VirtQueue *vq) /* use non-QOM casts in the data path */ VirtIOSCSI *s = (VirtIOSCSI *)vdev; - if (s->ctx) { + if (s->ctx && !s->dataplane_started) { virtio_device_start_ioeventfd(vdev); if (!s->dataplane_fenced) { return; -- 2.33.1 From mboxrd@z Thu Jan 1 00:00:00 1970 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 lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 7BE31C433F5 for ; Tue, 7 Dec 2021 13:28:54 +0000 (UTC) Received: from localhost ([::1]:52114 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1muaWb-0005bl-EX for qemu-devel@archiver.kernel.org; Tue, 07 Dec 2021 08:28:53 -0500 Received: from eggs.gnu.org ([209.51.188.92]:54908) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1muaTI-000288-Ii for qemu-devel@nongnu.org; Tue, 07 Dec 2021 08:25:28 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:41857) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1muaTG-0006Er-9p for qemu-devel@nongnu.org; Tue, 07 Dec 2021 08:25:27 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1638883522; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=/qrMGrCx4V1veFpfg1+YpXhPcgKpzBIeI/WEMjnuXFg=; b=QGACm8MVzmylj/KsiehQj6G5b9hc4UesX43BzaIR2TbYdOpDvFGTo3hMlC/+jKo5dcTSzR RHLY4TbUos8ICycm9W75F4EwCbDnAJryUvaMltfQFKtHS6EihLWxUhSlpLhqICPdNWaaCx o+MkX4x7zganFW17RxE7Xvt+4mTK7Eo= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-580-DM0wwHUtMdKzxeYJFKTcpA-1; Tue, 07 Dec 2021 08:25:19 -0500 X-MC-Unique: DM0wwHUtMdKzxeYJFKTcpA-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 1414A94DC1; Tue, 7 Dec 2021 13:25:18 +0000 (UTC) Received: from localhost (unknown [10.39.194.90]) by smtp.corp.redhat.com (Postfix) with ESMTP id A37FF5DF2B; Tue, 7 Dec 2021 13:25:17 +0000 (UTC) From: Stefan Hajnoczi To: qemu-devel@nongnu.org Subject: [PATCH v3 4/6] virtio-scsi: prepare virtio_scsi_handle_cmd for dataplane Date: Tue, 7 Dec 2021 13:23:34 +0000 Message-Id: <20211207132336.36627-5-stefanha@redhat.com> In-Reply-To: <20211207132336.36627-1-stefanha@redhat.com> References: <20211207132336.36627-1-stefanha@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=stefanha@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII" Received-SPF: pass client-ip=170.10.133.124; envelope-from=stefanha@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -33 X-Spam_score: -3.4 X-Spam_bar: --- X-Spam_report: (-3.4 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.619, 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_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 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: , Cc: Fam Zheng , Stefan Hajnoczi , "Michael S. Tsirkin" , Stefano Stabellini , qemu-block@nongnu.org, Juan Quintela , Paul Durrant , Anthony Perard , xen-devel@lists.xenproject.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Stefano Garzarella , Peter Lieven , Stefan Weil , Julia Suvorova , "Dr. David Alan Gilbert" , Ronnie Sahlberg , Aarushi Mehta , Kevin Wolf , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , "Richard W.M. Jones" , Coiby Xu , Hanna Reitz , Paolo Bonzini Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" Prepare virtio_scsi_handle_cmd() to be used by both dataplane and non-dataplane by making the condition for starting ioeventfd more specific. This way it won't trigger when dataplane has already been started. Signed-off-by: Stefan Hajnoczi --- hw/scsi/virtio-scsi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/scsi/virtio-scsi.c b/hw/scsi/virtio-scsi.c index 51fd09522a..34a968ecfb 100644 --- a/hw/scsi/virtio-scsi.c +++ b/hw/scsi/virtio-scsi.c @@ -720,7 +720,7 @@ static void virtio_scsi_handle_cmd(VirtIODevice *vdev, VirtQueue *vq) /* use non-QOM casts in the data path */ VirtIOSCSI *s = (VirtIOSCSI *)vdev; - if (s->ctx) { + if (s->ctx && !s->dataplane_started) { virtio_device_start_ioeventfd(vdev); if (!s->dataplane_fenced) { return; -- 2.33.1