Skip to contentSkip to conversation

0/6 2.5.44 scsi multi-path IO

PATCH New Patrick Mansfield 1 participant 7 messages Oct 25, 2002

Subsystems (9)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 0/6 2.5.44 scsi multi-path IO

Hi -

Following is the SCSI mid-layer multi-path patch against 2.5.44, including NUMA support.

Any flames, comments, patches, etc. appreciated.

This note, the multi-path patch rollup, qla 6.03.00 Beta 7 patch, out of date documentation, and TODO list can be found under:

http://www-124.ibm.com/storageio/multipath/scsi-multipath/index.php

One rollup patch:

http://www-124.ibm.com/storageio/multipath/scsi-multipath/releases/0.5/patch-scsi_mpath_rollup-2.5.44-0.5.gz

The qla 6.03.00 Beta 7 driver (for use with the Qlogic 2200 or 2300) can be found under:

http://www.qlogic.com/support/os_detail.asp?seriesid=76&osid=26

Or directly at:

http://download.qlogic.com/drivers/6443/qla2x00-v6.03.00b7-dist.tgz

Major changes since last posting:

Made multi-path an experimental option - with it on, all SCSI devices must have a unique id, and all adapter drivers used must behave correctly without the current one-to-one relationship between Scsi_Device and a Scsi_Host.

Removed duplicate code paths. The same code paths are used whether CONFIG_SCSI_MULTI_PATH_IO is set or not; with it off, it does not check or add multiple paths on scan/probe, but the same code is otherwise used.

Optimized the IO completion path (don't call scsi_check_paths for a succesfull IO completion).

Most significant TODO items affecting non-multi-path config:

Never remove a failed path, so the standard scsi error handling code functions as-is.

Modify all adapter drivers to use new traversal functions (they must no longer use Scsi_Host::host_queue and/or Scsi_Device::next).

Modify osst upper level driver.

As noted - the config experimental CONFIG_SCSI_MULTI_PATH_IO option must be enabled to get SCSI multi-path.

If you have multi-port devices with no penalty for switching ports, or only multi-path hosts (multi-initiated fabrics or busses), use round-robin multipath routing (CONFIG_SCSI_PATH_POLICY_RR); if you are unsure, use the last path used selection (CONFIG_SCSI_PATH_POLICY_LPU).

Currently, multi-path support requires a SCSI device that supports one of the SCSI INQUIRY device identification pages (page 0x80 or 0x83). Devices not supporting one of these pages are treated as if they were separate devices. Devices that do not give a unique serial number per LUN for these commands might incorrectly be identified as multi-pathed.

NUMA testing and performance:

NUMA testing was run on a two node IBM NUMAQ box, with qlogic 2300 adapters and FCP connected Seagate drives. The qla driver has problems (use after freed or stack overflow problems?) when configuring many devices and adapters on a switch, so I had to run with direct attached loop.

On a two node (8 processor) IBM NUMAQ box, with 39 drives and 8 qla 2300 adapters, get aggregate throughput (read only using dd and raw IO) of up to 550 mb/sec was reached. I was actually able to compile a kernel at the same time in under 3 minutes (make -j9) while still getting about 500 mb/sec of throughput.

Both stock 2.5.44 and 2.5.44-mm3 kernels were run on the NUMAQ + multi-path, with no noticeable difference in performance (but the system was very idle, in iowait most of the time).

Unfortunately, high file systems loads with the qla driver were oopsing the system in odd ways with 2.5.44-mm3 - this is also happening for 2.5.44-mm3 stock kernels with the qla driver, there is some odd memory corruption happening. I did run fairly file system IO tests with 2.5.44 + multi-path with 17 of the qla attached drives.

Other testing:

Tests were run with an IBM 3542 (fibre channel disk array) as well as dual-ported FCP Seagate drives (ST39173F, in a Clariion DAE), with both direct and and switch attached storage (using an IBM 2109 fibre channel switch) with both qlogic 2200 and 2300 adapters.

Switch portdisable/portenable commands were used to simulate failures. The qla driver is taking longer to fail commands than with previous releases. The /proc/scsi/scsi_path/paths interface was used to re-enable failed paths.

In addition, systems were booted (with only single paths to devices) using:

Adaptec 7896 with the aic7xxx driver, with IBM-PSG ST318203LC disks IPS adapter and driver
isp1020 adatper with qlogicisp driver and IBM OEM DCHS09X drive

Simple single path tape IO was tested using a ISP1020 adapter with the qlogicisp driver, and a single DLT drive.

CD read tests were run using a Plextor CD-RW attached to an aic7896.

No tests were run using multiple paths (multiple initiators or dual ported devices) on any SCSI parallel interfaces (such as the aic or qlogic isp).

No testing was run using the qlogicfc driver (tests were run previously with 2.5.14 and the 0.1 version of this patch, but no tests have been run with this current patch).

Significant items in the TODO list related to multi-path configuration (versus single path items listed above) include:

separating queue_lock from host_lock - likely create a Scsi_Device::lock

add SMP locking while manipulating paths (the solution is likely to use a Scsi_Device::lock as a queue_lock and for multi-path) - without this problems can occur when a path state is changed at the same time IO is being sent (the BUG_ON in scsi_get_best_path can be hit).

fix the error handling code - currently, if all paths fail, the error handler will run but not be able to retry any IO. A first pass solution will be to run the current error handler after the last path to a devic has failed; this is likely inadequate in the long run.

Apply Dan Mcneil's patch to add device model support for multiple-paths (at this time, only the first path shows up in the device model),

-- Patrick Mansfield

#1 lore raw

PATCH 1/1 1/6 2.5.44 scsi multi-path IO - mid layer changes

SCSI mid-layer multi-path IO changes

 Config.help  |   22 +++
 Config.in    |   11 +
 Makefile     |    2 
 hosts.c      |  107 ++++++++------
 hosts.h      |   35 +---
 scsi.c       |  421 +++++++++++++++++++++++++++++------------------------------
 scsi.h       |  152 +++++++++++++++++++--
 scsi_error.c |  361 +++++++++++++++-----------------------------------
 8 files changed, 570 insertions(+), 541 deletions(-)
drivers/scsi/Config.help +22 -0
diff -Nru a/drivers/scsi/Config.help b/drivers/scsi/Config.help
@@ -152,6 +152,28 @@
   REPORT LUNS scanning is done only for SCSI-3 devices. Most users can safely
   answer N here.
 
+CONFIG_SCSI_MULTI_PATH_IO
+  If your system contains SCSI host adapters connecting into a shared
+  transport, or you have storage devices that have multiple ports, and
+  you are using an adapter that properly supports multiple paths, and your
+  storage devices support unique id's (unique serial numbers) say Y
+  here to enable the multiple paths/ports to be merged into one mid layer
+  SCSI device.
+
+  If you are unsure if your system can properly support this
+  capability or that your devices have this capability say N.
+
+CONFIG_SCSI_PATH_POLICY_LPU 
+  When CONFIG_SCSI_MULTI_PATH_IO is selected this option sets the path
+  selection policy. 
+
+  The last path used policy only uses another path after a path failure.
+
+  The round robin policy round robins across all active paths.
+
+  The last path used policy is the safest path policy to select if you
+  cannot determine the best path policy for your storage device.
+
 CONFIG_SCSI_CONSTANTS
   The error messages regarding your SCSI hardware will be easier to
   understand if you say Y here; it will enlarge your kernel by about
drivers/scsi/Config.in +10 -1
diff -Nru a/drivers/scsi/Config.in b/drivers/scsi/Config.in
@@ -22,7 +22,16 @@
 
 bool '  Probe all LUNs on each SCSI device' CONFIG_SCSI_MULTI_LUN
 bool '  Build with SCSI REPORT LUNS support' CONFIG_SCSI_REPORT_LUNS
-  
+
+if [ "$CONFIG_EXPERIMENTAL" = "y" ]; then
+	bool '  Enable Mid Layer Multi-Path IO support (EXPERIMENTAL)' CONFIG_SCSI_MULTI_PATH_IO
+	if [ "$CONFIG_SCSI_MULTI_PATH_IO" != "n" ] ; then
+	     choice ' Multipath Routing algorithim'			\
+		 "LastPathUsed		CONFIG_SCSI_PATH_POLICY_LPU	\
+		  RoundRobin		CONFIG_SCSI_PATH_POLICY_RR"	\
+		LastPathUsed
+	fi
+fi
 bool '  Verbose SCSI error reporting (kernel size +=12K)' CONFIG_SCSI_CONSTANTS
 bool '  SCSI logging facility' CONFIG_SCSI_LOGGING
 
drivers/scsi/Makefile +1 -1
diff -Nru a/drivers/scsi/Makefile b/drivers/scsi/Makefile
@@ -123,7 +123,7 @@
 
 scsi_mod-objs	:= scsi.o hosts.o scsi_ioctl.o constants.o scsicam.o \
 			scsi_proc.o scsi_error.o scsi_lib.o scsi_merge.o \
-			scsi_scan.o scsi_syms.o
+			scsi_scan.o scsi_syms.o scsi_paths.o
 			
 sd_mod-objs	:= sd.o
 sr_mod-objs	:= sr.o sr_ioctl.o sr_vendor.o
drivers/scsi/hosts.c +64 -43

173 lines not on this page · raw message

drivers/scsi/hosts.h +9 -26
diff -Nru a/drivers/scsi/hosts.h b/drivers/scsi/hosts.h
@@ -27,6 +27,7 @@
 #include <linux/config.h>
 #include <linux/proc_fs.h>
 #include <linux/pci.h>
+#include <linux/mm.h>
 
 /* It is senseless to set SG_ALL any higher than this - the performance
  *  does not get any better, and it wastes memory
@@ -373,7 +374,6 @@
      * struct private is a way of marking it in a sort of C++ type of way.
      */
     struct list_head      sh_list;
-    Scsi_Device           * host_queue;
     struct list_head	  all_scsi_hosts;
     struct list_head	  my_devices;
 
@@ -551,9 +551,6 @@
 {
 	shost->pci_dev = pdev;
 	shost->host_driverfs_dev.parent=&pdev->dev;
-
-	/* register parent with driverfs */
-	device_register(&shost->host_driverfs_dev);
 }
 
 
@@ -592,7 +589,14 @@
 };
 
 void  scsi_initialize_queue(Scsi_Device *, struct Scsi_Host *);
-
+#if defined(CONFIG_NUMA)
+int scsihost_to_node(struct Scsi_Host *host);
+#else
+static inline int scsihost_to_node(struct Scsi_Host *host) 
+{ 
+	return 0; 
+}
+#endif
 
 /*
  * Driver registration/unregistration.
@@ -640,27 +644,6 @@
 #define SD_EXTRA_DEVS CONFIG_SD_EXTRA_DEVS
 #define SR_EXTRA_DEVS CONFIG_SR_EXTRA_DEVS
 
-
-/**
- * scsi_find_device - find a device given the host
- * @shost:	SCSI host pointer
- * @channel:	SCSI channel (zero if only one channel)
- * @pun:	SCSI target number (physical unit number)
- * @lun:	SCSI Logical Unit Number
- **/
-static inline Scsi_Device *scsi_find_device(struct Scsi_Host *shost,
-                                            int channel, int pun, int lun) {
-        Scsi_Device *sdev;
-
-        for (sdev = shost->host_queue;
-            sdev != NULL;
-            sdev = sdev->next)
-                if (sdev->channel == channel && sdev->id == pun
-                   && sdev->lun ==lun)
-                        break;
-        return sdev;
-}
-    
 #endif
 /*
  * Overrides for Emacs so that we follow Linus's tabbing style.
drivers/scsi/scsi.c +210 -211

723 lines not on this page · raw message

drivers/scsi/scsi.h +141 -11

278 lines not on this page · raw message

drivers/scsi/scsi_error.c +113 -248

479 lines not on this page · raw message

#2 lore raw

PATCH 1/1 2/6 2.5.44 scsi multi-path IO - mid layer changes

SCSI mid-layer multi-path IO changes

 scsi_ioctl.c |   62 +-
 scsi_lib.c   |  348 ++++++++-----
 scsi_merge.c |   57 ++
 scsi_paths.c | 1499 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 4 files changed, 1827 insertions(+), 139 deletions(-)
drivers/scsi/scsi_ioctl.c +45 -17
diff -Nru a/drivers/scsi/scsi_ioctl.c b/drivers/scsi/scsi_ioctl.c
@@ -129,10 +129,15 @@
 				break;
 			}
 		default:	/* Fall through for non-removable media */
-			printk("SCSI error: host %d id %d lun %d return code = %x\n",
-			       dev->host->host_no,
-			       dev->id,
-			       dev->lun,
+			/*
+			 * This is a bit klugey, since we rely on SRpnt
+			 * to contain the scsi_cmnd for the IO.
+			 */
+			printk("SCSI error: host %d channel %d id %d lun %d return code = %x\n",
+			       SRpnt->sr_command->host->host_no,
+			       SRpnt->sr_command->channel,
+			       SRpnt->sr_command->target,
+			       SRpnt->sr_command->lun,
 			       SRpnt->sr_result);
 			printk("\tSense class %x, sense error %x, extended sense %x\n",
 			       sense_class(SRpnt->sr_sense_buffer[0]),
@@ -214,6 +219,7 @@
 	char *cmd_in;
 	Scsi_Request *SRpnt;
 	Scsi_Device *SDpnt;
+	struct Scsi_Host *SHpnt;
 	unsigned char opcode;
 	unsigned int inlen, outlen, cmdlen;
 	unsigned int needed, buf_needed;
@@ -223,7 +229,9 @@
 	if (!sic)
 		return -EINVAL;
 
-	if (dev->host->unchecked_isa_dma)
+	if ((SHpnt = scsi_get_host(dev)) == NULL)
+		return -ENODEV;
+	if (SHpnt->unchecked_isa_dma)
 		gfp_mask |= GFP_DMA;
 
 	/*
@@ -395,10 +403,16 @@
 static int
 scsi_ioctl_get_pci(Scsi_Device * dev, void *arg)
 {
+	struct Scsi_Host *SHpnt;
 
-        if (!dev->host->pci_dev) return -ENXIO;
-        return copy_to_user(arg, dev->host->pci_dev->slot_name,
-                            sizeof(dev->host->pci_dev->slot_name));
+	/*
+	 * XXX this ioctl should be replaced by a host specific interface
+	 */ 
+	if ((SHpnt = scsi_get_host(dev)) == NULL)
+		return -ENODEV;
+        if (!SHpnt->pci_dev) return -ENXIO;
+        return copy_to_user(arg, SHpnt->pci_dev->slot_name,
+                            sizeof(SHpnt->pci_dev->slot_name));
 }
 
 
@@ -410,6 +424,8 @@
 int scsi_ioctl(Scsi_Device * dev, int cmd, void *arg)
 {
 	char scsi_cmd[MAX_COMMAND_SIZE];
+	struct scsi_path_id scsi_path;
+	struct Scsi_Host *SHpnt;
 
 	/* No idea how this happens.... */
 	if (!dev)
@@ -430,15 +446,23 @@
 		if (verify_area(VERIFY_WRITE, arg, sizeof(Scsi_Idlun)))
 			return -EFAULT;
 
-		__put_user((dev->id & 0xff)
-			 + ((dev->lun & 0xff) << 8)
-			 + ((dev->channel & 0xff) << 16)
-			 + ((dev->host->host_no & 0xff) << 24),
+		/*
+		 * Just get first path, and use its
+		 * id/lun/channel/host_no. This is fine for single path
+		 * devices, or when no multi-path IO.
+		 */
+		scsi_get_path(dev, &scsi_path);
+		__put_user((scsi_path.spi_id & 0xff)
+			 + ((scsi_path.spi_lun & 0xff) << 8)
+			 + ((scsi_path.spi_channel & 0xff) << 16)
+			 + ((scsi_path.spi_shpnt->host_no & 0xff) << 24),
 			 &((Scsi_Idlun *) arg)->dev_id);
-		__put_user(dev->host->unique_id, &((Scsi_Idlun *) arg)->host_unique_id);
+		__put_user(scsi_path.spi_shpnt->unique_id, &((Scsi_Idlun *) arg)->host_unique_id);
 		return 0;
 	case SCSI_IOCTL_GET_BUS_NUMBER:
-		return put_user(dev->host->host_no, (int *) arg);
+		if ((SHpnt = scsi_get_host(dev)) == NULL)
+			return -ENODEV;
+		return put_user(SHpnt->host_no, (int *) arg);
 	/*
 	 * The next two ioctls either need to go or need to be changed to
 	 * pass tagged queueing changes through the low level drivers.
@@ -464,7 +488,9 @@
 		dev->current_tag = 0;
 		return 0;
 	case SCSI_IOCTL_PROBE_HOST:
-		return ioctl_probe(dev->host, arg);
+		if ((SHpnt = scsi_get_host(dev)) == NULL)
+			return -ENODEV;
+		return ioctl_probe(SHpnt, arg);
 	case SCSI_IOCTL_SEND_COMMAND:
 		if (!capable(CAP_SYS_ADMIN) || !capable(CAP_SYS_RAWIO))
 			return -EACCES;
@@ -502,8 +528,10 @@
                 return scsi_ioctl_get_pci(dev, arg);
                 break;
 	default:
-		if (dev->host->hostt->ioctl)
-			return dev->host->hostt->ioctl(dev, cmd, arg);
+		if ((SHpnt = scsi_get_host(dev)) == NULL)
+			return -ENODEV;
+		if (SHpnt->hostt->ioctl)
+			return SHpnt->hostt->ioctl(dev, cmd, arg);
 		return -EINVAL;
 	}
 	return -EINVAL;
drivers/scsi/scsi_lib.c +227 -121

552 lines not on this page · raw message

drivers/scsi/scsi_merge.c +56 -1

78 lines not on this page · raw message

drivers/scsi/scsi_paths.c new file +1499 -0

1,499 lines not on this page · raw message

#3 lore raw

PATCH 1/1 3/6 2.5.44 scsi multi-path IO - mid layer changes

SCSI mid-layer multi-path IO changes

 drivers/scsi/scsi_paths.h |  146 ++++++++++++++++
 drivers/scsi/scsi_proc.c  |    8 
 drivers/scsi/scsi_scan.c  |  408 +++++++++++++++++++++++++++-------------------
 drivers/scsi/scsi_syms.c  |    7 
 include/scsi/scsi.h       |   23 ++
 5 files changed, 422 insertions(+), 170 deletions(-)
drivers/scsi/scsi_paths.h new file +146 -0
diff -Nru a/drivers/scsi/scsi_paths.h b/drivers/scsi/scsi_paths.h
@@ -0,0 +1,146 @@
+/*
+ * Scsi Multi-path Support Library
+ *
+ * Copyright (c) 2002 IBM
+ *
+ * All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or (at
+ * your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, GOOD TITLE or
+ * NON INFRINGEMENT.  See the GNU General Public License for more
+ * details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ *
+ * Send feedback to <[email protected]> and/or [email protected]
+ */
+
+#ifndef _SCSI_PATHS_H
+#define _SCSI_PATHS_H
+
+#include <linux/list.h>
+/*
+ * XXX asm/mmzone.h holds the xxx_to_nid and other information needed, but
+ * right now it is x86 specific, as well as patch specific, so a way is
+ * needed to correctly include it (rather than conditionally). The
+ * asm-i386 mmzone.h is created as part of the topo patch, and xxx_to_nid
+ * api's are added by pdorwin patch. The following is ugly and not even
+ * correct, since CONFIG_X86_NUMAQ means build for IBM NUMAQ box, it does
+ * not mean the API or even asm/mmzone.h exist.
+ */
+#ifdef CONFIG_X86_NUMAQ
+#include <asm/mmzone.h>
+#endif
+
+
+#if !defined(MAX_NUMNODES) || (MAX_NUMNODES == 0)
+#error Undefined or unexpected value of MAX_NUMNODES
+#endif
+
+#if MAX_NUMNODES == 1
+/*
+ * No NUMA support is configured or no NUMA patches. Use one
+ * last active pointer (SCSI_MAX_ACTIVE_LIST), and have one
+ * (SCSI_PATHS_MAX_PATH_LISTS) list of active paths.
+ */
+#define SCSI_MAX_ACTIVE_LIST	1
+#define SCSI_PATHS_MAX_PATH_LISTS	1
+#define req_to_nid(req)	0
+#define scsihost_to_node(host)	0
+#define	page_to_nid(page)	0
+#else
+/*
+ * NUMA support is configured, use one last active pointer per maximum
+ * number of nodes plus one last active pointer for all paths
+ * (SCSI_MAX_ACTIVE_LIST), and have two lists of paths
+ * (SCSI_PATHS_MAX_PATH_LISTS) - one for all paths and one for node local
+ * paths.
+ */
+#define SCSI_MAX_ACTIVE_LIST	(MAX_NUMNODES + 1)
+#define SCSI_PATHS_MAX_PATH_LISTS	2
+
+/*
+ * XXX use a real page_to_nid() API.
+ */
+#define page_to_nid(page) pfn_to_nid(page_to_pfn(page))
+/*
+ * FIXME This does not properly handle requests with req->bio NULL, these are
+ * generated via scsi_do_req calls. Fix this by putting a node number in the
+ * request, and have scsi_do_req() and __make_request() set req->node.
+ */
+#define req_to_nid(req)	\
+	(((req)->bio == NULL) ? 0 : page_to_nid(bio_page((req)->bio)))
+#endif
+
+#define SCSI_PATHS_ALL_LIST	(SCSI_MAX_ACTIVE_LIST - 1)
+
+#define SCSI_ALL_ACTIVE_NEXT_LIST	0
+#define SCSI_NID_ACTIVE_NEXT_LIST	1
+
+/**
+ * enum scsi_path_policy - Path selection policy.
+ * @SCSI_PATH_POLICY_LPU: Use the same path that was used for the last IO
+ * @SCSI_PATH_POLICY_ROUND_ROBIN: Round robin across all active paths
+ **/
+enum scsi_path_policy {
+	SCSI_PATH_POLICY_LPU = 1,
+	SCSI_PATH_POLICY_ROUND_ROBIN
+};
+
+/**
+ * enum scsi_path_state - Path state flags
+ * @SCSI_PATH_STATE_GOOD: The path is active for IO.
+ * @SCSI_PATH_STATE_FAILING: The path might be failing (XXX not fully
+ * implemented yet)
+ * @SCSI_PATH_STATE_DEAD: The path has failed.
+ **/
+enum scsi_path_state {
+	SCSI_PATH_STATE_GOOD = 1,
+	SCSI_PATH_STATE_FAILING,
+	SCSI_PATH_STATE_DEAD
+};
+
+/**
+ * struct scsi_path - A single scsi path
+ * @sp_path_list: list head for all paths
+ * @sp_active_next: circular list of all active paths, list at 0 is for all
+ * active paths, the list at 1 for all active paths on a given node id.
+ * @sp_path_id: id of path (host/channel/target/lun)
+ * @sp_state: state of path
+ * @sp_failures: number of failures on this path
+ * @sp_weight: path weight 0 best, higher values worse (XXX path weighting
+ * is not implemented, for now setting this has no affect)
+ **/
+struct scsi_path {
+	struct list_head sp_path_list;
+	struct scsi_path *sp_active_next[SCSI_PATHS_MAX_PATH_LISTS];
+	struct scsi_path_id sp_path_id;
+	enum scsi_path_state sp_state;
+	unsigned int sp_failures;
+	unsigned int sp_weight;
+};
+
+/**
+ * struct scsi_mpath - All paths for a scsi device
+ * @scsi_mp_paths: list of scsi paths
+ * @scsi_mp_last_active: last active path used, one for each node, plus
+ * one for the all active list.
+ * @scsi_mp_path_policy: path selection policy - round robin or last used
+ * @scsi_mp_path_active_cnt: number of paths XXX change to an array
+ **/
+struct scsi_mpath {
+	struct list_head scsi_mp_paths_head;
+	struct scsi_path *scsi_mp_last_active[SCSI_MAX_ACTIVE_LIST];
+	unsigned int scsi_mp_path_active_cnt[SCSI_MAX_ACTIVE_LIST];
+	enum scsi_path_policy scsi_mp_path_policy;
+};
+
+#endif
drivers/scsi/scsi_proc.c +4 -4
diff -Nru a/drivers/scsi/scsi_proc.c b/drivers/scsi/scsi_proc.c
@@ -264,15 +264,15 @@
 	return (cmdIndex);
 }
 
-void proc_print_scsidevice(Scsi_Device * scd, char *buffer, int *size, int len)
+void proc_print_scsidevice(Scsi_Device *scd, char *buffer, int *size, int len)
 {
 
 	int x, y = *size;
 	extern const char *const scsi_device_types[MAX_SCSI_DEVICE_CODE];
 
-	y = sprintf(buffer + len,
-	     "Host: scsi%d Channel: %02d Id: %02d Lun: %02d\n  Vendor: ",
-		    scd->host->host_no, scd->channel, scd->id, scd->lun);
+	y = scsi_paths_proc_print_paths(scd, buffer + len,
+		"Host: scsi%d Channel: %02d Id: %02d Lun: %02d\n");
+	y += sprintf(buffer + len + y, "Vendor: ");
 	for (x = 0; x < 8; x++) {
 		if (scd->vendor[x] >= 0x20)
 			y += sprintf(buffer + len + y, "%c", scd->vendor[x]);
drivers/scsi/scsi_scan.c +242 -166

757 lines not on this page · raw message

drivers/scsi/scsi_syms.c +7 -0
diff -Nru a/drivers/scsi/scsi_syms.c b/drivers/scsi/scsi_syms.c
@@ -71,6 +71,7 @@
 
 EXPORT_SYMBOL(scsi_get_host_dev);
 EXPORT_SYMBOL(scsi_free_host_dev);
+EXPORT_SYMBOL(scsi_sdev_list);
 
 EXPORT_SYMBOL(scsi_sleep);
 
@@ -105,6 +106,12 @@
 EXPORT_SYMBOL(scsi_add_timer);
 EXPORT_SYMBOL(scsi_delete_timer);
 
+EXPORT_SYMBOL(scsi_add_path);
+EXPORT_SYMBOL(scsi_remove_path);
+EXPORT_SYMBOL(scsi_get_path);
+EXPORT_SYMBOL(scsi_get_host);
+EXPORT_SYMBOL(scsi_paths_printk);
+EXPORT_SYMBOL(scsi_traverse_sdevs);
 /*
  * driverfs support for determining driver types
  */
include/scsi/scsi.h +23 -0
diff -Nru a/include/scsi/scsi.h b/include/scsi/scsi.h
@@ -91,6 +91,29 @@
 #define WRITE_LONG_2          0xea
 
 /*
+ * SCSI INQUIRY Flags (byte 7)
+ */
+#define SCSI_EVPD       0x01   /* enable vital product data */
+#define SCSI_RMB7       0x80   /* removable media */
+#define SCSI_AENC       0x80   /* asynchronous event notification capability */
+#define SCSI_TRMIOP     0x40   /* terminate I/O process capability */
+#define SCSI_RELADR7    0x80   /* relative addressing capability */
+#define SCSI_WBUS16     0x20   /* 16 byte wide transfer capabilitiy */
+#define SCSI_WBUS32     0x40   /* 32 byte wide transfer capabilitiy */
+#define SCSI_SYNC       0x10   /* synchronous data transfer capability */
+#define SCSI_LINKED     0x08   /* linked command capability */
+#define SCSI_CMDQUE     0x02   /* command queueing capability */
+#define SCSI_SFTRE      0x01   /* soft reset capability */
+
+/*
+ * SCSI INQUIRY Vital Product Data Page Codes
+ */
+#define SCSI_VPROD_SUPPORTED            0x00
+#define SCSI_VPROD_UNIT_SERIAL          0x80
+#define SCSI_VPROD_AODEFN               0x82
+#define SCSI_VPROD_DEVICE_ID            0x83
+
+/*
  *  Status codes
  */
 
#4 lore raw

PATCH 1/1 4/6 2.5.44 scsi multi-path IO - upper layer

SCSI upper-layer multi-path IO changes

 sd.c       |   52 ++++++++++++++----------
 sg.c       |  130 ++++++++++++++++++++++++++++++++++++++++---------------------
 sr.c       |   18 +++++---
 sr_ioctl.c |    4 +
 st.c       |   50 ++++++++++++++---------
 5 files changed, 160 insertions(+), 94 deletions(-)
drivers/scsi/sd.c +30 -22
diff -Nru a/drivers/scsi/sd.c b/drivers/scsi/sd.c
@@ -219,8 +219,9 @@
 			if(!loc)
 				return -EINVAL;
 
-			host = sdp->host;
-	
+			host = scsi_get_host(sdkp->device);
+			if (host == NULL)
+				return -ENODEV;
 			/* default to most commonly used values */
 	
 		        diskinfo[0] = 0x40;	/* 1 << 6 */
@@ -466,6 +467,7 @@
  **/
 static int sd_open(struct inode *inode, struct file *filp)
 {
+	struct Scsi_Host * shp;
 	struct gendisk *disk = inode->i_bdev->bd_disk;
 	Scsi_Disk *sdkp = disk->private_data;
 	Scsi_Device * sdp = sdkp->device;
@@ -486,8 +488,11 @@
 	 * The following code can sleep.
 	 * Module unloading must be prevented
 	 */
-	if (sdp->host->hostt->module)
-		__MOD_INC_USE_COUNT(sdp->host->hostt->module);
+	shp = scsi_get_host(sdp);
+	if (shp == NULL)
+		return -ENODEV;
+	if (shp->hostt->module)
+		__MOD_INC_USE_COUNT(shp->hostt->module);
 	if (sd_template.module)
 		__MOD_INC_USE_COUNT(sd_template.module);
 	sdp->access_count++;
@@ -531,8 +536,8 @@
 
 error_out:
 	sdp->access_count--;
-	if (sdp->host->hostt->module)
-		__MOD_DEC_USE_COUNT(sdp->host->hostt->module);
+	if (shp->hostt->module)
+		__MOD_DEC_USE_COUNT(shp->hostt->module);
 	if (sd_template.module)
 		__MOD_DEC_USE_COUNT(sd_template.module);
 	return retval;	
@@ -554,6 +559,7 @@
 	struct gendisk *disk = inode->i_bdev->bd_disk;
 	Scsi_Disk *sdkp = disk->private_data;
 	Scsi_Device *sdp = sdkp->device;
+	struct Scsi_Host * shp;
 
 	SCSI_LOG_HLQUEUE(3, printk("sd_release: disk=%s\n", disk->disk_name));
 	if (!sdp)
@@ -569,8 +575,9 @@
 			if (scsi_block_when_processing_errors(sdp))
 				scsi_set_medium_removal(sdp, SCSI_REMOVAL_ALLOW);
 	}
-	if (sdp->host->hostt->module)
-		__MOD_DEC_USE_COUNT(sdp->host->hostt->module);
+	shp = scsi_get_host(sdp);
+	if (shp && shp->hostt->module)
+		__MOD_DEC_USE_COUNT(shp->hostt->module);
 	if (sd_template.module)
 		__MOD_DEC_USE_COUNT(sd_template.module);
 
@@ -1071,8 +1078,8 @@
 }
 
 static int
-sd_do_mode_sense6(Scsi_Device *sdp, Scsi_Request *SRpnt,
-		  int modepage, unsigned char *buffer, int len) {
+sd_do_mode_sense6(Scsi_Request *SRpnt, int modepage, unsigned char *buffer,
+	       	int len) {
 	unsigned char cmd[8];
 
 	memset((void *) &cmd[0], 0, 8);
@@ -1097,7 +1104,6 @@
 static void
 sd_read_write_protect_flag(Scsi_Disk *sdkp, char *diskname,
 			   Scsi_Request *SRpnt, unsigned char *buffer) {
-	Scsi_Device *sdp = sdkp->device;
 	int res;
 
 	/*
@@ -1105,7 +1111,7 @@
 	 * We have to start carefully: some devices hang if we ask
 	 * for more than is available.
 	 */
-	res = sd_do_mode_sense6(sdp, SRpnt, 0x3F, buffer, 4);
+	res = sd_do_mode_sense6(SRpnt, 0x3F, buffer, 4);
 
 	/*
 	 * Second attempt: ask for page 0
@@ -1113,13 +1119,13 @@
 	 * Sense Key 5: Illegal Request, Sense Code 24: Invalid field in CDB.
 	 */
 	if (res)
-		res = sd_do_mode_sense6(sdp, SRpnt, 0, buffer, 4);
+		res = sd_do_mode_sense6(SRpnt, 0, buffer, 4);
 
 	/*
 	 * Third attempt: ask 255 bytes, as we did earlier.
 	 */
 	if (res)
-		res = sd_do_mode_sense6(sdp, SRpnt, 0x3F, buffer, 255);
+		res = sd_do_mode_sense6(SRpnt, 0x3F, buffer, 255);
 
 	if (res) {
 		printk(KERN_WARNING
@@ -1371,8 +1377,9 @@
 	if (!gd)
 		return 1;
 
-	SCSI_LOG_HLQUEUE(3, printk("sd_attach: scsi device: <%d,%d,%d,%d>\n", 
-			 sdp->host->host_no, sdp->channel, sdp->id, sdp->lun));
+	SCSI_LOG_HLQUEUE(3, { printk("sd_attach: scsi_device: ");
+				scsi_paths_printk(sdp, ", ", "<%d,%d,%d,%d>");
+				printk("\n");});
 	if (sd_template.nr_dev >= sd_template.dev_max) {
 		sdp->attached--;
 		printk(KERN_ERR "sd_init: no more room for device\n");
@@ -1413,9 +1420,10 @@
         gd->driverfs_dev = &sdp->sdev_driverfs_dev;
         gd->flags |= GENHD_FL_DRIVERFS | GENHD_FL_DEVFS;
 	sd_disks[dsk_nr] = gd;
-	printk(KERN_NOTICE "Attached scsi %sdisk %s at scsi%d, channel %d, "
-	       "id %d, lun %d\n", sdp->removable ? "removable " : "",
-	       gd->disk_name, sdp->host->host_no, sdp->channel, sdp->id, sdp->lun);
+	printk(KERN_NOTICE "Attached scsi %sdisk %s at: ",
+	       sdp->removable ? "removable " : "", gd->disk_name);
+	scsi_paths_printk(sdp, "; ", "scsi%d, channel %d, id %d, lun %d");
+	printk("\n");
 	return 0;
 }
 
@@ -1448,9 +1456,9 @@
 	int dsk_nr;
 	unsigned long iflags;
 
-	SCSI_LOG_HLQUEUE(3, printk("sd_detach: <%d,%d,%d,%d>\n", 
-			    sdp->host->host_no, sdp->channel, sdp->id, 
-			    sdp->lun));
+	SCSI_LOG_HLQUEUE(3, { printk("sd_detach: scsi_device: ");
+				scsi_paths_printk(sdp, ", ", "<%d,%d,%d,%d>");
+				printk("\n");});
 	write_lock_irqsave(&sd_dsk_arr_lock, iflags);
 	for (dsk_nr = 0; dsk_nr < sd_template.dev_max; dsk_nr++) {
 		sdkp = sd_dsk_arr[dsk_nr];
drivers/scsi/sg.c +86 -44

309 lines not on this page · raw message

drivers/scsi/sr.c +11 -7
diff -Nru a/drivers/scsi/sr.c b/drivers/scsi/sr.c
@@ -97,13 +97,15 @@
 
 static void sr_release(struct cdrom_device_info *cdi)
 {
+	struct Scsi_Host *shp;
 	Scsi_CD *cd = cdi->handle;
 
 	if (cd->device->sector_size > 2048)
 		sr_set_blocklength(cd, 2048);
 	cd->device->access_count--;
-	if (cd->device->host->hostt->module)
-		__MOD_DEC_USE_COUNT(cd->device->host->hostt->module);
+	shp = scsi_get_host(cd->device);
+	if (shp && shp->hostt->module)
+		__MOD_DEC_USE_COUNT(shp->hostt->module);
 	if (sr_template.module)
 		__MOD_DEC_USE_COUNT(sr_template.module);
 }
@@ -428,6 +430,7 @@
 
 static int sr_open(struct cdrom_device_info *cdi, int purpose)
 {
+	struct Scsi_Host *shp;
 	Scsi_CD *cd = cdi->handle;
 
 	if (!cd->device)
@@ -440,8 +443,9 @@
 		return -ENXIO;
 	}
 	cd->device->access_count++;
-	if (cd->device->host->hostt->module)
-		__MOD_INC_USE_COUNT(cd->device->host->hostt->module);
+	shp = scsi_get_host(cd->device);
+	if (shp && shp->hostt->module)
+		__MOD_INC_USE_COUNT(shp->hostt->module);
 	if (sr_template.module)
 		__MOD_INC_USE_COUNT(sr_template.module);
 
@@ -491,8 +495,9 @@
 	if (sr_template.nr_dev > sr_template.dev_max)
 		panic("scsi_devices corrupt (sr)");
 
-	printk("Attached scsi CD-ROM %s at scsi%d, channel %d, id %d, lun %d\n",
-	       scsi_CDs[i].cdi.name, SDp->host->host_no, SDp->channel, SDp->id, SDp->lun);
+	printk("Attached scsi CD-ROM %s at: ", scsi_CDs[i].cdi.name);
+	scsi_paths_printk(SDp, "; ", "scsi%d, channel %d, id %d, lun %d");
+	printk("\n");
 	return 0;
 }
 
@@ -707,7 +712,6 @@
 		cgc->timeout = IOCTL_TIMEOUT;
 
 	sr_do_ioctl(cdi->handle, cgc);
-
 	return cgc->stat;
 }
 
drivers/scsi/sr_ioctl.c +3 -1
diff -Nru a/drivers/scsi/sr_ioctl.c b/drivers/scsi/sr_ioctl.c
@@ -79,6 +79,7 @@
 	Scsi_Request *SRpnt;
 	Scsi_Device *SDev;
         struct request *req;
+	struct Scsi_Host *SHpnt;
 	int result, err = 0, retries = 0;
 	char *bounce_buffer;
 
@@ -93,7 +94,8 @@
 
 	/* use ISA DMA buffer if necessary */
 	SRpnt->sr_request->buffer = cgc->buffer;
-	if (cgc->buffer && SRpnt->sr_host->unchecked_isa_dma &&
+	SHpnt = scsi_get_host(SDev);
+	if (cgc->buffer && SHpnt && SHpnt->unchecked_isa_dma &&
 	    (virt_to_phys(cgc->buffer) + cgc->buflen - 1 > ISA_DMA_THRESHOLD)) {
 		bounce_buffer = (char *) kmalloc(cgc->buflen, GFP_DMA);
 		if (bounce_buffer == NULL) {
drivers/scsi/st.c +30 -20

121 lines not on this page · raw message

#5 lore raw

PATCH 1/1 5/6 2.5.44 scsi multi-path IO - lower layer (adapter) changes

SCSI low-layer (adapter drivers) multi-path IO changes

 53c700.c                |   27 +++++++++++++++++--------
 aic7xxx/aic7xxx_linux.c |   27 ++++++++++++++++---------
 ips.c                   |   13 ++++++++++--
 qlogicfc.c              |   51 ++++++++++++++++++++++++++++++++++++++++++++++++
 4 files changed, 99 insertions(+), 19 deletions(-)
drivers/scsi/53c700.c +19 -8
diff -Nru a/drivers/scsi/53c700.c b/drivers/scsi/53c700.c
@@ -1084,7 +1084,7 @@
 		DEBUG(("scsi%d: (%d:%d) RESELECTED!\n",
 		       host->host_no, reselection_id, lun));
 		/* clear the reselection indicator */
-		SDp = scsi_find_device(host, 0, reselection_id, lun);
+		SDp = scsi_locate_sdev(host->host_no, 0, reselection_id, lun);
 		if(unlikely(SDp == NULL)) {
 			printk(KERN_ERR "scsi%d: (%d:%d) HAS NO device\n",
 			       host->host_no, reselection_id, lun);
@@ -1506,6 +1506,7 @@
 		if(sstat0 & SCSI_RESET_DETECTED) {
 			Scsi_Device *SDp;
 			int i;
+			struct scsi_traverse_hndl strav_hndl;
 
 			hostdata->state = NCR_700_HOST_BUSY;
 
@@ -1513,7 +1514,7 @@
 			       host->host_no, SCp, SCp == NULL ? NULL : SCp->host_scribble, dsp, dsp - hostdata->pScript);
 
 			/* clear all the negotiated parameters */
-			for(SDp = host->host_queue; SDp != NULL; SDp = SDp->next)
+			scsi_for_each_host_sdev(&strav_hndl, SDp, host->host_no)
 				SDp->hostdata = 0;
 			
 			/* clear all the slots and their pending commands */
@@ -1726,6 +1727,7 @@
 	struct Scsi_Host *host;
 	struct NCR_700_Host_Parameters *hostdata;
 	Scsi_Device *SDp;
+	struct scsi_traverse_hndl strav_hndl;
 
 	host = scsi_host_hn_get(host_no);
 	if(host == NULL)
@@ -1740,8 +1742,10 @@
 	len += sprintf(&buf[len],"\
 Target	Depth  Active  Next Tag\n\
 ======	=====  ======  ========\n");
-	for(SDp = host->host_queue; SDp != NULL; SDp = SDp->next) {
-		len += sprintf(&buf[len]," %2d:%2d   %4d    %4d      %4d\n", SDp->id, SDp->lun, SDp->current_queue_depth, NCR_700_get_depth(SDp), SDp->current_tag);
+	scsi_for_each_host_sdev(&strav_hndl, SDp, host->host_no) {
+		len += scsi_paths_proc_print_paths(SDp, &buf[len],
+			"%2d:%2d:%2d:%2d");
+		len += sprintf(&buf[len],"   %4d    %4d      %4d\n", SDp->current_queue_depth, NCR_700_get_depth(SDp), SDp->current_tag);
 	}
 	if((len -= offset) <= 0)
 		return 0;
@@ -1814,13 +1818,13 @@
 		 * tag queuing per LUN.  We only support it per PUN because
 		 * of potential reselection issues */
 		printk(KERN_NOTICE "scsi%d: (%d:%d) beginning blk layer TCQ\n",
-		       SCp->device->host->host_no, SCp->target, SCp->lun);
+		       SCp->host->host_no, SCp->target, SCp->lun);
 		scsi_activate_tcq(SCp->device, NCR_700_MAX_TAGS);
 	}
 
 	if(blk_rq_tagged(SCp->request)
 	   && (hostdata->tag_negotiated &(1<<SCp->target)) == 0) {
-		printk(KERN_INFO "scsi%d: (%d:%d) Enabling Tag Command Queuing\n", SCp->device->host->host_no, SCp->target, SCp->lun);
+		printk(KERN_INFO "scsi%d: (%d:%d) Enabling Tag Command Queuing\n", SCp->host->host_no, SCp->target, SCp->lun);
 		hostdata->tag_negotiated |= (1<<SCp->target);
 		NCR_700_set_flag(SCp->device, NCR_700_DEV_BEGIN_TAG_QUEUEING);
 	}
@@ -1833,7 +1837,7 @@
 	 * */
 	if(!blk_rq_tagged(SCp->request)
 	   && (hostdata->tag_negotiated &(1<<SCp->target))) {
-		printk(KERN_INFO "scsi%d: (%d:%d) Disabling Tag Command Queuing\n", SCp->device->host->host_no, SCp->target, SCp->lun);
+		printk(KERN_INFO "scsi%d: (%d:%d) Disabling Tag Command Queuing\n", SCp->host->host_no, SCp->target, SCp->lun);
 		hostdata->tag_negotiated &= ~(1<<SCp->target);
 	}
 
@@ -2003,12 +2007,19 @@
 STATIC int
 NCR_700_slave_attach(Scsi_Device *SDp)
 {
+	struct Scsi_Host *host;
 	/* to do here: allocate memory; build a queue_full list */
 	if(SDp->tagged_supported) {
 		/* do TCQ stuff here */
 	} else {
 		/* initialise to default depth */
-		scsi_adjust_queue_depth(SDp, 0, SDp->host->cmd_per_lun);
+		host = scsi_get_host(SDp);
+		if (!host)
+			/*
+			 * Probably a BUG.
+			 */
+			return 1;
+		scsi_adjust_queue_depth(SDp, 0, host->cmd_per_lun);
 	}
 	return 0;
 }
drivers/scsi/aic7xxx/aic7xxx_linux.c +18 -9
diff -Nru a/drivers/scsi/aic7xxx/aic7xxx_linux.c b/drivers/scsi/aic7xxx/aic7xxx_linux.c
@@ -1452,8 +1452,12 @@
 {
 	struct	ahc_softc *ahc;
 	u_long	flags;
+	struct Scsi_Host *shost;
 
-	ahc = *((struct ahc_softc **)device->host->hostdata);
+	shost = scsi_get_host(device);
+	if (!shost)
+		return 1;
+	ahc = *((struct ahc_softc **)shost->hostdata);
 	ahc_lock(ahc, &flags);
 	ahc_linux_device_queue_depth(ahc, device);
 	ahc_unlock(ahc, &flags);
@@ -1470,11 +1474,14 @@
 	struct	ahc_initiator_tinfo *targ_info;
 	struct	ahc_tmode_tstate *tstate;
 	uint8_t tags;
+	struct scsi_path_id path;
+
+	scsi_get_path(device, &path);
 
 	ahc_compile_devinfo(&devinfo,
-			    device->channel == 0 ? ahc->our_id : ahc->our_id_b,
-			    device->id, device->lun,
-			    device->channel == 0 ? 'A' : 'B',
+			    path.spi_channel == 0 ? ahc->our_id : ahc->our_id_b,
+			    path.spi_id, path.spi_lun,
+			    path.spi_channel == 0 ? 'A' : 'B',
 			    ROLE_INITIATOR);
 	targ_info = ahc_fetch_transinfo(ahc, devinfo.channel,
 					devinfo.our_scsiid,
@@ -1506,8 +1513,8 @@
 		/* device->queue_depth = tags; */
 		ahc_set_tags(ahc, &devinfo, AHC_QUEUE_TAGGED);
 		printf("scsi%d:%c:%d:%d: Tagged Queuing enabled.  Depth %d\n",
-	       	       ahc->platform_data->host->host_no, device->channel + 'A',
-		       device->id, device->lun, tags);
+	       	       ahc->platform_data->host->host_no, path.spi_channel + 'A',
+		       path.spi_id, path.spi_lun, tags);
 	} else {
 		/*
 		 * We allow the OS to queue 2 untagged transactions to
@@ -1516,7 +1523,7 @@
 		 * some latency.
 		device->queue_depth = 2;
 		 */
-		scsi_adjust_queue_depth(device, 0, device->host->cmd_per_lun);
+		scsi_adjust_queue_depth(device, 0, path.spi_shpnt->cmd_per_lun);
 	}
 }
 
@@ -2727,8 +2734,10 @@
 	int	extended;
 	struct	ahc_softc *ahc;
 	unsigned char *buf;
+	struct scsi_path_id path;
 
-	ahc = *((struct ahc_softc **)disk->device->host->hostdata);
+	scsi_get_path(disk->device, &path);
+	ahc = *((struct ahc_softc **)path.spi_shpnt->hostdata);
 	buf = scsi_bios_ptable(bdev);
 
 	if (buf) {
@@ -2744,7 +2753,7 @@
 
 	if (aic7xxx_extended != 0)
 		extended = 1;
-	else if (disk->device->channel == 0)
+	else if (path.spi_channel == 0)
 		extended = (ahc->flags & AHC_EXTENDED_TRANS_A) != 0;
 	else
 		extended = (ahc->flags & AHC_EXTENDED_TRANS_B) != 0;
drivers/scsi/ips.c +11 -2
diff -Nru a/drivers/scsi/ips.c b/drivers/scsi/ips.c
@@ -1782,10 +1782,15 @@
    int               heads;
    int               sectors;
    int               cylinders;
+   struct Scsi_Host *host;
 
    METHOD_TRACE("ips_biosparam", 1);
 
-   ha = (ips_ha_t *) disk->device->host->hostdata;
+   host = scsi_get_host(disk->device);
+   if (host == NULL)
+      return (0);
+
+   ha = (ips_ha_t *) host->hostdata;
 
    if (!ha)
       /* ?!?! host adater info invalid */
@@ -1877,8 +1882,12 @@
 {
    ips_ha_t    *ha;
    int          min;
+   struct Scsi_Host   *sh;
 
-   ha = IPS_HA(SDptr->host);
+   sh = scsi_get_host(SDptr);
+   if (!sh)
+	   return 1;
+   ha = IPS_HA(sh);
    if (SDptr->tagged_supported) {
       min = ha->max_cmds / 2;
       if (min <= 16)
drivers/scsi/qlogicfc.c +51 -0

75 lines not on this page · raw message

#6 lore raw

PATCH 1/1 5/6 2.5.44 scsi multi-path IO - qla driver changes

multi-path IO and 2.5.x changes for the qla 6.03.00 Beta 7 driver.

Apply this on top of the driver found at:

http://download.qlogic.com/drivers/6443/qla2x00-v6.03.00b7-dist.tgz

 Makefile        |    9 ++++++
 qla2x00.c       |   74 ++++++++++++++++++++------------------------------------
 qla2x00.h       |    7 ++---
 qla2x00_ioctl.c |    4 ++-
 qla_settings.h  |    2 -
 5 files changed, 43 insertions(+), 53 deletions(-)
Makefile +9 -0
diff -urN -X /home/patman/dontdiff qla2x00src-v6.03.00b7/Makefile qla2x00src-v6.03.00b7-mpath/Makefile
@@ -0,0 +1,9 @@
+# andmike's condensed makefile
+# To use cd to kernel source and type the following.
+# make SUBDIRS=/path/to/your/module modules
+
+CFLAGS_qla2200.o = -I$(TOPDIR)/drivers/scsi
+CFLAGS_qla2300.o = -I$(TOPDIR)/drivers/scsi
+obj-m	:= qla2200.o qla2300.o
+
+include	$(TOPDIR)/Rules.make
qla2x00.c +27 -47

143 lines not on this page · raw message

qla2x00.h +3 -4
diff -urN -X /home/patman/dontdiff qla2x00src-v6.03.00b7/qla2x00.h qla2x00src-v6.03.00b7-mpath/qla2x00.h
@@ -129,8 +129,8 @@
 /*
  * I/O register
 */
-/* #define MEMORY_MAPPED_IO  */    /* Enable memory mapped I/O */
-#undef MEMORY_MAPPED_IO            /* Disable memory mapped I/O */
+#define MEMORY_MAPPED_IO  1	/* Enable memory mapped I/O */
+/* #undef MEMORY_MAPPED_IO            Disable memory mapped I/O */
 
 #if defined(MEMORY_MAPPED_IO)
 #define RD_REG_BYTE(addr)         readb(addr)
@@ -2710,7 +2710,6 @@
 
 
 #define QLA2100_LINUX_TEMPLATE {				\
-        next:   NULL,						\
 	module: NULL,						\
 	proc_dir: NULL,						\
 	proc_info: qla2x00_proc_info,	                        \
@@ -2728,7 +2727,7 @@
 	eh_host_reset_handler: qla2xxx_eh_host_reset,		\
 	abort: NULL,						\
 	reset: NULL,						\
-	slave_attach: NULL,					\
+	slave_attach: qla2x00_slave_attach,			\
 	bios_param: QLA2100_BIOSPARAM,				\
 	can_queue: 255,		/* max simultaneous cmds      */\
 	this_id: -1,		/* scsi id of host adapter    */\
qla2x00_ioctl.c +3 -1
diff -urN -X /home/patman/dontdiff qla2x00src-v6.03.00b7/qla2x00_ioctl.c qla2x00src-v6.03.00b7-mpath/qla2x00_ioctl.c
@@ -240,7 +240,9 @@
 		return (-EINVAL);
 	}
 
-	host = dev->host;
+	host = scsi_get_host(dev);
+	if (!host)
+		return(-EINVAL);
 	ha = (scsi_qla_host_t *) host->hostdata; /* midlayer chosen instance */
 
 	ret = verify_area(VERIFY_READ, (void *)arg, sizeof(EXT_IOCTL));
qla_settings.h +1 -1
diff -urN -X /home/patman/dontdiff qla2x00src-v6.03.00b7/qla_settings.h qla2x00src-v6.03.00b7-mpath/qla_settings.h
@@ -65,7 +65,7 @@
  * - a tasklet to process the done queue and send requests back to 
  *  the OS.
  */
-#define	QLA2X_PERFORMANCE		1 
+#define	QLA2X_PERFORMANCE		0 
 
 /* The following WORD_FW_LOAD is defined in Makefile for ia-64 builds
    and can also be decommented here for Word by Word confirmation of