From patchwork Wed Oct 14 11:31:13 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Klaus Jensen X-Patchwork-Id: 1382069 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; dmarc=none (p=none dis=none) header.from=irrelevant.dk 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=fm1 header.b=HI07IEOs; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.a=rsa-sha256 header.s=fm1 header.b=GqbEB55+; 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 4CB9Sf71JSz9sTq for ; Wed, 14 Oct 2020 22:40:02 +1100 (AEDT) Received: from localhost ([::1]:53854 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kSf8S-0007s9-IC for incoming@patchwork.ozlabs.org; Wed, 14 Oct 2020 07:40:00 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:45286) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kSf0J-0003D9-8z; Wed, 14 Oct 2020 07:31:35 -0400 Received: from new3-smtp.messagingengine.com ([66.111.4.229]:58859) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kSf0F-0006Xa-CQ; Wed, 14 Oct 2020 07:31:34 -0400 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailnew.nyi.internal (Postfix) with ESMTP id 39E70580193; Wed, 14 Oct 2020 07:31:27 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute4.internal (MEProxy); Wed, 14 Oct 2020 07:31:27 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=irrelevant.dk; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; s=fm1; bh=xTZsNFjgpCwwqiQUYVFLYF3O2V N86YpWSmHbCMp94u0=; b=HI07IEOshUHLrma9YlaOB1AY0VT7QTrpYpfBXMPGxI 3VM5f9f5OaxvTBVUkUKt98WttBddTBsv2xAA1K7VPHotSty5wmZgcQ6LdHoLvDFc Ckc7dP6XVcO22CCraZmDXRAlMTP9iSezFd2IcjTEUUZVaYTL9gbKwtYRUBugDhAb 47FJJyqd/FLV4v7U9Lz0SCGnTEyl4z4tU0R/ddliWuC2GqjJRqOo3r2bl5iFrSz1 yUH+MTj/VeR+qVgPoCDfS0YrmCupKHLyxSb/bzUkJaAZp+y3OLgbjW2ZfCQ07f2W l1T1HYrlNBhyUvR5UCqsbCIQgtvvYElqi86OGUK90C+w== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :message-id:mime-version:subject:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; bh=xTZsNFjgpCwwqiQUY VFLYF3O2VN86YpWSmHbCMp94u0=; b=GqbEB55+VRqrmU727h4r5dJ0WJMS654gs +j+viygTKZfKOTX1IJQgtHtw/T5cVUv51LeS1u3I68XRLSK30bzQfa1kESfq1HxJ Vt98xsWyVd9lx/hQWH+gpTfdv60EPleuQH9U71KCU3HMtX7ls+qfBJlRybJ22VP3 jR6jbe+f1XAeScMOZ56R4Y6NpiBCvvGikvnLCndanMrUJhjQN7tMesW3GvlT5BBf taQZ2sFRU7GAhPg6PKL3PJ/Q4HFGzGgpoek9/s2r3mQLbSfhSw7/NR+iq3XDZU6z pa21K18G/R406C6HiHPCVpnVQcdS+lLU/+K+wVHmgx+PUCD35RPTA== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedujedriedugdegudcutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhvffufffkofgggfestdhqredtredttdenucfhrhhomhepmfhlrghushculfgv nhhsvghnuceoihhtshesihhrrhgvlhgvvhgrnhhtrdgukheqnecuggftrfgrthhtvghrnh epuedvgeeuhefghfdvffffudevgeeigfdtgefhffdtieeiudehkeefleetvdeikeeunecu kfhppeektddrudeijedrleekrdduledtnecuvehluhhsthgvrhfuihiivgeptdenucfrrg hrrghmpehmrghilhhfrhhomhepihhtshesihhrrhgvlhgvvhgrnhhtrdgukh X-ME-Proxy: Received: from apples.local (80-167-98-190-cable.dk.customer.tdc.net [80.167.98.190]) by mail.messagingengine.com (Postfix) with ESMTPA id 2114F3064610; Wed, 14 Oct 2020 07:31:24 -0400 (EDT) From: Klaus Jensen To: qemu-devel@nongnu.org Subject: [PATCH v3 0/9] hw/block/nvme: zoned namespace command set Date: Wed, 14 Oct 2020 13:31:13 +0200 Message-Id: <20201014113122.388849-1-its@irrelevant.dk> X-Mailer: git-send-email 2.28.0 MIME-Version: 1.0 Received-SPF: pass client-ip=66.111.4.229; envelope-from=its@irrelevant.dk; helo=new3-smtp.messagingengine.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/10/14 07:31:27 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] 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_H4=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 , 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 Updated version of my proposal. Based-on: <20201014084324.333774-1-its@irrelevant.dk> Changes for v3 ~~~~~~~~~~~~~~ * Rebased on nvme-next with "[PATCH v2] hw/block/nvme: add dulbe support" applied. * "hw/block/nvme: add support for dulbe and block utilization tracking" - Dropped from this series. This series instead builds on the support for DULBE that I added in "[PATCH v2] hw/block/nvme: add dulbe support", previously posted. * "hw/block/nvme: add the zone management send command" - Use asynchronous discards. * "hw/block/nvme: add basic read/write for zoned namespaces" * "hw/block/nvme: add the zone management receive command" * "hw/block/nvme: add the zone management send command" * "hw/block/nvme: add the zone append command" * "hw/block/nvme: track and enforce zone resources" * "hw/block/nvme: allow open to close zone transitions by controller" - In compliance with the concensus I dropped zone persistence support from all patches. Changes for v2 ~~~~~~~~~~~~~~ * "hw/block/nvme: add support for dulbe and block utilization tracking" - Factor out pstate init/load into separate functions. - Fixed a stupid off-by-1 bug that would trigger when resetting the last zone. - I added a more formalized pstate file format that includes a header. This is pretty similar to what is done in Dmitry's series, but with fewer fields. The device parameters for nvme-ns are still the "authoritative" ones, so if any parameters that influence LBA size, number of zones, etc. do not match, an error indicating the discrepancy will be produced. IIRC, Dmitry's version does the same. It is set up such that newer versions can load pstate files from older versions. The file format header is not unlike a standard nvme datastructure with reserved areas. This means that when adding new command sets that require persistent state, it is not needed to bump the version number, unless the header has to change dramatically. This is demonstrated when the zoned namespace command set support is added in "hw/block/nvme: add basic read/write for zoned namespaces". * "hw/block/nvme: add basic read/write for zoned namespaces" - The device will now transition all opened zones to Closed on "normal shutdown". You can force the "transition to Full" behavior by killing QEMU from the monitor. * "hw/block/nvme: add the zone append command" - Slightly reordered the logic so a LBA Out of Range error is returned before Invalid Field in Command for normal read/write commands. * "hw/block/nvme: support zone active excursions" - Dropped. Optional and non-critical. * "hw/block/nvme: support reset/finish recommended limits" - Dropped. Optional and non-critical. Gollu Appalanaidu (1): hw/block/nvme: add commands supported and effects log page Klaus Jensen (8): hw/block/nvme: add uuid namespace parameter hw/block/nvme: support namespace types hw/block/nvme: add basic read/write for zoned namespaces hw/block/nvme: add the zone management receive command hw/block/nvme: add the zone management send command hw/block/nvme: add the zone append command hw/block/nvme: track and enforce zone resources hw/block/nvme: allow open to close zone transitions by controller docs/specs/nvme.txt | 17 + hw/block/nvme-ns.h | 112 +++- hw/block/nvme.h | 23 + include/block/nvme.h | 216 ++++++- block/nvme.c | 4 +- hw/block/nvme-ns.c | 172 +++++- hw/block/nvme.c | 1284 +++++++++++++++++++++++++++++++++++++++-- hw/block/trace-events | 27 +- 8 files changed, 1791 insertions(+), 64 deletions(-)