From patchwork Thu Dec 2 15:34:00 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Hajnoczi X-Patchwork-Id: 12652867 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 3FA5FC433F5 for ; Thu, 2 Dec 2021 15:38:50 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.236807.410704 (Exim 4.92) (envelope-from ) id 1msoAT-0006vJ-VE; Thu, 02 Dec 2021 15:38:41 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 236807.410704; Thu, 02 Dec 2021 15:38:41 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1msoAT-0006vC-SD; Thu, 02 Dec 2021 15:38:41 +0000 Received: by outflank-mailman (input) for mailman id 236807; Thu, 02 Dec 2021 15:38:40 +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 1msoAS-000685-Pj for xen-devel@lists.xenproject.org; Thu, 02 Dec 2021 15:38:40 +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 ebb6b4e1-5385-11ec-976b-d102b41d0961; Thu, 02 Dec 2021 16:38:40 +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-340-v-fp4XIFPvO3LGCSu00CSQ-1; Thu, 02 Dec 2021 10:38:35 -0500 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id D88BF93925; Thu, 2 Dec 2021 15:38:33 +0000 (UTC) Received: from localhost (unknown [10.39.193.31]) by smtp.corp.redhat.com (Postfix) with ESMTP id D38A979455; Thu, 2 Dec 2021 15:37:37 +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: ebb6b4e1-5385-11ec-976b-d102b41d0961 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1638459519; 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=FDwyxBtPlrOt4YJ56QWFm+M9E4AprTCL8eBxoe7PehqkeHwbKaTLYtdUZiPGbmU0vQ75rs NiBbKYNTWUCzc8gMilQtJKxh4qFMjX+Bfp9M5AC/YslSo3QSP99n7XRMeEHKdlQhAnMcUK RRanPjeCdwzdFGYgBmRc6l1zsllNno4= X-MC-Unique: v-fp4XIFPvO3LGCSu00CSQ-1 From: Stefan Hajnoczi To: qemu-devel@nongnu.org Cc: Hanna Reitz , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Stefan Hajnoczi , Kevin Wolf , "Richard W.M. Jones" , Stefano Garzarella , Paolo Bonzini , Aarushi Mehta , Ronnie Sahlberg , "Michael S. Tsirkin" , Julia Suvorova , Juan Quintela , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Anthony Perard , Paul Durrant , Coiby Xu , qemu-block@nongnu.org, "Dr. David Alan Gilbert" , xen-devel@lists.xenproject.org, Stefan Weil , Fam Zheng , Stefano Stabellini , Peter Lieven Subject: [PATCH v2 4/6] virtio-scsi: prepare virtio_scsi_handle_cmd for dataplane Date: Thu, 2 Dec 2021 15:34:00 +0000 Message-Id: <20211202153402.604951-5-stefanha@redhat.com> In-Reply-To: <20211202153402.604951-1-stefanha@redhat.com> References: <20211202153402.604951-1-stefanha@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 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 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;