[RFC PATCH 2/2] nvme-multipath: remove multipath module param
Nilay Shroff
nilay at linux.ibm.com
Thu Mar 20 23:37:23 PDT 2025
Remove the multipath module parameter from nvme-core and make native
NVMe multipath support explicit. Since we now always create a multipath
head disk node, even for single-port NVMe disks, when CONFIG_NVME_
MULTIPATH is enabled, this module parameter is no longer needed to
toggle the behavior.
Users who prefer non-native multipath must disable CONFIG_NVME_MULTIPATH
at compile time.
Signed-off-by: Nilay Shroff <nilay at linux.ibm.com>
---
drivers/nvme/host/core.c | 18 +++++++-----------
drivers/nvme/host/multipath.c | 17 ++---------------
drivers/nvme/host/nvme.h | 1 -
3 files changed, 9 insertions(+), 27 deletions(-)
diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c
index e798809a8325..50c170425141 100644
--- a/drivers/nvme/host/core.c
+++ b/drivers/nvme/host/core.c
@@ -3823,14 +3823,13 @@ static int nvme_init_ns_head(struct nvme_ns *ns, struct nvme_ns_info *info)
info->nsid);
goto out_put_ns_head;
}
-
- if (!multipath) {
- dev_warn(ctrl->device,
- "Found shared namespace %d, but multipathing not supported.\n",
- info->nsid);
- dev_warn_once(ctrl->device,
- "Support for shared namespaces without CONFIG_NVME_MULTIPATH is deprecated and will be removed in Linux 6.0.\n");
- }
+#ifndef CONFIG_NVME_MULTIPATH
+ dev_warn(ctrl->device,
+ "Found shared namespace %d, but multipathing not supported.\n",
+ info->nsid);
+ dev_warn_once(ctrl->device,
+ "Support for shared namespaces without CONFIG_NVME_MULTIPATH is deprecated and will be removed in Linux 6.0.\n");
+#endif
}
list_add_tail_rcu(&ns->siblings, &head->list);
@@ -3929,9 +3928,6 @@ static void nvme_alloc_ns(struct nvme_ctrl *ctrl, struct nvme_ns_info *info)
sprintf(disk->disk_name, "nvme%dc%dn%d", ctrl->subsys->instance,
ctrl->instance, ns->head->instance);
disk->flags |= GENHD_FL_HIDDEN;
- } else if (multipath) {
- sprintf(disk->disk_name, "nvme%dn%d", ctrl->subsys->instance,
- ns->head->instance);
} else {
sprintf(disk->disk_name, "nvme%dn%d", ctrl->instance,
ns->head->instance);
diff --git a/drivers/nvme/host/multipath.c b/drivers/nvme/host/multipath.c
index 0f54889bd483..84211f64d178 100644
--- a/drivers/nvme/host/multipath.c
+++ b/drivers/nvme/host/multipath.c
@@ -9,11 +9,6 @@
#include <trace/events/block.h>
#include "nvme.h"
-bool multipath = true;
-module_param(multipath, bool, 0444);
-MODULE_PARM_DESC(multipath,
- "turn on native support for multiple controllers per subsystem");
-
static const char *nvme_iopolicy_names[] = {
[NVME_IOPOLICY_NUMA] = "numa",
[NVME_IOPOLICY_RR] = "round-robin",
@@ -671,14 +666,6 @@ int nvme_mpath_alloc_disk(struct nvme_ctrl *ctrl, struct nvme_ns_head *head)
INIT_DELAYED_WORK(&head->remove_work, nvme_remove_head_work);
head->delayed_shutdown_sec = 0;
- /*
- * A head disk node is always created for all types of NVMe disks
- * (single-ported and multi-ported), unless the multipath module
- * parameter is explicitly set to false.
- */
- if (!multipath)
- return 0;
-
blk_set_stacking_limits(&lim);
lim.dma_alignment = 3;
lim.features |= BLK_FEAT_IO_STAT | BLK_FEAT_NOWAIT | BLK_FEAT_POLL;
@@ -1262,8 +1249,8 @@ int nvme_mpath_init_identify(struct nvme_ctrl *ctrl, struct nvme_id_ctrl *id)
size_t ana_log_size;
int error = 0;
- /* check if multipath is enabled and we have the capability */
- if (!multipath || !ctrl->subsys ||
+ /* check if controller has ANA capability */
+ if (!ctrl->subsys ||
!(ctrl->subsys->cmic & NVME_CTRL_CMIC_ANA))
return 0;
diff --git a/drivers/nvme/host/nvme.h b/drivers/nvme/host/nvme.h
index 4375357b8cd7..fba686b91976 100644
--- a/drivers/nvme/host/nvme.h
+++ b/drivers/nvme/host/nvme.h
@@ -997,7 +997,6 @@ static inline bool nvme_disk_is_ns_head(struct gendisk *disk)
return disk->fops == &nvme_ns_head_ops;
}
#else
-#define multipath false
static inline bool nvme_ctrl_use_ana(struct nvme_ctrl *ctrl)
{
return false;
--
2.47.1
More information about the Linux-nvme
mailing list