diff options
author | Stefan Richter <stefanr@s5r6.in-berlin.de> | 2007-12-16 11:31:26 -0500 |
---|---|---|
committer | Stefan Richter <stefanr@s5r6.in-berlin.de> | 2008-01-30 16:22:21 -0500 |
commit | 4e6343a10b6afb5b036db35c4a0f0aa1333232e1 (patch) | |
tree | 3c519551bad718cc1006d570e43a2f51a6befd1d /drivers/ieee1394/sbp2.c | |
parent | 3e75b493fbfad5d70831a2f7267c7cd8b8fec71f (diff) |
ieee1394: sbp2: raise default transfer size limit
This patch speeds up sbp2 a little bit --- but more importantly, it
brings the behavior of sbp2 and fw-sbp2 closer to each other. Like
fw-sbp2, sbp2 now does not limit the size of single transfers to 255
sectors anymore, unless told so by a blacklist flag or by module load
parameters.
Only very old bridge chips have been known to need the 255 sectors
limit, and we have got one such chip in our hardwired blacklist. There
certainly is a danger that more bridges need that limit; but I prefer to
have this issue present in both fw-sbp2 and sbp2 rather than just one of
them.
An OXUF922 with 400GB 7200RPM disk on an S400 controller is sped up by
this patch from 22.9 to 23.5 MB/s according to hdparm. The same effect
could be achieved before by setting a higher max_sectors module
parameter. On buses which use 1394b beta mode, sbp2 and fw-sbp2 will
now achieve virtually the same bandwidth. Fw-sbp2 only remains faster
on 1394a buses due to fw-core's gap count optimization.
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
Diffstat (limited to 'drivers/ieee1394/sbp2.c')
-rw-r--r-- | drivers/ieee1394/sbp2.c | 26 |
1 files changed, 15 insertions, 11 deletions
diff --git a/drivers/ieee1394/sbp2.c b/drivers/ieee1394/sbp2.c index b91142b8482c..2b889d91e673 100644 --- a/drivers/ieee1394/sbp2.c +++ b/drivers/ieee1394/sbp2.c | |||
@@ -51,6 +51,7 @@ | |||
51 | * Grep for inline FIXME comments below. | 51 | * Grep for inline FIXME comments below. |
52 | */ | 52 | */ |
53 | 53 | ||
54 | #include <linux/blkdev.h> | ||
54 | #include <linux/compiler.h> | 55 | #include <linux/compiler.h> |
55 | #include <linux/delay.h> | 56 | #include <linux/delay.h> |
56 | #include <linux/device.h> | 57 | #include <linux/device.h> |
@@ -127,17 +128,21 @@ MODULE_PARM_DESC(serialize_io, "Serialize requests coming from SCSI drivers " | |||
127 | "(default = Y, faster but buggy = N)"); | 128 | "(default = Y, faster but buggy = N)"); |
128 | 129 | ||
129 | /* | 130 | /* |
130 | * Bump up max_sectors if you'd like to support very large sized | 131 | * Adjust max_sectors if you'd like to influence how many sectors each SCSI |
131 | * transfers. Please note that some older sbp2 bridge chips are broken for | 132 | * command can transfer at most. Please note that some older SBP-2 bridge |
132 | * transfers greater or equal to 128KB. Default is a value of 255 | 133 | * chips are broken for transfers greater or equal to 128KB, therefore |
133 | * sectors, or just under 128KB (at 512 byte sector size). I can note that | 134 | * max_sectors used to be a safe 255 sectors for many years. We now have a |
134 | * the Oxsemi sbp2 chipsets have no problems supporting very large | 135 | * default of 0 here which means that we let the SCSI stack choose a limit. |
135 | * transfer sizes. | 136 | * |
137 | * The SBP2_WORKAROUND_128K_MAX_TRANS flag, if set either in the workarounds | ||
138 | * module parameter or in the sbp2_workarounds_table[], will override the | ||
139 | * value of max_sectors. We should use sbp2_workarounds_table[] to cover any | ||
140 | * bridge chip which becomes known to need the 255 sectors limit. | ||
136 | */ | 141 | */ |
137 | static int sbp2_max_sectors = SBP2_MAX_SECTORS; | 142 | static int sbp2_max_sectors; |
138 | module_param_named(max_sectors, sbp2_max_sectors, int, 0444); | 143 | module_param_named(max_sectors, sbp2_max_sectors, int, 0444); |
139 | MODULE_PARM_DESC(max_sectors, "Change max sectors per I/O supported " | 144 | MODULE_PARM_DESC(max_sectors, "Change max sectors per I/O supported " |
140 | "(default = " __stringify(SBP2_MAX_SECTORS) ")"); | 145 | "(default = 0 = use SCSI stack's default)"); |
141 | 146 | ||
142 | /* | 147 | /* |
143 | * Exclusive login to sbp2 device? In most cases, the sbp2 driver should | 148 | * Exclusive login to sbp2 device? In most cases, the sbp2 driver should |
@@ -1985,6 +1990,8 @@ static int sbp2scsi_slave_configure(struct scsi_device *sdev) | |||
1985 | sdev->skip_ms_page_8 = 1; | 1990 | sdev->skip_ms_page_8 = 1; |
1986 | if (lu->workarounds & SBP2_WORKAROUND_FIX_CAPACITY) | 1991 | if (lu->workarounds & SBP2_WORKAROUND_FIX_CAPACITY) |
1987 | sdev->fix_capacity = 1; | 1992 | sdev->fix_capacity = 1; |
1993 | if (lu->workarounds & SBP2_WORKAROUND_128K_MAX_TRANS) | ||
1994 | blk_queue_max_sectors(sdev->request_queue, 128 * 1024 / 512); | ||
1988 | return 0; | 1995 | return 0; |
1989 | } | 1996 | } |
1990 | 1997 | ||
@@ -2091,9 +2098,6 @@ static int sbp2_module_init(void) | |||
2091 | sbp2_shost_template.cmd_per_lun = 1; | 2098 | sbp2_shost_template.cmd_per_lun = 1; |
2092 | } | 2099 | } |
2093 | 2100 | ||
2094 | if (sbp2_default_workarounds & SBP2_WORKAROUND_128K_MAX_TRANS && | ||
2095 | (sbp2_max_sectors * 512) > (128 * 1024)) | ||
2096 | sbp2_max_sectors = 128 * 1024 / 512; | ||
2097 | sbp2_shost_template.max_sectors = sbp2_max_sectors; | 2101 | sbp2_shost_template.max_sectors = sbp2_max_sectors; |
2098 | 2102 | ||
2099 | hpsb_register_highlevel(&sbp2_highlevel); | 2103 | hpsb_register_highlevel(&sbp2_highlevel); |