[PATCH v4 0/2] nvme: Enable generic interface (/dev/ngX) for unknown command sets
Joel Granados
j.granados at samsung.com
Tue Jun 28 12:10:14 PDT 2022
Currently block and char interface do not show up for any command set other than
NVM and ZNS. This series enables char interface to come up for unknown command sets.
Patch 1: Is prep. It allows the re-use of nvme_mpath_add_disk for
supported as well as independent command sets.
Patch 2: The following functions become aware of whether the command set is
independent or not: nvme_alloc_ns and nvme_validate_ns. A switch statement
is introduced in each of them to call the relevant helper to identify and
update the namespaces. nvme_update_ns_info_cs_indep is added to update
command set independent devices.
Changes since V3:
- Stop ignoring the NVM or ZNS controllers that do not support
command-set-independent namespace identification and allow them to come
up through the usual command-set-dependent path.
- Only devices that are not NVM nor ZNS and do not support the
command-set-indep NS identification will be "abandoned"
- New function nvme_update_ns_mpath_info_general that is called from both
nmve_update_ns_info and nvme_update_ns_info_cs_indep to "update" the
mpath device. This removes repeated code.
- Warn when when command-set-indep NS is not supported or it returns
error.
- Only assign the independent id in nvme_identify_ns_cs_indep when there
are no errors. This is to keel NULL value on failure.
Changes since V2:
- Removed unnecessary include to types.h
- Call nvme_identify_ns_cs_indep only once and reuse the created
independent id in the nvme_alloc_ns call. We call
nvme_identify_ns_cs_indep regardless of ctrl->cap & NVME_CAP_CRMS_CRIMS
value
- Replace 'if' with 'switch' statements making it explicit that the command
set independent functions are used when the command set is not NVM nor
ZNS.
- Set the hidden flag in the multipath case so the block device does not
come up when multipath is enabled.
Changes since V1:
- Use command-set independent id-ns to enable unknown command-sets
Joel Granados (2):
nvme-multipath: refactor nvme_mpath_add_disk
nvme: enable generic interface (/dev/ngXnY) for unknown command sets
drivers/nvme/host/core.c | 164 ++++++++++++++++++++++++----------
drivers/nvme/host/multipath.c | 6 +-
drivers/nvme/host/nvme.h | 5 +-
3 files changed, 120 insertions(+), 55 deletions(-)
--
2.30.2
More information about the Linux-nvme
mailing list