* [PATCH v3 1/5] nvme: update the multipath warning in nvme_init_ns_head
2025-03-28 19:38 [PATCH v3 0/5] nvme: make core.nvme_multipath configurable John Meneghini
@ 2025-03-28 19:38 ` John Meneghini
2025-03-28 19:38 ` [PATCH v3 2/5] nvme: change the NVME_MULTIPATH config option description John Meneghini
` (3 subsequent siblings)
4 siblings, 0 replies; 9+ messages in thread
From: John Meneghini @ 2025-03-28 19:38 UTC (permalink / raw)
To: kbusch, hch, sagi
Cc: loberman, linux-nvme, linux-kernel, emilne, jmeneghi, bgurney
The new NVME_MULTIPATH_PARAM config option requires updates
to the warning message in nvme_init_ns_head().
Signed-off-by: John Meneghini <jmeneghi@redhat.com>
Tested-by: John Meneghini <jmeneghi@redhat.com>
---
drivers/nvme/host/core.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c
index 870314c52107..b2bd8e1673ac 100644
--- a/drivers/nvme/host/core.c
+++ b/drivers/nvme/host/core.c
@@ -3824,7 +3824,7 @@ static int nvme_init_ns_head(struct nvme_ns *ns, struct nvme_ns_info *info)
"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");
+ "Shared namespace support requires core_nvme.multipath=Y.\n");
}
}
--
2.48.1
^ permalink raw reply [flat|nested] 9+ messages in thread* [PATCH v3 2/5] nvme: change the NVME_MULTIPATH config option description
2025-03-28 19:38 [PATCH v3 0/5] nvme: make core.nvme_multipath configurable John Meneghini
2025-03-28 19:38 ` [PATCH v3 1/5] nvme: update the multipath warning in nvme_init_ns_head John Meneghini
@ 2025-03-28 19:38 ` John Meneghini
2025-03-28 19:38 ` [PATCH v3 3/5] nvme: add the NVME_ENABLE_MULTIPATH_PARAM config option John Meneghini
` (2 subsequent siblings)
4 siblings, 0 replies; 9+ messages in thread
From: John Meneghini @ 2025-03-28 19:38 UTC (permalink / raw)
To: kbusch, hch, sagi
Cc: loberman, linux-nvme, linux-kernel, emilne, jmeneghi, bgurney
Fix up the NVME_MULTIPATH config description so that
it accurately describes what it does.
Signed-off-by: John Meneghini <jmeneghi@redhat.com>
Tested-by: John Meneghini <jmeneghi@redhat.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
---
drivers/nvme/host/Kconfig | 13 +++++++++----
1 file changed, 9 insertions(+), 4 deletions(-)
diff --git a/drivers/nvme/host/Kconfig b/drivers/nvme/host/Kconfig
index 10e453b2436e..d47dfa80fb95 100644
--- a/drivers/nvme/host/Kconfig
+++ b/drivers/nvme/host/Kconfig
@@ -18,10 +18,15 @@ 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.
+ This option controls support for multipath access to NVMe
+ subsystems. If this option is enabled support for NVMe multipath
+ access is included in the kernel. If this option is disabled support
+ for NVMe multipath access is excluded from the kernel. When this
+ option is disabled each controller/namespace receives its
+ own /dev/nvmeXnY device entry and NVMe multipath access is
+ not supported.
+
+ If unsure, say Y.
config NVME_VERBOSE_ERRORS
bool "NVMe verbose error reporting"
--
2.48.1
^ permalink raw reply [flat|nested] 9+ messages in thread* [PATCH v3 3/5] nvme: add the NVME_ENABLE_MULTIPATH_PARAM config option
2025-03-28 19:38 [PATCH v3 0/5] nvme: make core.nvme_multipath configurable John Meneghini
2025-03-28 19:38 ` [PATCH v3 1/5] nvme: update the multipath warning in nvme_init_ns_head John Meneghini
2025-03-28 19:38 ` [PATCH v3 2/5] nvme: change the NVME_MULTIPATH config option description John Meneghini
@ 2025-03-28 19:38 ` John Meneghini
2025-03-28 19:49 ` Caleb Sander Mateos
2025-03-28 19:38 ` [PATCH v3 4/5] nvme: add NVME_ENABLE_MULTIPATH_PARAM for loongarch John Meneghini
2025-03-28 19:38 ` [PATCH v3 5/5] nvme: add NVME_ENABLE_MULTIPATH_PARAM for powerpc skiroot John Meneghini
4 siblings, 1 reply; 9+ messages in thread
From: John Meneghini @ 2025-03-28 19:38 UTC (permalink / raw)
To: kbusch, hch, sagi
Cc: loberman, linux-nvme, linux-kernel, emilne, jmeneghi, bgurney
The CONFIG_NVME_ENABLE_MULTIPATH_PARAM option controls the
core_nvme.multipath parameter. When CONFIG_NVME_ENABLE_MULTIPATH_PARAM=n
the multipath parameter is removed from the kernel and nvme multipathing
is permanently enabled. When CONFIG_NVME_ENABLE_MULTIPATH_PARAM=y the
nvme multipath parameter is added to the kernel and nvme multipath
support is controlled by the core_nvme.multipath parameter.
By default CONFIG_NVME_ENABLE_MULTIPATH_PARAM=y
Signed-off-by: John Meneghini <jmeneghi@redhat.com>
Tested-by: John Meneghini <jmeneghi@redhat.com>
Reviewed-by: Bryan Gurney <bgurney@redhat.com>
---
drivers/nvme/host/Kconfig | 11 +++++++++++
drivers/nvme/host/multipath.c | 2 ++
2 files changed, 13 insertions(+)
diff --git a/drivers/nvme/host/Kconfig b/drivers/nvme/host/Kconfig
index d47dfa80fb95..8c04b6b93982 100644
--- a/drivers/nvme/host/Kconfig
+++ b/drivers/nvme/host/Kconfig
@@ -28,6 +28,17 @@ config NVME_MULTIPATH
If unsure, say Y.
+config NVME_ENABLE_MULTIPATH_PARAM
+ bool "NVMe enable multipath param"
+ depends on NVME_CORE && NVME_MULTIPATH
+ default y
+ help
+ This option enables the core_nvme.multipath parameter.
+ If this option is disabled the core_nvme.multipath parameter
+ is excluded from the kernel.
+
+ If unsure, say Y.
+
config NVME_VERBOSE_ERRORS
bool "NVMe verbose error reporting"
depends on NVME_CORE
diff --git a/drivers/nvme/host/multipath.c b/drivers/nvme/host/multipath.c
index 6b12ca80aa27..83084093e8db 100644
--- a/drivers/nvme/host/multipath.c
+++ b/drivers/nvme/host/multipath.c
@@ -10,9 +10,11 @@
#include "nvme.h"
bool multipath = true;
+#ifdef CONFIG_NVME_ENABLE_MULTIPATH_PARAM
module_param(multipath, bool, 0444);
MODULE_PARM_DESC(multipath,
"turn on native support for multiple controllers per subsystem");
+#endif
static const char *nvme_iopolicy_names[] = {
[NVME_IOPOLICY_NUMA] = "numa",
--
2.48.1
^ permalink raw reply [flat|nested] 9+ messages in thread* Re: [PATCH v3 3/5] nvme: add the NVME_ENABLE_MULTIPATH_PARAM config option
2025-03-28 19:38 ` [PATCH v3 3/5] nvme: add the NVME_ENABLE_MULTIPATH_PARAM config option John Meneghini
@ 2025-03-28 19:49 ` Caleb Sander Mateos
2025-03-31 14:28 ` John Meneghini
0 siblings, 1 reply; 9+ messages in thread
From: Caleb Sander Mateos @ 2025-03-28 19:49 UTC (permalink / raw)
To: John Meneghini
Cc: kbusch, hch, sagi, loberman, linux-nvme, linux-kernel, emilne, bgurney
On Fri, Mar 28, 2025 at 12:42 PM John Meneghini <jmeneghi@redhat.com> wrote:
>
> The CONFIG_NVME_ENABLE_MULTIPATH_PARAM option controls the
> core_nvme.multipath parameter. When CONFIG_NVME_ENABLE_MULTIPATH_PARAM=n
> the multipath parameter is removed from the kernel and nvme multipathing
> is permanently enabled. When CONFIG_NVME_ENABLE_MULTIPATH_PARAM=y the
> nvme multipath parameter is added to the kernel and nvme multipath
> support is controlled by the core_nvme.multipath parameter.
>
> By default CONFIG_NVME_ENABLE_MULTIPATH_PARAM=y
>
> Signed-off-by: John Meneghini <jmeneghi@redhat.com>
> Tested-by: John Meneghini <jmeneghi@redhat.com>
> Reviewed-by: Bryan Gurney <bgurney@redhat.com>
> ---
> drivers/nvme/host/Kconfig | 11 +++++++++++
> drivers/nvme/host/multipath.c | 2 ++
> 2 files changed, 13 insertions(+)
>
> diff --git a/drivers/nvme/host/Kconfig b/drivers/nvme/host/Kconfig
> index d47dfa80fb95..8c04b6b93982 100644
> --- a/drivers/nvme/host/Kconfig
> +++ b/drivers/nvme/host/Kconfig
> @@ -28,6 +28,17 @@ config NVME_MULTIPATH
>
> If unsure, say Y.
>
> +config NVME_ENABLE_MULTIPATH_PARAM
> + bool "NVMe enable multipath param"
> + depends on NVME_CORE && NVME_MULTIPATH
> + default y
> + help
> + This option enables the core_nvme.multipath parameter.
> + If this option is disabled the core_nvme.multipath parameter
> + is excluded from the kernel.
> +
> + If unsure, say Y.
> +
> config NVME_VERBOSE_ERRORS
> bool "NVMe verbose error reporting"
> depends on NVME_CORE
> diff --git a/drivers/nvme/host/multipath.c b/drivers/nvme/host/multipath.c
> index 6b12ca80aa27..83084093e8db 100644
> --- a/drivers/nvme/host/multipath.c
> +++ b/drivers/nvme/host/multipath.c
> @@ -10,9 +10,11 @@
> #include "nvme.h"
>
> bool multipath = true;
> +#ifdef CONFIG_NVME_ENABLE_MULTIPATH_PARAM
> module_param(multipath, bool, 0444);
> MODULE_PARM_DESC(multipath,
> "turn on native support for multiple controllers per subsystem");
> +#endif
If CONFIG_NVME_ENABLE_MULTIPATH_PARAM is disabled, could you #define
multipath false in place of the global variable? That would allow the
compiler to optimize out the multipath checks and the resulting dead
code.
Best,
Caleb
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH v3 3/5] nvme: add the NVME_ENABLE_MULTIPATH_PARAM config option
2025-03-28 19:49 ` Caleb Sander Mateos
@ 2025-03-31 14:28 ` John Meneghini
2025-03-31 23:55 ` Caleb Sander Mateos
0 siblings, 1 reply; 9+ messages in thread
From: John Meneghini @ 2025-03-31 14:28 UTC (permalink / raw)
To: Caleb Sander Mateos
Cc: kbusch, hch, sagi, loberman, linux-nvme, linux-kernel, emilne, bgurney
On 3/28/25 3:49 PM, Caleb Sander Mateos wrote:
>> bool multipath = true;
>> +#ifdef CONFIG_NVME_ENABLE_MULTIPATH_PARAM
>> module_param(multipath, bool, 0444);
>> MODULE_PARM_DESC(multipath,
>> "turn on native support for multiple controllers per subsystem");
>> +#endif
> If CONFIG_NVME_ENABLE_MULTIPATH_PARAM is disabled, could you #define
> multipath false in place of the global variable? That would allow the
> compiler to optimize out the multipath checks and the resulting dead
> code.
If we #define multipath to be false that would permanently disable the multipath code
when CONFIG_NVME_ENABLE_MULTIPATH_PARAM=n, and this is not what we want. The purpose
of CONFIG_NVME_ENABLE_MULTIPATH_PARAM=n is to simply remove the core_nvme.multipath
parameter from the kernel so the user no longer has the ability to change
the bool multipath variable. We want multipath to be true.
There should be no change in the multipathing policy or code by
enabling or disabling CONFIG_NVME_ENABLE_MULTIPATH_PARAM.
If you want to compile out the mulipath code you should set CONFIG_NVME_ENABLE_MULTIPATH=n.
/John
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH v3 3/5] nvme: add the NVME_ENABLE_MULTIPATH_PARAM config option
2025-03-31 14:28 ` John Meneghini
@ 2025-03-31 23:55 ` Caleb Sander Mateos
0 siblings, 0 replies; 9+ messages in thread
From: Caleb Sander Mateos @ 2025-03-31 23:55 UTC (permalink / raw)
To: John Meneghini
Cc: kbusch, hch, sagi, loberman, linux-nvme, linux-kernel, emilne, bgurney
On Mon, Mar 31, 2025 at 7:29 AM John Meneghini <jmeneghi@redhat.com> wrote:
>
> On 3/28/25 3:49 PM, Caleb Sander Mateos wrote:
> >> bool multipath = true;
> >> +#ifdef CONFIG_NVME_ENABLE_MULTIPATH_PARAM
> >> module_param(multipath, bool, 0444);
> >> MODULE_PARM_DESC(multipath,
> >> "turn on native support for multiple controllers per subsystem");
> >> +#endif
> > If CONFIG_NVME_ENABLE_MULTIPATH_PARAM is disabled, could you #define
> > multipath false in place of the global variable? That would allow the
> > compiler to optimize out the multipath checks and the resulting dead
> > code.
>
> If we #define multipath to be false that would permanently disable the multipath code
> when CONFIG_NVME_ENABLE_MULTIPATH_PARAM=n, and this is not what we want. The purpose
> of CONFIG_NVME_ENABLE_MULTIPATH_PARAM=n is to simply remove the core_nvme.multipath
> parameter from the kernel so the user no longer has the ability to change
> the bool multipath variable. We want multipath to be true.
Sorry, I just meant to #define multipath to a constant. I mixed up the
boolean value. If CONFIG_NVME_MULTIPATH is set, of course it should be
true, not false. If CONFIG_NVME_MULTIPATH is not set, multipath is
already defined as false.
My point was just that the compiler will pessimistically assume a
global variable with extern visibility could be written from some
other translation unit at any time. But
CONFIG_NVME_ENABLE_MULTIPATH_PARAM removes the only way for the global
variable to change at runtime, so it can just be a constant.
Best,
Caleb
^ permalink raw reply [flat|nested] 9+ messages in thread
* [PATCH v3 4/5] nvme: add NVME_ENABLE_MULTIPATH_PARAM for loongarch
2025-03-28 19:38 [PATCH v3 0/5] nvme: make core.nvme_multipath configurable John Meneghini
` (2 preceding siblings ...)
2025-03-28 19:38 ` [PATCH v3 3/5] nvme: add the NVME_ENABLE_MULTIPATH_PARAM config option John Meneghini
@ 2025-03-28 19:38 ` John Meneghini
2025-03-28 19:38 ` [PATCH v3 5/5] nvme: add NVME_ENABLE_MULTIPATH_PARAM for powerpc skiroot John Meneghini
4 siblings, 0 replies; 9+ messages in thread
From: John Meneghini @ 2025-03-28 19:38 UTC (permalink / raw)
To: kbusch, hch, sagi
Cc: loberman, linux-nvme, linux-kernel, emilne, jmeneghi, bgurney
The add the new CONFIG_NVME_ENABLE_MULTIPATH_PARAM to ensure there is no
change in behavior when CONFIG_NVME_MULTIPATH is true with loongson3
configs.
Signed-off-by: John Meneghini <jmeneghi@redhat.com>
---
arch/loongarch/configs/loongson3_defconfig | 1 +
1 file changed, 1 insertion(+)
diff --git a/arch/loongarch/configs/loongson3_defconfig b/arch/loongarch/configs/loongson3_defconfig
index 73c77500ac46..1ba9ef835fd4 100644
--- a/arch/loongarch/configs/loongson3_defconfig
+++ b/arch/loongarch/configs/loongson3_defconfig
@@ -449,6 +449,7 @@ CONFIG_VIRTIO_BLK=y
CONFIG_BLK_DEV_RBD=m
CONFIG_BLK_DEV_NVME=y
CONFIG_NVME_MULTIPATH=y
+CONFIG_NVME_ENABLE_MULTIPATH_PARAM=y
CONFIG_NVME_RDMA=m
CONFIG_NVME_FC=m
CONFIG_NVME_TCP=m
--
2.48.1
^ permalink raw reply [flat|nested] 9+ messages in thread* [PATCH v3 5/5] nvme: add NVME_ENABLE_MULTIPATH_PARAM for powerpc skiroot
2025-03-28 19:38 [PATCH v3 0/5] nvme: make core.nvme_multipath configurable John Meneghini
` (3 preceding siblings ...)
2025-03-28 19:38 ` [PATCH v3 4/5] nvme: add NVME_ENABLE_MULTIPATH_PARAM for loongarch John Meneghini
@ 2025-03-28 19:38 ` John Meneghini
4 siblings, 0 replies; 9+ messages in thread
From: John Meneghini @ 2025-03-28 19:38 UTC (permalink / raw)
To: kbusch, hch, sagi
Cc: loberman, linux-nvme, linux-kernel, emilne, jmeneghi, bgurney
The add the new CONFIG_NVME_ENABLE_MULTIPATH_PARAM
to ensure there is no change in behavior when
CONFIG_NVME_MULTIPATH is true with skiroot_defconfig.
Signed-off-by: John Meneghini <jmeneghi@redhat.com>
---
arch/powerpc/configs/skiroot_defconfig | 1 +
1 file changed, 1 insertion(+)
diff --git a/arch/powerpc/configs/skiroot_defconfig b/arch/powerpc/configs/skiroot_defconfig
index 9d44e6630908..85d58429a244 100644
--- a/arch/powerpc/configs/skiroot_defconfig
+++ b/arch/powerpc/configs/skiroot_defconfig
@@ -77,6 +77,7 @@ CONFIG_BLK_DEV_RAM_SIZE=65536
CONFIG_VIRTIO_BLK=m
CONFIG_BLK_DEV_NVME=m
CONFIG_NVME_MULTIPATH=y
+CONFIG_NVME_ENABLE_MULTIPATH_PARAM=y
CONFIG_EEPROM_AT24=m
# CONFIG_CXL is not set
# CONFIG_OCXL is not set
--
2.48.1
^ permalink raw reply [flat|nested] 9+ messages in thread