Skip to contentSkip to conversation

Remove CONFIG_NVME_MULTIPATH option

PATCH In review Daniel Wagner 4 participants 13 messages Jul 19, 2023 – Jul 26, 2023 NVMe

lore
Share & tools
lore
#0 lore raw

cover Remove CONFIG_NVME_MULTIPATH option

Quoted 2 lines

"Support for shared namespaces without CONFIG_NVME_MULTIPATH is deprecated and will be removed in Linux 6.0\n."

patch1: As stated in the first warning the multipath config option has been scheduled to be removed for 6.0. As we are past this point let's drop it.

Quoted 1 line

"Found shared namespace %d, but multipathing not supported.\n"

patch2: The second warning is causing some confusion for Dell's PowerPath users. The native multipath support has been deliberty disabled, because it PowerPath module will provide it. As the native multipath is enabled per default and always built-in, just drop it.

Daniel Wagner (2):
nvme: drop multipath config option
nvme: remove warning for shared ns when multipath=N

 drivers/nvme/host/Kconfig  |  9 ----
 drivers/nvme/host/Makefile |  4 +-
 drivers/nvme/host/core.c   | 12 -----
 drivers/nvme/host/ioctl.c  |  2 -
 drivers/nvme/host/nvme.h   | 92 +-------------------------------------
 drivers/nvme/host/pr.c     |  3 +-
 drivers/nvme/host/sysfs.c  |  6 ---
 7 files changed, 4 insertions(+), 124 deletions(-)
Signature · 1 line
2.41.0
#1 lore raw

PATCH 1/2 nvme: drop multipath config option

Commit ce8d78616a6b ("nvme: warn about shared namespaces without CONFIG_NVME_MULTIPATH") added the message that CONFIG_NVME_MULTIPATH is going to be removed with 6.0. As we are past this point, let's remove the option.

---
 drivers/nvme/host/Kconfig  |  9 ----
 drivers/nvme/host/Makefile |  4 +-
 drivers/nvme/host/core.c   |  9 +---
 drivers/nvme/host/ioctl.c  |  2 -
 drivers/nvme/host/nvme.h   | 92 +-------------------------------------
 drivers/nvme/host/pr.c     |  3 +-
 drivers/nvme/host/sysfs.c  |  6 ---
 7 files changed, 5 insertions(+), 120 deletions(-)
drivers/nvme/host/Kconfig +0 -9
index 2f6a7f8c94e8..155b326ddf7e 100644
@@ -15,15 +15,6 @@ config BLK_DEV_NVME
 	  To compile this driver as a module, choose M here: the
 	  module will be called nvme.
 
-config NVME_MULTIPATH
-	bool "NVMe multipath support"
-	depends on NVME_CORE
-	help
-	   This option enables support for multipath access to NVMe
-	   subsystems.  If this option is enabled only a single
-	   /dev/nvmeXnY device will show up for each NVMe namespace,
-	   even if it is accessible through multiple controllers.
-
 config NVME_VERBOSE_ERRORS
 	bool "NVMe verbose error reporting"
 	depends on NVME_CORE
drivers/nvme/host/Makefile +2 -2
index c7c3cf202d12..86b3304aee26 100644
@@ -10,10 +10,10 @@ obj-$(CONFIG_NVME_FC)			+= nvme-fc.o
 obj-$(CONFIG_NVME_TCP)			+= nvme-tcp.o
 obj-$(CONFIG_NVME_APPLE)		+= nvme-apple.o
 
-nvme-core-y				+= core.o ioctl.o sysfs.o pr.o
+nvme-core-y				+= core.o ioctl.o sysfs.o pr.o \
+					multipath.o
 nvme-core-$(CONFIG_NVME_VERBOSE_ERRORS)	+= constants.o
 nvme-core-$(CONFIG_TRACING)		+= trace.o
-nvme-core-$(CONFIG_NVME_MULTIPATH)	+= multipath.o
 nvme-core-$(CONFIG_BLK_DEV_ZONED)	+= zns.o
 nvme-core-$(CONFIG_FAULT_INJECTION_DEBUG_FS)	+= fault_inject.o
 nvme-core-$(CONFIG_NVME_HWMON)		+= hwmon.o
drivers/nvme/host/core.c +1 -8
index 37b6fa746662..d08371967ce3 100644
@@ -3348,9 +3348,7 @@ static struct nvme_ns_head *nvme_alloc_ns_head(struct nvme_ctrl *ctrl,
 	size_t size = sizeof(*head);
 	int ret = -ENOMEM;
 
-#ifdef CONFIG_NVME_MULTIPATH
 	size += num_possible_nodes() * sizeof(struct nvme_ns *);
-#endif
 
 	head = kzalloc(size, GFP_KERNEL);
 	if (!head)
@@ -3497,13 +3495,10 @@ static int nvme_init_ns_head(struct nvme_ns *ns, struct nvme_ns_info *info)
 			goto out_put_ns_head;
 		}
 
-		if (!multipath) {
+		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.");
-		}
 	}
 
 	list_add_tail_rcu(&ns->siblings, &head->list);
@@ -4124,13 +4119,11 @@ static bool nvme_handle_aen_notice(struct nvme_ctrl *ctrl, u32 result)
 			queue_work(nvme_wq, &ctrl->fw_act_work);
 		}
 		break;
-#ifdef CONFIG_NVME_MULTIPATH
 	case NVME_AER_NOTICE_ANA:
 		if (!ctrl->ana_log_buf)
 			break;
 		queue_work(nvme_wq, &ctrl->ana_work);
 		break;
-#endif
 	case NVME_AER_NOTICE_DISC_CHANGED:
 		ctrl->aen_result = result;
 		break;
drivers/nvme/host/ioctl.c +0 -2
index 5c3250f36ce7..e3603644fbdd 100644
@@ -793,7 +793,6 @@ int nvme_ns_chr_uring_cmd_iopoll(struct io_uring_cmd *ioucmd,
 	rcu_read_unlock();
 	return ret;
 }
-#ifdef CONFIG_NVME_MULTIPATH
 static int nvme_ns_head_ctrl_ioctl(struct nvme_ns *ns, unsigned int cmd,
 		void __user *argp, struct nvme_ns_head *head, int srcu_idx,
 		bool open_for_write)
@@ -883,7 +882,6 @@ int nvme_ns_head_chr_uring_cmd(struct io_uring_cmd *ioucmd,
 	srcu_read_unlock(&head->srcu, srcu_idx);
 	return ret;
 }
-#endif /* CONFIG_NVME_MULTIPATH */
 
 int nvme_dev_uring_cmd(struct io_uring_cmd *ioucmd, unsigned int issue_flags)
 {
drivers/nvme/host/nvme.h +1 -91

154 lines not on this page · raw message

drivers/nvme/host/pr.c +1 -2
index 391b1465ebfd..fa2ec916a762 100644
@@ -97,8 +97,7 @@ static int nvme_sc_to_pr_err(int nvme_sc)
 static int nvme_send_pr_command(struct block_device *bdev,
 		struct nvme_command *c, void *data, unsigned int data_len)
 {
-	if (IS_ENABLED(CONFIG_NVME_MULTIPATH) &&
-	    bdev->bd_disk->fops == &nvme_ns_head_ops)
+	if (bdev->bd_disk->fops == &nvme_ns_head_ops)
 		return nvme_send_ns_head_pr_command(bdev, c, data, data_len);
 
 	return nvme_send_ns_pr_command(bdev->bd_disk->private_data, c, data,
drivers/nvme/host/sysfs.c +0 -6
index 212e1b05d298..47aef949c271 100644
@@ -120,10 +120,8 @@ static struct attribute *nvme_ns_id_attrs[] = {
 	&dev_attr_nguid.attr,
 	&dev_attr_eui.attr,
 	&dev_attr_nsid.attr,
-#ifdef CONFIG_NVME_MULTIPATH
 	&dev_attr_ana_grpid.attr,
 	&dev_attr_ana_state.attr,
-#endif
 	NULL,
 };
 
@@ -146,14 +144,12 @@ static umode_t nvme_ns_id_attrs_are_visible(struct kobject *kobj,
 		if (!memchr_inv(ids->eui64, 0, sizeof(ids->eui64)))
 			return 0;
 	}
-#ifdef CONFIG_NVME_MULTIPATH
 	if (a == &dev_attr_ana_grpid.attr || a == &dev_attr_ana_state.attr) {
 		if (dev_to_disk(dev)->fops != &nvme_bdev_ops) /* per-path attr */
 			return 0;
 		if (!nvme_ctrl_use_ana(nvme_get_ns_from_dev(dev)->ctrl))
 			return 0;
 	}
-#endif
 	return a->mode;
 }
 
@@ -652,9 +648,7 @@ static struct attribute *nvme_subsys_attrs[] = {
 	&subsys_attr_firmware_rev.attr,
 	&subsys_attr_subsysnqn.attr,
 	&subsys_attr_subsystype.attr,
-#ifdef CONFIG_NVME_MULTIPATH
 	&subsys_attr_iopolicy.attr,
-#endif
 	NULL,
 };
 
Signature · 1 line
2.41.0
maintainer
#2 lore raw

Re: [PATCH v1 1/2] nvme: drop multipath config option

drivers/nvme/host/core.c static int nvme_init_ns_head(struct nvme_ns *ns, struct nvme_ns_info *info) · line 3506

Quoted 12 lines · Daniel Wagner
drivers/nvme/host/core.c +1 -4
@@ -3497,13 +3495,10 @@ static int nvme_init_ns_head(struct nvme_ns *ns, struct nvme_ns_info *info)
 			goto out_put_ns_head;
 		}
 
-		if (!multipath) {
+		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.");
-		}

From my reading of this message, I thought the intention was that this driver will eventually replace it with a:

goto out_put_ns_head;

instead of letting the namespace become visible for some unsupported mode. The warning was to give people a chance to migrate off whatever unsupported setup they were using, not a deadline for when the warning dissappears.

#3 lore raw

Re: [PATCH v1 1/2] nvme: drop multipath config option

Quoted 4 lines · Keith Busch

From my reading of this message, I thought the intention was that this driver will eventually replace it with a:

goto out_put_ns_head;

This would obviously make the PowerPath module unhappy. Sure, I am aware of our upstream policy so I wont argue.

Quoted 4 lines

instead of letting the namespace become visible for some unsupported mode. The warning was to give people a chance to migrate off whatever unsupported setup they were using, not a deadline for when the warning dissappears.

I assume this means the dm-multipath setups? If so, I understand the motivation but do we really have to burn the bridge here? It's not that we have additional code or maintaince overhead, except the module parameter multipath.

maintainer
#4 lore raw

Re: [PATCH v1 1/2] nvme: drop multipath config option

Quoted 9 lines · Daniel Wagner
Quoted 4 lines · Keith Busch

From my reading of this message, I thought the intention was that this driver will eventually replace it with a:

goto out_put_ns_head;

This would obviously make the PowerPath module unhappy. Sure, I am aware of our upstream policy so I wont argue.

Quoted 8 lines
Quoted 4 lines

instead of letting the namespace become visible for some unsupported mode. The warning was to give people a chance to migrate off whatever unsupported setup they were using, not a deadline for when the warning dissappears.

I assume this means the dm-multipath setups? If so, I understand the motivation but do we really have to burn the bridge here? It's not that we have additional code or maintaince overhead, except the module parameter multipath.

Yeah, dm-mpath is such a setup this was intended to prevent, as well as out-of-tree alternatives. Not that I advocating one way or another at this point; I'm just trying to set the context for why this message exists for discussing your patchset.

I'm curious why a proprietary module is even used, though. Is the driver's native handling doing something undesirable, or is this to cater to some vendor specific behavior outside the spec? If the former, I'd like to understand the problem and see if there's something we can improve.

#5 lore raw

Re: [PATCH v1 1/2] nvme: drop multipath config option

Quoted 4 lines · Keith Busch

Yeah, dm-mpath is such a setup this was intended to prevent, as well as out-of-tree alternatives. Not that I advocating one way or another at this point; I'm just trying to set the context for why this message exists for discussing your patchset.

Fair enough.

Quoted 5 lines

I'm curious why a proprietary module is even used, though. Is the driver's native handling doing something undesirable, or is this to cater to some vendor specific behavior outside the spec? If the former, I'd like to understand the problem and see if there's something we can improve.

Unfortunatly, I don't have any insides into PowerPath, or what it tries to achieve. I suspect it's more vendor specific handling features. I'll ask if there is a feature gap we could address in upstream.

#6 lore raw

Re: [PATCH v1 1/2] nvme: drop multipath config option

Quoted 14 lines · Daniel Wagner
Quoted 4 lines · Keith Busch

Yeah, dm-mpath is such a setup this was intended to prevent, as well as out-of-tree alternatives. Not that I advocating one way or another at this point; I'm just trying to set the context for why this message exists for discussing your patchset.

Fair enough.

Quoted 5 lines

I'm curious why a proprietary module is even used, though. Is the driver's native handling doing something undesirable, or is this to cater to some vendor specific behavior outside the spec? If the former, I'd like to understand the problem and see if there's something we can improve.

Quoted 4 lines

Unfortunatly, I don't have any insides into PowerPath, or what it tries to achieve. I suspect it's more vendor specific handling features. I'll ask if there is a feature gap we could address in upstream.

From my perspective there is no feature gap. With dm-multipath there used to be one, as powerpath would provide /dev/sd* devices, not the /dev/dm-* devices from dm-multipath. Also powerpath was/is able to detect which array is being used, and
pull all sorts of information from it.
Not that we really need that, though.

Other than that the functionality is pretty much identical.

PowerPath is primarily there as Dell/EMC used to recommend using PowerPath, and customer are wont to do whatever the IHV tells them.

So really, the issue not about PowerPath.

The issue is about dm-multipath, which requires this option to work at all. And that is a really contentious issue which I will not engage upon.

Good luck.

Cheers,

Hannes

Signature · 5 lines
Dr. Hannes Reinecke		           Kernel Storage Architect
[email protected]			                  +49 911 74053 688
SUSE Software Solutions Germany GmbH, Frankenstr. 146, 90461 Nürnberg
Managing Directors: I. Totev, A. Myers, A. McDonald, M. B. Moerman
(HRB 36809, AG Nürnberg)
#7 lore raw

Re: [PATCH v1 1/2] nvme: drop multipath config option

In reply to Daniel Wagner
Quoted 8 lines · Daniel Wagner
Quoted 4 lines · Keith Busch

From my reading of this message, I thought the intention was that this driver will eventually replace it with a:

goto out_put_ns_head;

This would obviously make the PowerPath module unhappy. Sure, I am aware of our upstream policy so I wont argue.

So what? non-upstream stuff simply does not matter.

#8 lore raw

Re: [PATCH v1 1/2] nvme: drop multipath config option

In reply to Keith Busch
Quoted 9 lines · Keith Busch
Quoted 1 line

From my reading of this message, I thought the intention was that this

driver will eventually replace it with a:

goto out_put_ns_head;

instead of letting the namespace become visible for some unsupported mode. The warning was to give people a chance to migrate off whatever unsupported setup they were using, not a deadline for when the warning dissappears.

Exactly!

Btw, Daniel - any reason you didn't Cc me on this?

#9 lore raw

Re: [PATCH v1 1/2] nvme: drop multipath config option

Quoted 1 line · Christoph Hellwig

Btw, Daniel - any reason you didn't Cc me on this?

I thought you preferred not to be Cc. I am just trying to be nice :)

#10 lore raw

Re: [PATCH v1 1/2] nvme: drop multipath config option

Quoted 4 lines · Daniel Wagner
Quoted 1 line · Christoph Hellwig

Btw, Daniel - any reason you didn't Cc me on this?

I thought you preferred not to be Cc. I am just trying to be nice :)

Heh. I usually try to avoid being Cced by the crazy get_maintainer heuristics, because that means I get Cced on everything. For things I maintain the Cc really helps getting my attention when I'm overscheduled like now and might be way behind on the lists.

#11 lore raw

PATCH 2/2 nvme: remove warning for shared ns when multipath=N

In reply to Daniel Wagner

The default value for the module parameter multipath is Y, thus the user has actively chosen to set multipath to N to trigger this warning with shared namespaces.

There is at least one external mutlipathing module which conflict with the native multipathing feature (Dell's PowerPath module). In such setups the native mutlipathing is deliberate disabled but the warning that mutlipathing is not supported is confusing users.

The warning was added in ce8d78616a6b ("nvme: warn about shared namespaces without CONFIG_NVME_MULTIPATH"). In the mean time the config option has been dropped. Because multipath is now always built-in and the default is Y, just drop the warning.

---
 drivers/nvme/host/core.c | 5 -----
 1 file changed, 5 deletions(-)
drivers/nvme/host/core.c +0 -5
index d08371967ce3..e8faee21c7f5 100644
@@ -3494,11 +3494,6 @@ 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);
 	}
 
 	list_add_tail_rcu(&ns->siblings, &head->list);
Signature · 1 line
2.41.0
#12 lore raw

Re: [PATCH v1 2/2] nvme: remove warning for shared ns when multipath=N

Quoted 6 lines · Daniel Wagner

The default value for the module parameter multipath is Y, thus the user has actively chosen to set multipath to N to trigger this warning with shared namespaces.

There is at least one external mutlipathing module which conflict with the native multipathing feature (Dell's PowerPath module). In such setups

Why the fuck would we care? Out of tree modules don't matter, and certainly no one should ever even dare to bother upstream with them.

Stop this crap.