From patchwork Thu Jun 17 19:06:46 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Klaus Jensen X-Patchwork-Id: 1493867 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=irrelevant.dk header.i=@irrelevant.dk header.a=rsa-sha256 header.s=fm3 header.b=UNrG/x9d; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.a=rsa-sha256 header.s=fm3 header.b=S3lbNIcl; dkim-atps=neutral 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 ozlabs.org (Postfix) with ESMTPS id 4G5Wn15xtVz9sRf for ; Fri, 18 Jun 2021 05:08:53 +1000 (AEST) Received: from localhost ([::1]:37510 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ltxNj-0002wI-CK for incoming@patchwork.ozlabs.org; Thu, 17 Jun 2021 15:08:51 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:56240) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ltxM0-0002NH-VN; Thu, 17 Jun 2021 15:07:04 -0400 Received: from out1-smtp.messagingengine.com ([66.111.4.25]:59981) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ltxLy-0002sj-TU; Thu, 17 Jun 2021 15:07:04 -0400 Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id D051A5C0106; Thu, 17 Jun 2021 15:07:00 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute5.internal (MEProxy); Thu, 17 Jun 2021 15:07:00 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=irrelevant.dk; h=from:to:cc:subject:date:message-id:content-type:mime-version :content-transfer-encoding; s=fm3; bh=x6jKfFPi8R6Rni6Gp6+YUawa8M uY0GzKy4cL/XsTPjo=; b=UNrG/x9dKV19m27ue32ZZnozjinGEbPhVtfCGW1lDS hsEm3p/FZZkZMv8+dZzIEd/xsa9YubJ995kYbdDXSOexg50FjZefV+nci3NgsDQR UH1AZCK4QRPNa9vx+m3mDSMGsEFsPsnvkMRHOZjTLUaGOix0aQZBU2xEq6ZM1syI QLKz8iVdcry+dbpZIRC+b2vEKnrJ1r/M4vRM6gaSOAdC4rqGI084imYpW6q2srx6 mkkrcxFrtEqGb6av5pyNIYodcrNc4VEYa9ns+sf1YYg7fGtfa+TCsT1mFNpL915g 7MI/LOHXGHjdkPN8eUGScu5TztaI0uP24cwr55U/2Fng== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:message-id:mime-version:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm3; bh=x6jKfF Pi8R6Rni6Gp6+YUawa8MuY0GzKy4cL/XsTPjo=; b=S3lbNIcl52UEZG7UnUkgli 5vsa61dBLIfDBVMpJL4wIXoK53DwE341v7QwLHb90SDrrgfUce3Rv+7p9u8Xdj4h HR+HH5znuYi/+M0c10bJwW1Zg3G+USVa14MRtj4ROAFoKNkuf/FJ3hilBU25GVOt Y27VrKxzfx6O9/so4gFga58GYzrrLloo+8zCyxe1CJoebgHZ9ZlbLIdCvrUV+K79 Ij/AULFGk7Ojh/6w83uVRBvOETqiZXpKVXRtN7+Cg9Th1f5w0PRhvxGip7P6nHf3 bpS6LAeasFXDAJAnryyJxwTmGSUg/7pqMQbWZA5uLSkx/fyDtx6CUx8coH8bHg+w == X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrfeefuddgudefudcutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpefhvffufffkofgtggfgsehtqhertdertdejnecuhfhrohhmpefmlhgruhhs ucflvghnshgvnhcuoehithhssehirhhrvghlvghvrghnthdrughkqeenucggtffrrghtth gvrhhnpefhgeevkeeigfekvedvteejjeekkedugfdvheeijeffgfekffdvveelffetvdeg hfenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehith hssehirhhrvghlvghvrghnthdrughk X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 17 Jun 2021 15:06:58 -0400 (EDT) From: Klaus Jensen To: qemu-devel@nongnu.org Subject: [PATCH v2 00/11] hw/nvme: reimplement all multi-aio commands with custom aiocbs Date: Thu, 17 Jun 2021 21:06:46 +0200 Message-Id: <20210617190657.110823-1-its@irrelevant.dk> X-Mailer: git-send-email 2.32.0 MIME-Version: 1.0 Received-SPF: pass client-ip=66.111.4.25; envelope-from=its@irrelevant.dk; helo=out1-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, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, 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 , Vladimir Sementsov-Ogievskiy , qemu-block@nongnu.org, Klaus Jensen , Max Reitz , Keith Busch , Stefan Hajnoczi , Klaus Jensen Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Klaus Jensen This series reimplements flush, dsm, copy, zone reset and format nvm to allow cancellation. I posted an RFC back in March ("hw/block/nvme: convert ad-hoc aio tracking to aiocb") and I've applied some feedback from Stefan and reimplemented the remaining commands. The basic idea is to define custom AIOCBs for these commands. The custom AIOCB takes care of issuing all the "nested" AIOs one by one instead of blindly sending them off simultaneously without tracking the returned aiocbs. v2: - dropped RFC - fixed flush cancel from being unintentially a noop (Vladimir) Klaus Jensen (11): hw/nvme: reimplement flush to allow cancellation hw/nvme: add nvme_block_status_all helper hw/nvme: reimplement dsm to allow cancellation hw/nvme: save reftag when generating pi hw/nvme: remove assert from nvme_get_zone_by_slba hw/nvme: use prinfo directly in nvme_check_prinfo and nvme_dif_check hw/nvme: add dw0/1 to the req completion trace event hw/nvme: reimplement the copy command to allow aio cancellation hw/nvme: reimplement zone reset to allow cancellation hw/nvme: reimplement format nvm to allow cancellation Partially revert "hw/block/nvme: drain namespaces on sq deletion" hw/nvme/nvme.h | 10 +- include/block/nvme.h | 8 + hw/nvme/ctrl.c | 1883 ++++++++++++++++++++++++------------------ hw/nvme/dif.c | 64 +- hw/nvme/trace-events | 21 +- 5 files changed, 1124 insertions(+), 862 deletions(-) Reviewed-by: Keith Busch