public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] - Fusion-MPT much faster as module
@ 2005-03-22 18:40 Moore, Eric Dean
  2005-03-22 19:05 ` James Bottomley
  0 siblings, 1 reply; 4+ messages in thread
From: Moore, Eric Dean @ 2005-03-22 18:40 UTC (permalink / raw)
  To: linux-kernel, linux-scsi, Andrew Morton, kenneth.w.chen

[-- Attachment #1: Type: text/plain, Size: 1001 bytes --]

Here is a patch for mpt fusion drivers, which
fix's issue of poor performance when driver compiled
built-in to the kernel.

Thanks to Chen, Kenneth W.

History on this:
Between the 3.01.16 and 3.01.18, we introduced new method
to passing command line options to the driver.  Some of the
command line options are used for fine tuning dv(domain
validation) in the driver.  By accident, these command line options were
wrapped around #ifdef MODULE in the 3.01.18 version of the driver.
What this meant is when the driver is compiled built-in the kernel,
the optimal settings for dv were ignored, thus poor performance.  

There was actually a fix for this when I submitted SAS drivers
to the mailing list back in November, however the SAS drivers was
rejected, and later on I overlooked submitting a single patch to 
solve this.

Please apply this patch against the 3.01.19 version of the mpt driver
in http://linux-scsi.bkbits.net:8080/scsi-misc-2.6

Signed-off-by: Eric Moore <Eric.Moore@lsil.com>





[-- Attachment #2: mptlinux-3.01.20 --]
[-- Type: application/octet-stream, Size: 6587 bytes --]

diff -uarN drivers/message/fusion-3.01.19/mptbase.h drivers/message/fusion/mptbase.h
--- drivers/message/fusion-3.01.19/mptbase.h	2005-03-22 10:43:07.000000000 -0700
+++ drivers/message/fusion/mptbase.h	2005-03-22 10:44:24.000000000 -0700
@@ -83,8 +83,8 @@
 #define COPYRIGHT	"Copyright (c) 1999-2004 " MODULEAUTHOR
 #endif
 
-#define MPT_LINUX_VERSION_COMMON	"3.01.19"
-#define MPT_LINUX_PACKAGE_NAME		"@(#)mptlinux-3.01.19"
+#define MPT_LINUX_VERSION_COMMON	"3.01.20"
+#define MPT_LINUX_PACKAGE_NAME		"@(#)mptlinux-3.01.20"
 #define WHAT_MAGIC_STRING		"@" "(" "#" ")"
 
 #define show_mptmod_ver(s,ver)  \
diff -uarN drivers/message/fusion-3.01.19/mptscsih.c drivers/message/fusion/mptscsih.c
--- drivers/message/fusion-3.01.19/mptscsih.c	2005-03-22 10:43:07.000000000 -0700
+++ drivers/message/fusion/mptscsih.c	2005-03-22 10:51:55.000000000 -0700
@@ -96,23 +96,26 @@
 MODULE_DESCRIPTION(my_NAME);
 MODULE_LICENSE("GPL");
 
-#ifdef MODULE
-static int dv = MPTSCSIH_DOMAIN_VALIDATION;
-module_param(dv, int, 0);
-MODULE_PARM_DESC(dv, "DV Algorithm: enhanced = 1, basic = 0 (default=MPTSCSIH_DOMAIN_VALIDATION=1)");
-
-static int width = MPTSCSIH_MAX_WIDTH;
-module_param(width, int, 0);
-MODULE_PARM_DESC(width, "Max Bus Width: wide = 1, narrow = 0 (default=MPTSCSIH_MAX_WIDTH=1)");
-
-static ushort factor = MPTSCSIH_MIN_SYNC;
-module_param(factor, ushort, 0);
-MODULE_PARM_DESC(factor, "Min Sync Factor: (default=MPTSCSIH_MIN_SYNC=0x08)");
-
-static int saf_te = MPTSCSIH_SAF_TE;
-module_param(saf_te, int, 0);
-MODULE_PARM_DESC(saf_te, "Force enabling SEP Processor: (default=MPTSCSIH_SAF_TE=0)");
-#endif
+/* Command line args */
+static int mpt_dv = MPTSCSIH_DOMAIN_VALIDATION;
+MODULE_PARM(mpt_dv, "i");
+MODULE_PARM_DESC(mpt_dv, " DV Algorithm: enhanced=1, basic=0 (default=MPTSCSIH_DOMAIN_VALIDATION=1)");
+
+static int mpt_width = MPTSCSIH_MAX_WIDTH;
+MODULE_PARM(mpt_width, "i");
+MODULE_PARM_DESC(mpt_width, " Max Bus Width: wide=1, narrow=0 (default=MPTSCSIH_MAX_WIDTH=1)");
+
+static int mpt_factor = MPTSCSIH_MIN_SYNC;
+MODULE_PARM(mpt_factor, "h");
+MODULE_PARM_DESC(mpt_factor, " Min Sync Factor (default=MPTSCSIH_MIN_SYNC=0x08)");
+
+static int mpt_saf_te = MPTSCSIH_SAF_TE;
+MODULE_PARM(mpt_saf_te, "i");
+MODULE_PARM_DESC(mpt_saf_te, " Force enabling SEP Processor: enable=1  (default=MPTSCSIH_SAF_TE=0)");
+
+static int mpt_pq_filter = 0;
+MODULE_PARM(mpt_pq_filter, "i");
+MODULE_PARM_DESC(mpt_pq_filter, " Enable peripheral qualifier filter: enable=1  (default=0)");
 
 /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
 
@@ -253,7 +256,6 @@
 
 /* Driver command line structure
  */
-static struct mptscsih_driver_setup driver_setup;
 static struct scsi_host_template driver_template;
 
 /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
@@ -1224,29 +1226,23 @@
 		/* Update with the driver setup
 		 * values.
 		 */
-		if (ioc->spi_data.maxBusWidth >
-		  driver_setup.max_width) {
-			ioc->spi_data.maxBusWidth =
-			  driver_setup.max_width;
-		}
-
-		if (ioc->spi_data.minSyncFactor <
-		  driver_setup.min_sync_factor) {
-			ioc->spi_data.minSyncFactor =
-			  driver_setup.min_sync_factor;
-		}
+		if (ioc->spi_data.maxBusWidth > mpt_width)
+			ioc->spi_data.maxBusWidth = mpt_width;
+		if (ioc->spi_data.minSyncFactor < mpt_factor)
+			ioc->spi_data.minSyncFactor = mpt_factor;
 
 		if (ioc->spi_data.minSyncFactor == MPT_ASYNC) {
 			ioc->spi_data.maxSyncOffset = 0;
 		}
 
-		ioc->spi_data.Saf_Te = driver_setup.saf_te;
+		ioc->spi_data.Saf_Te = mpt_saf_te;
 
 		hd->negoNvram = 0;
 #ifndef MPTSCSIH_ENABLE_DOMAIN_VALIDATION
 		hd->negoNvram = MPT_SCSICFG_USE_NVRAM;
 #endif
 		ioc->spi_data.forceDv = 0;
+		ioc->spi_data.noQas = 0;
 		for (ii=0; ii < MPT_MAX_SCSI_DEVICES; ii++) {
 			ioc->spi_data.dvStatus[ii] =
 			  MPT_SCSICFG_NEGOTIATE;
@@ -1256,12 +1252,12 @@
 			ioc->spi_data.dvStatus[ii] |=
 			  MPT_SCSICFG_DV_NOT_DONE;
 
-		ddvprintk((MYIOC_s_INFO_FMT
+		dinitprintk((MYIOC_s_INFO_FMT
 			"dv %x width %x factor %x saf_te %x\n",
-			ioc->name, driver_setup.dv,
-			driver_setup.max_width,
-			driver_setup.min_sync_factor,
-			driver_setup.saf_te));
+			ioc->name, mpt_dv,
+			mpt_width,
+			mpt_factor,
+			mpt_saf_te));
 	}
 
 	mpt_scsi_hosts++;
@@ -1477,18 +1473,6 @@
 		  ": Registered for IOC reset notifications\n"));
 	}
 
-#ifdef MODULE
-	dinitprintk((KERN_INFO MYNAM
-		": Command Line Args: dv=%d max_width=%d "
-		"factor=0x%x saf_te=%d\n",
-		dv, width, factor, saf_te));
-
-	driver_setup.dv = (dv) ? 1 : 0;
-	driver_setup.max_width = (width) ? 1 : 0;
-	driver_setup.min_sync_factor = factor;
-	driver_setup.saf_te = (saf_te) ? 1 : 0;;
-#endif
-
 	if(mpt_device_driver_register(&mptscsih_driver,
 	  MPTSCSIH_DRIVER) != 0 ) {
 		dprintk((KERN_INFO MYNAM
@@ -3165,6 +3149,18 @@
 	dinitprintk((MYIOC_s_INFO_FMT "initTarget bus=%d id=%d lun=%d hd=%p\n",
 			hd->ioc->name, bus_id, target_id, lun, hd));
 
+	/*
+	 * If the peripheral qualifier filter is enabled then if the target reports a 0x1
+	 * (i.e. The targer is capable of supporting the specified peripheral device type
+	 * on this logical unit; however, the physical device is not currently connected
+	 * to this logical unit) it will be converted to a 0x3 (i.e. The target is not 
+	 * capable of supporting a physical device on this logical unit). This is to work
+	 * around a bug in th emid-layer in some distributions in which the mid-layer will
+	 * continue to try to communicate to the LUN and evntually create a dummy LUN.
+	*/
+	if (mpt_pq_filter && dlen && (data[0] & 0xE0))
+		data[0] |= 0x40;
+	
 	/* Is LUN supported? If so, upper 2 bits will be 0
 	* in first byte of inquiry data.
 	*/
@@ -5161,7 +5157,7 @@
 	}
 	ddvprintk((MYIOC_s_NOTE_FMT "DV: Basic test on id=%d completed OK.\n", ioc->name, id));
 
-	if (driver_setup.dv == 0)
+	if (mpt_dv == 0)
 		goto target_done;
 
 	inq0 = (*pbuf1) & 0x1F;
diff -uarN drivers/message/fusion-3.01.19/mptscsih.h drivers/message/fusion/mptscsih.h
--- drivers/message/fusion-3.01.19/mptscsih.h	2005-03-22 10:43:07.000000000 -0700
+++ drivers/message/fusion/mptscsih.h	2005-03-22 10:50:14.000000000 -0700
@@ -91,12 +91,4 @@
 #define MPTSCSIH_MIN_SYNC               0x08
 #define MPTSCSIH_SAF_TE                 0
 
-struct mptscsih_driver_setup
-{
-        u8      dv;
-        u8      max_width;
-        u8      min_sync_factor;
-        u8      saf_te;
-};
-
 #endif

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

* Re: [PATCH] - Fusion-MPT much faster as module
  2005-03-22 18:40 Moore, Eric Dean
@ 2005-03-22 19:05 ` James Bottomley
  0 siblings, 0 replies; 4+ messages in thread
From: James Bottomley @ 2005-03-22 19:05 UTC (permalink / raw)
  To: Moore, Eric Dean
  Cc: linux-kernel, SCSI Mailing List, Andrew Morton, kenneth.w.chen

On Tue, 2005-03-22 at 11:40 -0700, Moore, Eric Dean wrote:
> History on this:
> Between the 3.01.16 and 3.01.18, we introduced new method
> to passing command line options to the driver.  Some of the
> command line options are used for fine tuning dv(domain
> validation) in the driver.  By accident, these command line options were
> wrapped around #ifdef MODULE in the 3.01.18 version of the driver.
> What this meant is when the driver is compiled built-in the kernel,
> the optimal settings for dv were ignored, thus poor performance.  

OK, I'll add this to the queue.

Could I just point out that if your driver actually printed the results
of negotiation, this would have been an awful lot easier to debug.

Additionally, if you used the SPI transport class domain validation, the
issue wouldn't have arisen in the first place.

James



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

* RE: [PATCH] - Fusion-MPT much faster as module
@ 2005-03-22 20:35 Moore, Eric Dean
  2005-03-23  4:07 ` James Bottomley
  0 siblings, 1 reply; 4+ messages in thread
From: Moore, Eric Dean @ 2005-03-22 20:35 UTC (permalink / raw)
  To: James Bottomley
  Cc: linux-kernel, SCSI Mailing List, Andrew Morton, kenneth.w.chen

On Tuesday, March 22, 2005 12:05 PM, James Bottomley wrote:
> On Tue, 2005-03-22 at 11:40 -0700, Moore, Eric Dean wrote:
> > History on this:
> > Between the 3.01.16 and 3.01.18, we introduced new method
> > to passing command line options to the driver.  Some of the
> > command line options are used for fine tuning dv(domain
> > validation) in the driver.  By accident, these command line 
> options were
> > wrapped around #ifdef MODULE in the 3.01.18 version of the driver.
> > What this meant is when the driver is compiled built-in the kernel,
> > the optimal settings for dv were ignored, thus poor performance.  
> 
> OK, I'll add this to the queue.
> 
> Could I just point out that if your driver actually printed 
> the results
> of negotiation, this would have been an awful lot easier to debug.
> 
> Additionally, if you used the SPI transport class domain 
> validation, the
> issue wouldn't have arisen in the first place.
> 
> James
> 

Yes, I agree with you.

I'm actively working in the background to split the mptscish driver into
separate bus type drivers.  One for fiber channel, one for SCSI, and
one for eventually SAS.  This was a request from you long time back, at
a time when I tried to submitting a patch having FC transport attributes
support.
I think once I submit that, then we can start taking a looking at supporting
the SPI transport layer.  

I still wonder if the SPI transport layer will work for RAID volumes.  
Do you know if the spi transport layer supports dv on hidden devices in a
raid volume? 
Meaning these hidden physical disks will not been seen by the block layer,
however 
spi transport layer would be aware so dv can be performed those hidden disk?

Eric 







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

* RE: [PATCH] - Fusion-MPT much faster as module
  2005-03-22 20:35 [PATCH] - Fusion-MPT much faster as module Moore, Eric Dean
@ 2005-03-23  4:07 ` James Bottomley
  0 siblings, 0 replies; 4+ messages in thread
From: James Bottomley @ 2005-03-23  4:07 UTC (permalink / raw)
  To: Moore, Eric Dean
  Cc: linux-kernel, SCSI Mailing List, Andrew Morton, kenneth.w.chen

On Tue, 2005-03-22 at 13:35 -0700, Moore, Eric Dean wrote:
> I still wonder if the SPI transport layer will work for RAID volumes.  
> Do you know if the spi transport layer supports dv on hidden devices in a
> raid volume? 
> Meaning these hidden physical disks will not been seen by the block layer,
> however 
> spi transport layer would be aware so dv can be performed those hidden disk?

I recall this being discussed, and the conclusion being that we could
allow a flag to bar attachment of the ULD.  So the underlying discs
would have a scsi_device but no sd device.  Then the spi_transport class
will work fine on them but the user wouldn't be able to open them or
mount anything.

James



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

end of thread, other threads:[~2005-03-23  4:07 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-03-22 20:35 [PATCH] - Fusion-MPT much faster as module Moore, Eric Dean
2005-03-23  4:07 ` James Bottomley
  -- strict thread matches above, loose matches on Subject: below --
2005-03-22 18:40 Moore, Eric Dean
2005-03-22 19:05 ` James Bottomley

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