From patchwork Fri Jul 5 07:23:17 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Klaus Jensen X-Patchwork-Id: 11032085 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 5F6B21510 for ; Fri, 5 Jul 2019 07:25:52 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4428B2892A for ; Fri, 5 Jul 2019 07:25:52 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 36AD628947; Fri, 5 Jul 2019 07:25:52 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 944D72892A for ; Fri, 5 Jul 2019 07:25:51 +0000 (UTC) Received: from localhost ([::1]:50096 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hjIbN-0007xj-FB for patchwork-qemu-devel@patchwork.kernel.org; Fri, 05 Jul 2019 03:25:49 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:44100) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hjIZZ-0005HB-MI for qemu-devel@nongnu.org; Fri, 05 Jul 2019 03:24:01 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hjIZY-0005kJ-3j for qemu-devel@nongnu.org; Fri, 05 Jul 2019 03:23:57 -0400 Received: from charlie.dont.surf ([128.199.63.193]:50492) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hjIZV-0005fg-2h; Fri, 05 Jul 2019 03:23:53 -0400 Received: from localhost.localdomain (ip-5-186-120-196.cgn.fibianet.dk [5.186.120.196]) by charlie.dont.surf (Postfix) with ESMTPSA id 18B1ABF607; Fri, 5 Jul 2019 07:23:49 +0000 (UTC) From: Klaus Birkelund Jensen To: qemu-block@nongnu.org Date: Fri, 5 Jul 2019 09:23:17 +0200 Message-Id: <20190705072333.17171-1-klaus@birkelund.eu> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 128.199.63.193 Subject: [Qemu-devel] [PATCH 00/16] nvme: support NVMe v1.3d, SGLs and multiple namespaces 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: kwolf@redhat.com, matt.fitzpatrick@oakgatetech.com, qemu-devel@nongnu.org, armbru@redhat.com, keith.busch@intel.com, mreitz@redhat.com, lersek@redhat.com Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP Matt Fitzpatrick's post ("[RFC,v1] Namespace Management Support") pushed me to finally get my head out of my a** and post this series. This is basically a follow-up to my previous series ("nvme: v1.3, sgls, metadata and new 'ocssd' device"), but I'm not tagging it as a v2 because the patches for metadata and the ocssd device have been dropped. Instead, this series also includes a patch that enables support for multiple namespaces in a "proper" way by adding a new 'nvme-ns' device model such that the "real" nvme device is composed of the 'nvme' device model (the core controller) and multiple 'nvme-ns' devices that model the namespaces. All in all, the patches in this series should be less controversial, but I know there is a lot to go through. I've kept commit 011de3d531b6 ("nvme: refactor device realization") as a single commit, but I can chop it up if any reviwers would prefer that, but the series is already at 16 patches. The refactor patch is basically just code movement. At a glance, this series: - generally fixes up the device to be as close to NVMe 1.3d compliant as possible (in terms of 'mandatory' features) by: - adding proper setting of the SUBNQN and VER fields - supporting the Abort command - supporting the Asynchronous Event Request command - supporting the Get Log Page command - providing reasonable stub responses to Get/Set Feature command of mandatory features - adds support for scatter gather lists (SGLs) - simplifies DMA/CMB mappings and support PRPs/SGLs in the CMB - adds support for multiple block requests per nvme request (this is useful for future support for metadata, OCSSD 2.0 vector requests and upcoming zoned namespaces) - adds support for multiple namespaces Thanks to everyone who chipped in on the discussion on multiple namespaces! You're CC'ed ;) Klaus Birkelund Jensen (16): nvme: simplify namespace code nvme: move device parameters to separate struct nvme: fix lpa field nvme: add missing fields in identify controller nvme: populate the mandatory subnqn and ver fields nvme: support completion queue in cmb nvme: support Abort command nvme: refactor device realization nvme: support Asynchronous Event Request command nvme: support Get Log Page command nvme: add missing mandatory Features nvme: bump supported NVMe revision to 1.3d nvme: simplify dma/cmb mappings nvme: support multiple block requests per request nvme: support scatter gather lists nvme: support multiple namespaces block/nvme.c | 18 +- hw/block/Makefile.objs | 2 +- hw/block/nvme-ns.c | 139 ++++ hw/block/nvme-ns.h | 35 + hw/block/nvme.c | 1629 ++++++++++++++++++++++++++++++++-------- hw/block/nvme.h | 99 ++- hw/block/trace-events | 24 +- include/block/nvme.h | 130 +++- 8 files changed, 1739 insertions(+), 337 deletions(-) create mode 100644 hw/block/nvme-ns.c create mode 100644 hw/block/nvme-ns.h