From nobody Thu Mar 28 12:32:37 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of seabios.org designates 78.46.105.101 as permitted sender) client-ip=78.46.105.101; envelope-from=seabios-bounces@seabios.org; helo=coreboot.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of seabios.org designates 78.46.105.101 as permitted sender) smtp.mailfrom=seabios-bounces@seabios.org Return-Path: Received: from coreboot.org (coreboot.org [78.46.105.101]) by mx.zohomail.com with SMTPS id 1630412650236331.0528319643479; Tue, 31 Aug 2021 05:24:10 -0700 (PDT) Received: from authenticated-user (PRIMARY_HOSTNAME [PUBLIC_IP]) by coreboot.org (Postfix) with ESMTPA id 44B3510619D9; Tue, 31 Aug 2021 12:24:06 +0000 (UTC) Received: from authenticated-user (PRIMARY_HOSTNAME [PUBLIC_IP]) by coreboot.org (Postfix) with ESMTP id 6D55710619BF for ; Tue, 31 Aug 2021 12:23:54 +0000 (UTC) Received: from authenticated-user (PRIMARY_HOSTNAME [PUBLIC_IP]) for ; Tue, 31 Aug 2021 05:23:54 -0700 (PDT) Received: from authenticated-user (PRIMARY_HOSTNAME [PUBLIC_IP]) by smtp.gmail.com with ESMTPSA id c21sm12682229pfd.200.2021.08.31.05.23.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 31 Aug 2021 05:23:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=smartx-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=tVzihhC5lQDzHI2Q7USKVFhC97Y0TIC06x+dsP9DHlU=; b=BCkFuoHZLqs0axgcRL5EOKUPp1AR0aOBf2sMCkaZZ4WxpglNQYFvRU0GdEM2E6meds abMMhMArfzPxxynVArE3uGNsBJlIuvHVoHTrkHemE4lLD0A1ySDhg31ndHvMyzduq3TA cmTG+wucKo6PeXs5eMzdSfcQ+DNpNOt3gyy6hWRAAtwTjgRfqfv3DEXt8qceTIlE2wsF EJw3o33bl/NGJSxrYk6pyIrpc+fre+HRPRDQoRbkE6O+izms0IhTRAeW1m4n/g97XCJP 5EnAOsYh/58IdzKCwwm4CC1mCzJ3zen+RPtyP6yo6ZBPPtwC+fnWGEgXVvTz1ji+A1O1 +Gkw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=tVzihhC5lQDzHI2Q7USKVFhC97Y0TIC06x+dsP9DHlU=; b=JK/PPMfbvEhRXUrfVHyKLY136G3/fl/EU7Ni06a7E/CE2kIdNtdRxLex1VEdWrHN7W 2QlcSahl+1cKqZiBVCERj9ADpCnoMEUB9BQ64kYIL5FyygtyhRAWuaHGngnV2b4DJEIa 2lyrErL0jYejIYKurf9dWnS7u/HNTgaPcvewapLoBVhlwMy5hOAN4YAhkN9b0hUIp7b+ u5G2mWFoJ8ghI5f2e83hGKhvGORfguscu0caTJ7/W2RdXpeQyaM2INMHLIaZBrCoSzhl xzz9RvTUlqjvh30reim/zo1Weok7x9nXalfEIdXKS4z41w7bhm7TN14CW7DkQFoy0w8K XAHA== X-Gm-Message-State: AOAM530nX7183IUEQ2BUtvBJErekFN1kiYCXbjxpnLtNoVkVCuSEJqTq 3xbz+T3bELzb/KmfJWsnIkv3yPqYaDzvq3IV+bo= X-Google-Smtp-Source: ABdhPJyF+NZsAJykEJDRiuWInD91bHadTW23sbpTX6QBoc8El1V+2m2076AzfYBNFCt4B1Iqgq9f1Q== X-Received: by 2002:a17:902:c412:b0:138:e681:fba4 with SMTP id k18-20020a170902c41200b00138e681fba4mr4477899plk.22.1630412632223; Tue, 31 Aug 2021 05:23:52 -0700 (PDT) From: Li Feng To: seabios@seabios.org Date: Tue, 31 Aug 2021 20:23:39 +0800 Message-Id: <20210831122339.2591585-1-fengli@smartx.com> In-Reply-To: <20210831104954.1496512-1-fengli@smartx.com> References: <20210831104954.1496512-1-fengli@smartx.com> MIME-Version: 1.0 Message-ID-Hash: QLCKJUSCQGB5P6SS3HZFWEQWNZCL4JDQ X-Message-ID-Hash: QLCKJUSCQGB5P6SS3HZFWEQWNZCL4JDQ X-MailFrom: fengli@smartx.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-seabios.seabios.org-0; header-match-seabios.seabios.org-1; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Li Feng X-Mailman-Version: 3.3.4 Precedence: list Subject: [SeaBIOS] [PATCH v2] virtio-scsi: initialize the ctrl and event vq List-Id: SeaBIOS mailing list Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Content-Transfer-Encoding: quoted-printable Authentication-Results: coreboot.org; auth=pass smtp.auth=mailman@coreboot.org smtp.mailfrom=seabios-bounces@seabios.org X-Spamd-Bar: ------ X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1630412651660100001 Content-Type: text/plain; charset="utf-8" Currently, virtio-scsi doesn't support any control or event message, this p= atch adds the basic initialization. Some backends need this feature, like dpdk/spdk vhost-user backend. Reproduce: 1. Start spdk vhost-user-scsi backend; 2. Create a vm with a SCSI vhost-user-scsi disk and start the vm; 3. Mount an iso to the vm without an OS; 3. Stop the vhost-user-scsi backend; 5. Vhost-user-scsi backend will crash before exiting when cleaning the reso= urces. The reason is that the seabios virtio-scsi only initializes the req vq, then the spdk/dpdk treats it a not good session, it's hard to handle this t= ricky issue from dpdk architecture. Signed-off-by: Li Feng --- src/hw/virtio-scsi.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/hw/virtio-scsi.c b/src/hw/virtio-scsi.c index 369c981..e16d4b0 100644 --- a/src/hw/virtio-scsi.c +++ b/src/hw/virtio-scsi.c @@ -203,8 +203,18 @@ init_virtio_scsi(void *data) } } =20 + if (vp_find_vq(vp, 0, &vq) < 0 ) { + dprintf(1, "fail to find ctrl vq for virtio-scsi %pP\n", pci); + goto fail; + } + + if (vp_find_vq(vp, 1, &vq) < 0 ) { + dprintf(1, "fail to find event vq for virtio-scsi %pP\n", pci); + goto fail; + } + if (vp_find_vq(vp, 2, &vq) < 0 ) { - dprintf(1, "fail to find vq for virtio-scsi %pP\n", pci); + dprintf(1, "fail to find req vq for virtio-scsi %pP\n", pci); goto fail; } =20 --=20 2.31.1 _______________________________________________ SeaBIOS mailing list -- seabios@seabios.org To unsubscribe send an email to seabios-leave@seabios.org