From nobody Mon Feb 9 23:59:53 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1624995156420711.0847998693223; Tue, 29 Jun 2021 12:32:36 -0700 (PDT) Received: from localhost ([::1]:57320 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lyJTH-0005q7-5n for importer@patchew.org; Tue, 29 Jun 2021 15:32:35 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:36928) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lyInM-00021D-Vt; Tue, 29 Jun 2021 14:49:17 -0400 Received: from wnew1-smtp.messagingengine.com ([64.147.123.26]:53127) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lyInL-0005ig-2F; Tue, 29 Jun 2021 14:49:16 -0400 Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailnew.west.internal (Postfix) with ESMTP id 743FC2B00ABA; Tue, 29 Jun 2021 14:48:52 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute5.internal (MEProxy); Tue, 29 Jun 2021 14:48:53 -0400 Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 29 Jun 2021 14:48:50 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=irrelevant.dk; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=fm3; bh=30X0CChJBg/L0 ALQpDBGEB/9qT5H4XVa9GL2we+/oYQ=; b=id96I5Mx0Yoc+dLvmwdS6Yuf6rh5e DwmNiSZWUuRRiGmgyGm1YYGm+XTiaRw/4WVnzAPH2vMxLXjc4iYjhjdvjg8sPari QSi1sp/U9OQGl+R+uD07NgokP8KBD2FAIeJHZmaRIw0DW/rrOjfL2INQEawZktyz Y1mzjHg8+quCbTYKq33r6SHl2nfshVWVMxVdjGY89lQAndI5KW6KNpvaVBBWWP1g aUNG39hk82kP5H/L8wHoq9g/kg9Y4mDUqajzRa38VxLRek8GyRLA7JtGLsj8YNVn bHFrbBzATzg8HrBIw6xcfLnDvAQkauMRhhbxIskUImY9n+/nVtUrJHOJA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :in-reply-to:message-id:mime-version:references:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm3; bh=30X0CChJBg/L0ALQpDBGEB/9qT5H4XVa9GL2we+/oYQ=; b=NBVI3+XX k/+Fa+Y50VqGeEZlgcttHg2DPnFgGAGVRPyveB8BaKXMoMz4Sm80PrQENQ6u6oJa KARJmQdkA40RG5Ectj6KycMAc8J+5BGhYq9vdjr9ue8niRNStO1AvEGFIKL2Qlxp 4DlVUftEfminHaoWGg+4Vg5Te1WW7M9taDteHjNAUHNovaavhuMidb6WqtMrHdLL 1T+5RD+ie4IbOZy2HKsxlQnNL/mmOxDB7guXXwP7L5/3DoqtIZ5UdTZjaQmoqg/2 I+GPEqcd3J/C14eXgq9r/ThAvBI5Mvqn4vnus8fnVpybnuT3Qc7jUO0JO7227Fn3 7bWCVO21+7fwCA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrfeeitddgleegucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpefmlhgruhhs ucflvghnshgvnhcuoehithhssehirhhrvghlvghvrghnthdrughkqeenucggtffrrghtth gvrhhnpeeuleetgeeiuefhgfekfefgveejiefgteekiedtgfdtieefhfdthfefueffvefg keenucevlhhushhtvghrufhiiigvpedunecurfgrrhgrmhepmhgrihhlfhhrohhmpehith hssehirhhrvghlvghvrghnthdrughk X-ME-Proxy: From: Klaus Jensen To: Peter Maydell , qemu-devel@nongnu.org Subject: [PULL 18/23] Partially revert "hw/block/nvme: drain namespaces on sq deletion" Date: Tue, 29 Jun 2021 20:47:38 +0200 Message-Id: <20210629184743.230173-19-its@irrelevant.dk> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210629184743.230173-1-its@irrelevant.dk> References: <20210629184743.230173-1-its@irrelevant.dk> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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=64.147.123.26; envelope-from=its@irrelevant.dk; helo=wnew1-smtp.messagingengine.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, SPF_HELO_PASS=-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.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Fam Zheng , Kevin Wolf , Eduardo Habkost , qemu-block@nongnu.org, Klaus Jensen , Max Reitz , Keith Busch , Stefan Hajnoczi , Klaus Jensen Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" From: Klaus Jensen This partially reverts commit 98f84f5a4eca5c03e32fff20f246d9b4b96d6422. Since all "multi aio" commands are now reimplemented to properly track the nested aiocbs, we can revert the "hack" that was introduced to make sure all requests we're properly drained upon sq deletion. The revert is partial since we keep the assert that no outstanding requests remain on the submission queue after the explicit cancellation. Signed-off-by: Klaus Jensen Reviewed-by: Keith Busch --- hw/nvme/ctrl.c | 19 ++----------------- 1 file changed, 2 insertions(+), 17 deletions(-) diff --git a/hw/nvme/ctrl.c b/hw/nvme/ctrl.c index 3b8c542db6e7..6a0c2cc48422 100644 --- a/hw/nvme/ctrl.c +++ b/hw/nvme/ctrl.c @@ -3918,7 +3918,6 @@ static uint16_t nvme_del_sq(NvmeCtrl *n, NvmeRequest = *req) NvmeSQueue *sq; NvmeCQueue *cq; uint16_t qid =3D le16_to_cpu(c->qid); - uint32_t nsid; =20 if (unlikely(!qid || nvme_check_sqid(n, qid))) { trace_pci_nvme_err_invalid_del_sq(qid); @@ -3930,22 +3929,8 @@ static uint16_t nvme_del_sq(NvmeCtrl *n, NvmeRequest= *req) sq =3D n->sq[qid]; while (!QTAILQ_EMPTY(&sq->out_req_list)) { r =3D QTAILQ_FIRST(&sq->out_req_list); - if (r->aiocb) { - blk_aio_cancel(r->aiocb); - } - } - - /* - * Drain all namespaces if there are still outstanding requests that we - * could not cancel explicitly. - */ - if (!QTAILQ_EMPTY(&sq->out_req_list)) { - for (nsid =3D 1; nsid <=3D NVME_MAX_NAMESPACES; nsid++) { - NvmeNamespace *ns =3D nvme_ns(n, nsid); - if (ns) { - nvme_ns_drain(ns); - } - } + assert(r->aiocb); + blk_aio_cancel(r->aiocb); } =20 assert(QTAILQ_EMPTY(&sq->out_req_list)); --=20 2.32.0