public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 00/24] Native SCSI multipath support
@ 2026-02-25 15:36 John Garry
  2026-02-25 15:36 ` [PATCH 01/24] scsi: core: add SCSI_MAX_QUEUE_DEPTH John Garry
                   ` (23 more replies)
  0 siblings, 24 replies; 64+ messages in thread
From: John Garry @ 2026-02-25 15:36 UTC (permalink / raw)
  To: hch, kbusch, sagi, axboe, martin.petersen, james.bottomley, hare
  Cc: jmeneghi, linux-nvme, linux-scsi, michael.christie, snitzer,
	bmarzins, dm-devel, linux-block, linux-kernel, John Garry

This series introduces native SCSI multipath support. It is intended as
an alternative to dm-mpath.

This support aims to provide a multipath-enabled SCSI block device/
gendisk.

For a SCSI device to support native multipath, either of the following
conditions must be satisfied:
a. unique ID in VPD page 83 and ALUA support and scsi_multipath modparam
   enabled
b. unique ID in VPD page 83 and scsi_multipath_always modparam enabled

This series does not support ALUA. That is because the initial upfront
work here is very large, and detangling the ALUA support from SCSI DH code
is a lot effort at this point. ALUA support will be added once consensus
is agreed on for other aspects of the design.

New classes of devices are added:
- scsi_mpath_device
- scsi_mpath_disk

These are required since a multipath scsi_device has no common scsi host.
An example of the sysfs files and directories for these new classes is as
follows:

$ ls -l /sys/class/scsi_mpath_device/0/
total 0
-rw-r--r--    1 root     root          4096 Feb 25 11:59 iopolicy
drwxr-xr-x    2 root     root             0 Feb 25 11:59 multipath
drwxr-xr-x    2 root     root             0 Feb 25 11:59 power
lrwxrwxrwx    1 root     root             0 Feb 25 11:59 subsystem ->
../../../../class/scsi_mpath_device
-rw-r--r--    1 root     root          4096 Feb 25 11:58 uevent
-r--r--r--    1 root     root          4096 Feb 25 11:59 wwid
$ ls -l /sys/class/scsi_mpath_device/0/multipath/
total 0
lrwxrwxrwx    1 root     root             0 Feb 25 11:59 8:0:0:0 ->
../../../../platform/host8/session1/target8:0:0/8:0:0:0
lrwxrwxrwx    1 root     root             0 Feb 25 11:59 9:0:0:0 ->
../../../../platform/host9/session2/target9:0:0/9:0:0:0
$ cat /sys/class/scsi_mpath_device/0/wwid
naa.600140505200a986f0043c9afa1fd077
$ cat /sys/class/scsi_mpath_device/0/iopolicy
numa
$

$ ls -l /sys/class/scsi_mpath_disk/0/
total 0
drwxr-xr-x    2 root     root             0 Feb 25 12:00 power
drwxr-xr-x   11 root     root             0 Feb 25 11:58 sdc
lrwxrwxrwx    1 root     root             0 Feb 25 11:58 subsystem ->
../../../../class/scsi_mpath_disk
-rw-r--r--    1 root     root          4096 Feb 25 11:58 uevent
$ ls -l /sys/class/scsi_mpath_disk/0/sdc/multipath/
total 0
lrwxrwxrwx    1 root     root             0 Feb 25 12:00 sdc:0 ->
../../../../../platform/host8/session1/target8:0:0/8:0:0:0/block/sdc:0
lrwxrwxrwx    1 root     root             0 Feb 25 12:00 sdc:1 ->
../../../../../platform/host9/session2/target9:0:0/9:0:0:0/block/sdc:1

$ ls -l /dev/sdc
brw-rw----    1 root     disk        8,  32 Feb 25 11:58 /dev/sdc

The scsi_device and scsi_disk classes otherwise remain unmodified.
However, the per-path block device is hidden in /dev/. Furthermore,
multipathed block devices have a new naming scheme, sdX:Y, where
X is the scsi multipath device index and Y is the path index.

I am not too happy about the naming/indexing of the new devices, so
suggestions welcome for alternatives.

No multipath sg support is added. We still have a per-path sg device.
Since the SCSI block device is multipath enabled, we can access
multipathed scsi_ioctl() through that block device.

For failover, we take the approach of cloning bio's and re-submitting them
in full.

Series also available at https://github.com/johnpgarry/linux/commits/scsi-multipath-pre-7.0-upstream/

John Garry (24):
  scsi: core: add SCSI_MAX_QUEUE_DEPTH
  scsi-multipath: introduce basic SCSI device support
  scsi-multipath: introduce scsi_device head structure
  scsi-multipath: introduce scsi_mpath_device_class
  scsi-multipath: provide sysfs link from to scsi_device
  scsi-multipath: support iopolicy
  scsi-multipath: clone each bio
  scsi-multipath: clear path when decide is blocked
  scsi-multipath: failover handling
  scsi-multipath: add scsi_mpath_{start,end}_request()
  scsi-multipath: add scsi_mpath_ioctl()
  scsi-multipath: provide callbacks for path state
  scsi-multipath: set disk device_groups
  scsi-multipath: add PR support
  scsi: sd: refactor PR ops
  scsi: sd: add multipath disk class
  scsi: sd: add sd_mpath_{start,end}_command()
  scsi: sd: add sd_mpath_ioctl()
  scsi: sd: add multipath PR support
  scsi: sd: add sd_mpath_to_disk()
  scsi: sd: support multipath disk
  scsi: sd: add mpath_dev file
  scsi: sd: add mpath_numa_nodes dev attribute
  scsi: sd: add mpath_queue_depth dev attribute

 drivers/scsi/Kconfig          |  10 +
 drivers/scsi/Makefile         |   1 +
 drivers/scsi/scsi.c           |  10 +-
 drivers/scsi/scsi_error.c     |  12 +
 drivers/scsi/scsi_lib.c       |  16 +-
 drivers/scsi/scsi_multipath.c | 789 ++++++++++++++++++++++++++++++++++
 drivers/scsi/scsi_priv.h      |   2 +
 drivers/scsi/scsi_scan.c      |   4 +
 drivers/scsi/scsi_sysfs.c     |  10 +
 drivers/scsi/sd.c             | 731 +++++++++++++++++++++++++++++--
 drivers/scsi/sd.h             |   3 +
 include/scsi/scsi.h           |   1 +
 include/scsi/scsi_cmnd.h      |   5 +
 include/scsi/scsi_device.h    |   2 +
 include/scsi/scsi_driver.h    |   8 +
 include/scsi/scsi_multipath.h | 156 +++++++
 16 files changed, 1720 insertions(+), 40 deletions(-)
 create mode 100644 drivers/scsi/scsi_multipath.c
 create mode 100644 include/scsi/scsi_multipath.h

-- 
2.43.5


^ permalink raw reply	[flat|nested] 64+ messages in thread

end of thread, other threads:[~2026-03-10 15:19 UTC | newest]

Thread overview: 64+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-02-25 15:36 [PATCH 00/24] Native SCSI multipath support John Garry
2026-02-25 15:36 ` [PATCH 01/24] scsi: core: add SCSI_MAX_QUEUE_DEPTH John Garry
2026-03-03  6:52   ` Hannes Reinecke
2026-03-03  7:45     ` John Garry
2026-02-25 15:36 ` [PATCH 02/24] scsi-multipath: introduce basic SCSI device support John Garry
2026-03-02  2:16   ` Benjamin Marzinski
2026-03-02 11:33     ` John Garry
2026-03-02  2:22   ` Benjamin Marzinski
2026-03-02 11:39     ` John Garry
2026-03-03  5:39       ` Benjamin Marzinski
2026-03-03  8:01         ` Hannes Reinecke
2026-03-03 14:20           ` Benjamin Marzinski
2026-03-05 15:59           ` John Garry
2026-03-03  6:57   ` Hannes Reinecke
2026-03-03  7:45     ` John Garry
2026-02-25 15:36 ` [PATCH 03/24] scsi-multipath: introduce scsi_device head structure John Garry
2026-03-02  2:50   ` Benjamin Marzinski
2026-03-02 12:00     ` John Garry
2026-03-03  7:13   ` Hannes Reinecke
2026-03-03  7:50     ` John Garry
2026-02-25 15:36 ` [PATCH 04/24] scsi-multipath: introduce scsi_mpath_device_class John Garry
2026-03-02  2:54   ` Benjamin Marzinski
2026-03-02 12:01     ` John Garry
2026-03-03  7:16   ` Hannes Reinecke
2026-03-03 10:53     ` John Garry
2026-02-25 15:36 ` [PATCH 05/24] scsi-multipath: provide sysfs link from to scsi_device John Garry
2026-03-03  7:19   ` Hannes Reinecke
2026-03-03 10:49     ` John Garry
2026-02-25 15:36 ` [PATCH 06/24] scsi-multipath: support iopolicy John Garry
2026-02-25 15:36 ` [PATCH 07/24] scsi-multipath: clone each bio John Garry
2026-03-02  3:21   ` Benjamin Marzinski
2026-03-02 12:12     ` John Garry
2026-03-02 16:27       ` Benjamin Marzinski
2026-03-02 17:16         ` John Garry
2026-02-25 15:36 ` [PATCH 08/24] scsi-multipath: clear path when decide is blocked John Garry
2026-02-25 15:36 ` [PATCH 09/24] scsi-multipath: failover handling John Garry
2026-03-02  3:57   ` Benjamin Marzinski
2026-03-02 12:20     ` John Garry
2026-03-04  5:46   ` Benjamin Marzinski
2026-03-04 11:11     ` John Garry
2026-02-25 15:36 ` [PATCH 10/24] scsi-multipath: add scsi_mpath_{start,end}_request() John Garry
2026-03-02  4:08   ` Benjamin Marzinski
2026-03-02 12:20     ` John Garry
2026-03-04  6:13   ` Benjamin Marzinski
2026-03-04 11:11     ` John Garry
2026-03-05  2:37       ` Benjamin Marzinski
2026-02-25 15:36 ` [PATCH 11/24] scsi-multipath: add scsi_mpath_ioctl() John Garry
2026-02-25 15:36 ` [PATCH 12/24] scsi-multipath: provide callbacks for path state John Garry
2026-03-03  5:31   ` Benjamin Marzinski
2026-02-25 15:36 ` [PATCH 13/24] scsi-multipath: set disk device_groups John Garry
2026-02-25 15:36 ` [PATCH 14/24] scsi-multipath: add PR support John Garry
2026-02-25 15:36 ` [PATCH 15/24] scsi: sd: refactor PR ops John Garry
2026-02-25 15:36 ` [PATCH 16/24] scsi: sd: add multipath disk class John Garry
2026-02-25 15:36 ` [PATCH 17/24] scsi: sd: add sd_mpath_{start,end}_command() John Garry
2026-02-25 15:36 ` [PATCH 18/24] scsi: sd: add sd_mpath_ioctl() John Garry
2026-02-25 15:36 ` [PATCH 19/24] scsi: sd: add multipath PR support John Garry
2026-02-25 15:36 ` [PATCH 20/24] scsi: sd: add sd_mpath_to_disk() John Garry
2026-02-25 15:36 ` [PATCH 21/24] scsi: sd: support multipath disk John Garry
2026-03-10  2:40   ` Benjamin Marzinski
2026-03-10 10:12     ` John Garry
2026-03-10 15:19       ` Benjamin Marzinski
2026-02-25 15:36 ` [PATCH 22/24] scsi: sd: add mpath_dev file John Garry
2026-02-25 15:36 ` [PATCH 23/24] scsi: sd: add mpath_numa_nodes dev attribute John Garry
2026-02-25 15:36 ` [PATCH 24/24] scsi: sd: add mpath_queue_depth " John Garry

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox