Skip to contentSkip to conversation

Support for Open-Channel SSDs

PATCH Superseded Matias Bjørling 2 participants 11 messages Jul 22, 2015 – Jul 25, 2015

Subsystems (4)

v5 of 6 Superseded Latest is v6 →

lore
Share & tools
lore
#0 lore raw

v5 cover Support for Open-Channel SSDs

These patches implement support for Open-Channel SSDs.

Applies against axboe's linux-block/for-4.3/drivers.

Any feedback is greatly appreciated.

Changes since v4:
- Remove gendisk->nvm dependency
- Remove device driver rq private field dependency.
- Update submission and completion. The flow is now

     Target -> Block Manager -> Device Driver, replacing callbacks in
     device driver.

- Abstracted out the block manager into its own module. Other block managers can now be implemented. For example to support fully host-based SSDs.
- No longer exposes the device driver gendisk to user-space.
- Management is moved into /sys/modules/lnvm/parameters/configure_debug

Changes since v3:

- Remove dependency on REQ_NVM_GC
- Refactor nvme integration to use nvme_submit_sync_cmd for internal commands.
- Fix race condition bug on multiple threads on RRPC target.
- Rename sysfs entry under the block device from nvm to lightnvm. The configuration is found in /sys/block/*/lightnvm/

Changes since v2:

Feedback from Paul Bolle:
- Fix license to GPLv2, documentation, compilation. Feedback from Keith Busch:
- nvme: Move lightnvm out and into nvme-lightnvm.c.
- nvme: Set controller css on lightnvm command set.
- nvme: Remove OACS.
Feedback from Christoph Hellwig:
- lightnvm: Move out of block layer into /drivers/lightnvm/core.c
- lightnvm: refactor request->phys_sector into device drivers.
- lightnvm: refactor prep/unprep into device drivers.
- lightnvm: move nvm_dev from request_queue to gendisk.

New
- Bad block table support (From Javier).
- Update maintainers file.

Changes since v1:

- Splitted LightNVM into two parts. A get/put interface for flash blocks and the respective targets that implement flash translation layer logic.
- Updated the patches according to the LightNVM specification changes.
- Added interface to add/remove targets for a block device.

Thanks to Jens Axboe, Christoph Hellwig, Keith Busch, Javier Gonzalez and Jesper Madsen for discussions and contributions.

Matias Bjørling (5):
lightnvm: Support for Open-Channel SSDs
rrpc: RRPC target
bm_hb: Hybrid Open-Channel SSD block manager
null_blk: LightNVM support
nvme: LightNVM support

 Documentation/block/null_blk.txt |    8 +
 MAINTAINERS                      |    8 +
 drivers/Kconfig                  |    2 +
 drivers/Makefile                 |    5 +
 drivers/block/Makefile           |    2 +-
 drivers/block/null_blk.c         |  138 ++++-
 drivers/block/nvme-core.c        |   22 +-
 drivers/block/nvme-lightnvm.c    |  504 ++++++++++++++++
 drivers/lightnvm/Kconfig         |   33 ++
 drivers/lightnvm/Makefile        |    7 +
 drivers/lightnvm/bm_hb.c         |  379 ++++++++++++
 drivers/lightnvm/bm_hb.h         |   31 +
 drivers/lightnvm/core.c          |  598 +++++++++++++++++++
 drivers/lightnvm/rrpc.c          | 1190 ++++++++++++++++++++++++++++++++++++++
 drivers/lightnvm/rrpc.h          |  220 +++++++
 include/linux/lightnvm.h         |  393 +++++++++++++
 include/linux/nvme.h             |    6 +
 include/uapi/linux/nvme.h        |    3 +
 18 files changed, 3539 insertions(+), 10 deletions(-)
 create mode 100644 drivers/block/nvme-lightnvm.c
 create mode 100644 drivers/lightnvm/Kconfig
 create mode 100644 drivers/lightnvm/Makefile
 create mode 100644 drivers/lightnvm/bm_hb.c
 create mode 100644 drivers/lightnvm/bm_hb.h
 create mode 100644 drivers/lightnvm/core.c
 create mode 100644 drivers/lightnvm/rrpc.c
 create mode 100644 drivers/lightnvm/rrpc.h
 create mode 100644 include/linux/lightnvm.h
Signature · 1 line
2.1.4
#1 lore raw

PATCH v5 1/5 lightnvm: Support for Open-Channel SSDs

Open-channel SSDs are devices that share responsibilities with the host in order to implement and maintain features that typical SSDs keep strictly in firmware. These include (i) the Flash Translation Layer (FTL), (ii) bad block management, and (iii) hardware units such as the flash controller, the interface controller, and large amounts of flash chips. In this way, Open-channels SSDs exposes direct access to their physical flash storage, while keeping a subset of the internal features of SSDs.

LightNVM is a specification that gives support to Open-channel SSDs LightNVM allows the host to manage data placement, garbage collection, and parallelism. Device specific responsibilities such as bad block management, FTL extensions to support atomic IOs, or metadata persistence are still handled by the device.

The implementation of LightNVM consists of two parts: core and (multiple) targets. The core implements functionality shared across targets. This is initialization, teardown and statistics. The targets implement the interface that exposes physical flash to user-space applications. Examples of such targets include key-value store, object-store, as well as traditional block devices, which can be application-specific.

Contributions in this patch from:

Javier Gonzalez <jg at lightnvm.io>
Jesper Madsen <jmad at itu.dk>

Signed-off-by Matias Bj?rling <mb at lightnvm.io>
---
 MAINTAINERS               |   8 +
 drivers/Kconfig           |   2 +
 drivers/Makefile          |   5 +
 drivers/lightnvm/Kconfig  |  16 ++
 drivers/lightnvm/Makefile |   5 +
 drivers/lightnvm/core.c   | 598 ++++++++++++++++++++++++++++++++++++++++++++++
 include/linux/lightnvm.h  | 393 ++++++++++++++++++++++++++++++
 7 files changed, 1027 insertions(+)
 create mode 100644 drivers/lightnvm/Kconfig
 create mode 100644 drivers/lightnvm/Makefile
 create mode 100644 drivers/lightnvm/core.c
 create mode 100644 include/linux/lightnvm.h
MAINTAINERS +8 -0
index 2d3d55c..d149104 100644
@@ -6162,6 +6162,14 @@ S:	Supported
 F:	drivers/nvdimm/pmem.c
 F:	include/linux/pmem.h
 
+LIGHTNVM PLATFORM SUPPORT
+M:	Matias Bjorling <mb at lightnvm.io>
+W:	http://github/OpenChannelSSD
+S:	Maintained
+F:	drivers/lightnvm/
+F:	include/linux/lightnvm.h
+F:	include/uapi/linux/lightnvm.h
+
 LINUX FOR IBM pSERIES (RS/6000)
 M:	Paul Mackerras <paulus at au.ibm.com>
 W:	http://www.ibm.com/linux/ltc/projects/ppc
drivers/Kconfig +2 -0
index 6e973b8..3992902 100644
@@ -42,6 +42,8 @@ source "drivers/net/Kconfig"
 
 source "drivers/isdn/Kconfig"
 
+source "drivers/lightnvm/Kconfig"
+
 # input before char - char/joystick depends on it. As does USB.
 
 source "drivers/input/Kconfig"
drivers/Makefile +5 -0
index b64b49f..75978ab 100644
@@ -63,6 +63,10 @@ obj-$(CONFIG_FB_I810)           += video/fbdev/i810/
 obj-$(CONFIG_FB_INTEL)          += video/fbdev/intelfb/
 
 obj-$(CONFIG_PARPORT)		+= parport/
+
+# lightnvm/ comes before block to initialize bm before usage
+obj-$(CONFIG_NVM)		+= lightnvm/
+
 obj-y				+= base/ block/ misc/ mfd/ nfc/
 obj-$(CONFIG_LIBNVDIMM)		+= nvdimm/
 obj-$(CONFIG_DMA_SHARED_BUFFER) += dma-buf/
@@ -165,3 +169,4 @@ obj-$(CONFIG_RAS)		+= ras/
 obj-$(CONFIG_THUNDERBOLT)	+= thunderbolt/
 obj-$(CONFIG_CORESIGHT)		+= hwtracing/coresight/
 obj-$(CONFIG_ANDROID)		+= android/
+
drivers/lightnvm/Kconfig new file +16 -0
new file mode 100644
index 0000000..1f8412c
@@ -0,0 +1,16 @@
+#
+# Open-Channel SSD NVM configuration
+#
+
+menuconfig NVM
+	bool "Open-Channel SSD target support"
+	depends on BLOCK
+	help
+	  Say Y here to get to enable Open-channel SSDs.
+
+	  Open-Channel SSDs implement a set of extension to SSDs, that
+	  exposes direct access to the underlying non-volatile memory.
+
+	  If you say N, all options in this submenu will be skipped and disabled
+	  only do this if you know what you are doing.
+
drivers/lightnvm/Makefile new file +5 -0
new file mode 100644
index 0000000..38185e9
@@ -0,0 +1,5 @@
+#
+# Makefile for Open-Channel SSDs.
+#
+
+obj-$(CONFIG_NVM)		:= core.o
drivers/lightnvm/core.c new file +598 -0

598 lines not on this page · raw message

include/linux/lightnvm.h new file +393 -0

393 lines not on this page · raw message

Signature · 1 line
2.1.4
#2 lore raw

Re: [PATCH v5 1/5] lightnvm: Support for Open-Channel SSDs

Hi Matias,

I like this new architecture.

Minor nitpicks below:

drivers/lightnvm/core.c line 2

Quoted 3 lines
drivers/lightnvm/core.c new file +2 -0
@@ -0,0 +1,598 @@
+/*
+ * core.c - Open-channel SSD integration core

No need to state the file name in the top of the file comments, it doesn't add value and get stale easily.

drivers/lightnvm/core.c line 36

Quoted 4 lines
drivers/lightnvm/core.c new file +4 -0
+static LIST_HEAD(_targets);
+static LIST_HEAD(_bms);
+static LIST_HEAD(_devices);
+static DECLARE_RWSEM(_lock);

Please add a nvm_ prefix to these.

Quoted 4 lines
drivers/lightnvm/core.c new file +4 -0
+static int nvm_ioctl(struct block_device *bdev, fmode_t mode, unsigned int cmd,
+							unsigned long arg)
+{
+	return 0;

drivers/lightnvm/core.c line 305

Quoted 10 lines
drivers/lightnvm/core.c new file +10 -0
+}
+
+static int nvm_open(struct block_device *bdev, fmode_t mode)
+{
+	return 0;
+}
+
+static void nvm_release(struct gendisk *disk, fmode_t mode)
+{
+}

No need to implement these empty methods.

drivers/lightnvm/core.c line 389

Quoted 1 line
drivers/lightnvm/core.c new file +1 -0
+/* _lock must be taken */

Turn this into an lockdep_assert_held in the code, please.

drivers/lightnvm/core.c line 551

Quoted 3 lines
drivers/lightnvm/core.c new file +3 -0
+int nvm_register(struct request_queue *q, struct gendisk *disk,
+							struct nvm_dev_ops *ops)
+{

No need to pass a gendisk here, in fact LighNVM low level driver shouldn't even need to allocate one. The only thing you seem to be using here is the name anyway.

drivers/lightnvm/core.c line 582

Quoted 1 line
drivers/lightnvm/core.c new file +1 -0
+void nvm_unregister(struct gendisk *disk)

Same here.

#3 lore raw

Re: [PATCH v5 1/5] lightnvm: Support for Open-Channel SSDs

Quoted 3 lines · Christoph Hellwig

Hi Matias,

I like this new architecture.

Thanks, great to hear. :)

I will get the nitpicks fixed.

#4 lore raw

PATCH v5 2/5 rrpc: Hybrid Open-Channel SSD RRPC target

In reply to Matias Bjørling

This target implements a simple strategy FTL for Open-Channel SSDs. It does round-robin selection across channels and luns. It uses a simple greedy cost-based garbage collector and exposes the physical flash as a block device.

---
 drivers/lightnvm/Kconfig  |   10 +
 drivers/lightnvm/Makefile |    1 +
 drivers/lightnvm/rrpc.c   | 1190 +++++++++++++++++++++++++++++++++++++++++++++
 drivers/lightnvm/rrpc.h   |  220 +++++++++
 4 files changed, 1421 insertions(+)
 create mode 100644 drivers/lightnvm/rrpc.c
 create mode 100644 drivers/lightnvm/rrpc.h
drivers/lightnvm/Kconfig +10 -0
index 1f8412c..ab1fe57 100644
@@ -14,3 +14,13 @@ menuconfig NVM
 	  If you say N, all options in this submenu will be skipped and disabled
 	  only do this if you know what you are doing.
 
+if NVM
+
+config NVM_RRPC
+	tristate "Round-robin Hybrid Open-Channel SSD target"
+	---help---
+	Allows an open-channel SSD to be exposed as a block device to the
+	host. The target is implemented using a linear mapping table and
+	cost-based garbage collection. It is optimized for 4K IO sizes.
+
+endif # NVM
drivers/lightnvm/Makefile +1 -0
index 38185e9..b2a39e2 100644
@@ -3,3 +3,4 @@
 #
 
 obj-$(CONFIG_NVM)		:= core.o
+obj-$(CONFIG_NVM_RRPC)		+= rrpc.o
drivers/lightnvm/rrpc.c new file +1190 -0

1,190 lines not on this page · raw message

drivers/lightnvm/rrpc.h new file +220 -0

220 lines not on this page · raw message

Signature · 1 line
2.1.4
#5 lore raw

PATCH v5 3/5 bm_hb: Hybrid Open-Channel SSD block manager

In reply to Matias Bjørling

The host implementation for Open-Channel SSDs is divided into block management and targets. This patch implements the block manager for hybrid open-channel SSDs. On top a target, such as rrpc is initialized.

---
 drivers/lightnvm/Kconfig  |   7 +
 drivers/lightnvm/Makefile |   1 +
 drivers/lightnvm/bm_hb.c  | 379 ++++++++++++++++++++++++++++++++++++++++++++++
 drivers/lightnvm/bm_hb.h  |  31 ++++
 4 files changed, 418 insertions(+)
 create mode 100644 drivers/lightnvm/bm_hb.c
 create mode 100644 drivers/lightnvm/bm_hb.h
drivers/lightnvm/Kconfig +7 -0
index ab1fe57..37b00ae 100644
@@ -23,4 +23,11 @@ config NVM_RRPC
 	host. The target is implemented using a linear mapping table and
 	cost-based garbage collection. It is optimized for 4K IO sizes.
 
+config NVM_BM_HB
+	tristate "Block manager for Hybrid Open-Channel SSD"
+	---help---
+	Block manager for SSDs that offload block management off to the device,
+	while keeping data placement and garbage collection decisions on the
+	host.
+
 endif # NVM
drivers/lightnvm/Makefile +1 -0
index b2a39e2..9ff4669 100644
@@ -4,3 +4,4 @@
 
 obj-$(CONFIG_NVM)		:= core.o
 obj-$(CONFIG_NVM_RRPC)		+= rrpc.o
+obj-$(CONFIG_NVM_BM_HB) 	+= bm_hb.o
drivers/lightnvm/bm_hb.c new file +379 -0

379 lines not on this page · raw message

drivers/lightnvm/bm_hb.h new file +31 -0
new file mode 100644
index 0000000..13171af
@@ -0,0 +1,31 @@
+/*
+ * Copyright: Matias Bjorling <[email protected]>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License version
+ * 2 as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ */
+
+#ifndef BM_HB_H_
+#define BM_HB_H_
+
+#include <linux/module.h>
+#include <linux/vmalloc.h>
+
+#include <linux/lightnvm.h>
+
+struct bm_hb {
+	struct nvm_lun *luns;
+};
+
+#define bm_for_each_lun(dev, bm, lun, i) \
+		for ((i) = 0, lun = &(bm)->luns[0]; \
+			(i) < (dev)->nr_luns; (i)++, lun = &(bm)->luns[(i)])
+
+#endif /* BM_HB_H_ */
Signature · 1 line
2.1.4
#6 lore raw

PATCH v5 4/5 null_blk: LightNVM support

In reply to Matias Bjørling

Initial support for LightNVM. The support can be used to benchmark performance of targets and core implementation.

---
 Documentation/block/null_blk.txt |   8 +++
 drivers/block/null_blk.c         | 138 +++++++++++++++++++++++++++++++++++++--
 2 files changed, 140 insertions(+), 6 deletions(-)
Documentation/block/null_blk.txt +8 -0
index 2f6c6ff..a34f50a 100644
@@ -70,3 +70,11 @@ use_per_node_hctx=[0/1]: Default: 0
      parameter.
   1: The multi-queue block layer is instantiated with a hardware dispatch
      queue for each CPU node in the system.
+
+IV: LightNVM specific parameters
+
+nvm_enable=[x]: Default: 0
+  Enable LightNVM for null block devices. Requires blk-mq to be used.
+
+nvm_num_channels=[x]: Default: 1
+  Number of LightNVM channels that is exposed to the LightNVM driver.
drivers/block/null_blk.c +132 -6

176 lines not on this page · raw message

Signature · 1 line
2.1.4
#7 lore raw

Re: [PATCH v5 4/5] null_blk: LightNVM support

Any reason you're adding this to null_blk instead of having a separate null_nvm driver?

#8 lore raw

Re: [PATCH v5 4/5] null_blk: LightNVM support

Quoted 3 lines · Christoph Hellwig

Any reason you're adding this to null_blk instead of having a separate null_nvm driver?

Only reason was to not duplicate the I/O submission/completion flow. With the simple code at the moment, it is little to add. However, if someone decides to put backing store, simulation, etc. into it, then it should properly go into another module.

Do you want me to move it into a new driver for this patchset?

#9 lore raw

Re: [PATCH v5 4/5] null_blk: LightNVM support

Quoted 6 lines · Matias Bj?rling

Only reason was to not duplicate the I/O submission/completion flow. With the simple code at the moment, it is little to add. However, if someone decides to put backing store, simulation, etc. into it, then it should properly go into another module.

Do you want me to move it into a new driver for this patchset?

I'd prefer to have it separate unless there's a good reason to merge it into null_blk. From your above descriptions it sounds like it really should be separate.

#10 lore raw

PATCH v5 5/5 nvme: LightNVM support

In reply to Matias Bjørling

The first generation of Open-Channel SSDs will be based on NVMe. The integration requires that a NVMe device exposes itself as a LightNVM device. The way this is done currently is by hooking into the Controller Capabilities (CAP register) and a bit in NSFEAT for each namespace.

After detection, vendor specific codes are used to identify the device and enumerate supported features.

---
 drivers/block/Makefile        |   2 +-
 drivers/block/nvme-core.c     |  22 +-
 drivers/block/nvme-lightnvm.c | 504 ++++++++++++++++++++++++++++++++++++++++++
 include/linux/nvme.h          |   6 +
 include/uapi/linux/nvme.h     |   3 +
 5 files changed, 533 insertions(+), 4 deletions(-)
 create mode 100644 drivers/block/nvme-lightnvm.c
drivers/block/Makefile +1 -1
index 02b688d..a01d7d8 100644
@@ -44,6 +44,6 @@ obj-$(CONFIG_BLK_DEV_RSXX) += rsxx/
 obj-$(CONFIG_BLK_DEV_NULL_BLK)	+= null_blk.o
 obj-$(CONFIG_ZRAM) += zram/
 
-nvme-y		:= nvme-core.o nvme-scsi.o
+nvme-y		:= nvme-core.o nvme-scsi.o nvme-lightnvm.o
 skd-y		:= skd_main.o
 swim_mod-y	:= swim.o swim_asm.o
drivers/block/nvme-core.c +19 -3
index 666e994..ab799b0 100644
@@ -40,6 +40,7 @@
 #include <linux/slab.h>
 #include <linux/t10-pi.h>
 #include <linux/types.h>
+#include <linux/lightnvm.h>
 #include <scsi/sg.h>
 #include <asm-generic/io-64-nonatomic-lo-hi.h>
 
@@ -1751,7 +1752,8 @@ static int nvme_configure_admin_queue(struct nvme_dev *dev)
 
 	dev->page_size = 1 << page_shift;
 
-	dev->ctrl_config = NVME_CC_CSS_NVM;
+	dev->ctrl_config = NVME_CAP_LIGHTNVM(cap) ?
+					NVME_CC_CSS_LIGHTNVM : NVME_CC_CSS_NVM;
 	dev->ctrl_config |= (page_shift - 12) << NVME_CC_MPS_SHIFT;
 	dev->ctrl_config |= NVME_CC_ARB_RR | NVME_CC_SHN_NONE;
 	dev->ctrl_config |= NVME_CC_IOSQES | NVME_CC_IOCQES;
@@ -1997,6 +1999,16 @@ static int nvme_revalidate_disk(struct gendisk *disk)
 		return -ENODEV;
 	}
 
+	if ((dev->ctrl_config & NVME_CC_CSS_LIGHTNVM) &&
+		id->nsfeat & NVME_NS_FEAT_NVM && ns->type != NVME_NS_NVM) {
+		if (nvme_nvm_register(ns->queue, disk)) {
+			dev_warn(dev->dev,
+				    "%s: LightNVM init failure\n", __func__);
+			return -ENODEV;
+		}
+		ns->type = NVME_NS_NVM;
+	}
+
 	old_ms = ns->ms;
 	lbaf = id->flbas & NVME_NS_FLBAS_LBA_MASK;
 	ns->lba_shift = id->lbaf[lbaf].ds;
@@ -2028,7 +2040,7 @@ static int nvme_revalidate_disk(struct gendisk *disk)
 								!ns->ext)
 		nvme_init_integrity(ns);
 
-	if (ns->ms && !blk_get_integrity(disk))
+	if ((ns->ms && !blk_get_integrity(disk)) || ns->type == NVME_NS_NVM)
 		set_capacity(disk, 0);
 	else
 		set_capacity(disk, le64_to_cpup(&id->nsze) << (ns->lba_shift - 9));
@@ -2146,7 +2158,8 @@ static void nvme_alloc_ns(struct nvme_dev *dev, unsigned nsid)
 	if (nvme_revalidate_disk(ns->disk))
 		goto out_free_disk;
 
-	add_disk(ns->disk);
+	if (ns->type != NVME_NS_NVM)
+		add_disk(ns->disk);
 	if (ns->ms) {
 		struct block_device *bd = bdget_disk(ns->disk, 0);
 		if (!bd)
@@ -2345,6 +2358,9 @@ static void nvme_free_namespace(struct nvme_ns *ns)
 {
 	list_del(&ns->list);
 
+	if (ns->type == NVME_NS_NVM)
+		nvm_unregister(ns->disk);
+
 	spin_lock(&dev_list_lock);
 	ns->disk->private_data = NULL;
 	spin_unlock(&dev_list_lock);
drivers/block/nvme-lightnvm.c new file +504 -0

504 lines not on this page · raw message

include/linux/nvme.h +6 -0
index fa3fe16..fa58242 100644
@@ -19,6 +19,7 @@
 #include <linux/pci.h>
 #include <linux/kref.h>
 #include <linux/blk-mq.h>
+#include <linux/lightnvm.h>
 
 struct nvme_bar {
 	__u64			cap;	/* Controller Capabilities */
@@ -41,6 +42,7 @@ struct nvme_bar {
 #define NVME_CAP_STRIDE(cap)	(((cap) >> 32) & 0xf)
 #define NVME_CAP_MPSMIN(cap)	(((cap) >> 48) & 0xf)
 #define NVME_CAP_MPSMAX(cap)	(((cap) >> 52) & 0xf)
+#define NVME_CAP_LIGHTNVM(cap)	(((cap) >> 38) & 0x1)
 
 #define NVME_CMB_BIR(cmbloc)	((cmbloc) & 0x7)
 #define NVME_CMB_OFST(cmbloc)	(((cmbloc) >> 12) & 0xfffff)
@@ -56,6 +58,7 @@ struct nvme_bar {
 enum {
 	NVME_CC_ENABLE		= 1 << 0,
 	NVME_CC_CSS_NVM		= 0 << 4,
+	NVME_CC_CSS_LIGHTNVM	= 1 << 4,
 	NVME_CC_MPS_SHIFT	= 7,
 	NVME_CC_ARB_RR		= 0 << 11,
 	NVME_CC_ARB_WRRU	= 1 << 11,
@@ -138,6 +141,7 @@ struct nvme_ns {
 	u16 ms;
 	bool ext;
 	u8 pi_type;
+	int type;
 	u64 mode_select_num_blocks;
 	u32 mode_select_block_len;
 };
@@ -184,4 +188,6 @@ int nvme_sg_io(struct nvme_ns *ns, struct sg_io_hdr __user *u_hdr);
 int nvme_sg_io32(struct nvme_ns *ns, unsigned long arg);
 int nvme_sg_get_version_num(int __user *ip);
 
+int nvme_nvm_register(struct request_queue *q, struct gendisk *disk);
+
 #endif /* _LINUX_NVME_H */
include/uapi/linux/nvme.h +3 -0
index 732b32e..0374f11 100644
@@ -130,6 +130,7 @@ struct nvme_id_ns {
 
 enum {
 	NVME_NS_FEAT_THIN	= 1 << 0,
+	NVME_NS_FEAT_NVM	= 1 << 3,
 	NVME_NS_FLBAS_LBA_MASK	= 0xf,
 	NVME_NS_FLBAS_META_EXT	= 0x10,
 	NVME_LBAF_RP_BEST	= 0,
@@ -146,6 +147,8 @@ enum {
 	NVME_NS_DPS_PI_TYPE1	= 1,
 	NVME_NS_DPS_PI_TYPE2	= 2,
 	NVME_NS_DPS_PI_TYPE3	= 3,
+
+	NVME_NS_NVM		= 1,
 };
 
 struct nvme_smart_log {
Signature · 1 line
2.1.4