On Wed, Feb 25, 2026 at 03:36:05PM +0000, John Garry wrote:
> For a scsi_device to support multipath, introduce structure
> scsi_mpath_device to hold multipath-specific details.
> 
> Like NS structure for NVME, scsi_mpath_device holds the mpath_device
> structure to device management and path selection.
> 
> Two module params are introduced to enable multipath:
> - scsi_multipath
> - scsi_multipath_always
> 
> SCSI multipath will only be available until the following conditions:
> - scsi_multipath enabled and ALUA supported and unique ID available in
>   VPD page 83.
> - scsi_multipath_always enabled and unique ID available in VPD page 83
> 
> The scsi_device structure contains a pointer to scsi_mpath_device, which
> means whether multipath is enabled or disabled for the scsi_device.
> 
> Signed-off-by: John Garry <[email protected]>
> ---
>  drivers/scsi/Kconfig          |  10 +++
>  drivers/scsi/Makefile         |   1 +
>  drivers/scsi/scsi.c           |   8 +-
>  drivers/scsi/scsi_multipath.c | 158 ++++++++++++++++++++++++++++++++++
>  drivers/scsi/scsi_scan.c      |   4 +
>  drivers/scsi/scsi_sysfs.c     |   2 +
>  include/scsi/scsi_device.h    |   2 +
>  include/scsi/scsi_multipath.h |  55 ++++++++++++
>  8 files changed, 239 insertions(+), 1 deletion(-)
>  create mode 100644 drivers/scsi/scsi_multipath.c
>  create mode 100644 include/scsi/scsi_multipath.h
> 
> diff --git a/drivers/scsi/Kconfig b/drivers/scsi/Kconfig
> index 19d0884479a24..cfab7ad1e3c2c 100644
> --- a/drivers/scsi/Kconfig
> +++ b/drivers/scsi/Kconfig
> @@ -76,6 +76,16 @@ config SCSI_LIB_KUNIT_TEST
>  
>         If unsure say N.
>  
> +config SCSI_MULTIPATH
> +     bool "SCSI multipath support"

At least until this supports ALUA, it should probably be marked
EXPERIMENTAL, just so people trying it out aren't surprised if it
doesn't multipath their device in the way they expect.

-Ben


Reply via email to