Skip to content

Commit 3a85a5d

Browse files
Christoph Hellwigaxboe
authored andcommitted
nvme-loop: add a NVMe loopback host driver
This patch implements adds nvme-loop which allows to access local devices exported as NVMe over Fabrics namespaces. This module can be useful for easy evaluation, testing and also feature experimentation. To createa nvme-loop device you need to configure the NVMe target to export a loop port (see the nvmetcli documentaton for that) and then connect to it using nvme connect-all -t loop which requires the very latest nvme-cli version with Fabrics support. Signed-off-by: Jay Freyensee <james.p.freyensee@intel.com> Signed-off-by: Ming Lin <ming.l@ssi.samsung.com> Signed-off-by: Sagi Grimberg <sagi@grimberg.me> Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Steve Wise <swise@opengridcomputing.com> Signed-off-by: Jens Axboe <axboe@fb.com>
1 parent a07b497 commit 3a85a5d

File tree

3 files changed

+766
-0
lines changed

3 files changed

+766
-0
lines changed

drivers/nvme/target/Kconfig

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,14 @@ config NVME_TARGET
1313
To configure the NVMe target you probably want to use the nvmetcli
1414
tool from http://git.infradead.org/users/hch/nvmetcli.git.
1515

16+
config NVME_TARGET_LOOP
17+
tristate "NVMe loopback device support"
18+
depends on BLK_DEV_NVME
19+
select NVME_TARGET
20+
select NVME_FABRICS
21+
select SG_POOL
22+
help
23+
This enables the NVMe loopback device support, which can be useful
24+
to test NVMe host and target side features.
25+
1626
If unsure, say N.

drivers/nvme/target/Makefile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11

22
obj-$(CONFIG_NVME_TARGET) += nvmet.o
3+
obj-$(CONFIG_NVME_TARGET_LOOP) += nvme-loop.o
34

45
nvmet-y += core.o configfs.o admin-cmd.o io-cmd.o fabrics-cmd.o \
56
discovery.o
7+
nvme-loop-y += loop.o

0 commit comments

Comments
 (0)