nvmet: add Command Set Identifier support
authorChaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
Thu, 10 Jun 2021 01:32:51 +0000 (18:32 -0700)
committerChristoph Hellwig <hch@lst.de>
Thu, 17 Jun 2021 13:51:20 +0000 (15:51 +0200)
commitab5d0b38c0475d6ff59f1a6ccf7c668b9ec2e0a4
tree7dcebe36a4041db58d572e500df038be6513c45e
parent9a01b58c22ccabd00e990e9dc01c2de5865d6e4d
nvmet: add Command Set Identifier support

NVMe TP 4056 allows controllers to support different command sets.
NVMeoF target currently only supports namespaces that contain
traditional logical blocks that may be randomly read and written. In
some applications there is a value in exposing namespaces that contain
logical blocks that have special access rules (e.g. sequentially write
required namespace such as Zoned Namespace (ZNS)).

In order to support the Zoned Block Devices (ZBD) backend, controllers
need to have support for ZNS Command Set Identifier (CSI).

In this preparation patch, we adjust the code such that it can now
support the default command set identifier. We update the namespace data
structure to store the CSI value which defaults to NVME_CSI_NVM
that represents traditional logical blocks namespace type.

The CSI support is required to implement the ZBD backend for NVMeOF
with host side NVMe ZNS interface, since ZNS commands belong to
the different command set than the default one.

Signed-off-by: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
drivers/nvme/target/admin-cmd.c
drivers/nvme/target/core.c
drivers/nvme/target/nvmet.h
include/linux/nvme.h