From: Boaz Harrosh <bharrosh@panasas.com>
To: Andrew Vasquez <andrew.vasquez@qlogic.com>
Cc: James Bottomley <James.Bottomley@SteelEye.com>,
linux-scsi <linux-scsi@vger.kernel.org>
Subject: Re: [PATCH 2/8] scsi-drivers Don't use SG_ALL as allocation size
Date: Thu, 17 Jan 2008 20:11:57 +0200 [thread overview]
Message-ID: <478F9A6D.1010605@panasas.com> (raw)
In-Reply-To: <20080117174745.GB20186@plap3.qlogic.org>
On Thu, Jan 17 2008 at 19:47 +0200, Andrew Vasquez <andrew.vasquez@qlogic.com> wrote:
> On Thu, 17 Jan 2008, Boaz Harrosh wrote:
>
>> below list of drivers have used SG_ALL as a size to
>> preallocate maximum possible command's sg-count.
>> This is no longer possible since the maximum is not
>> set at compile time but as a run time configuration.
>>
>> A better schema can be advised with a more dynamic allocation.
>> Perhaps from a kmem_cache.
>>
>> Affected drivers/files:
>> drivers/scsi/atari_scsi.[ch]
>> drivers/scsi/eata_pio.c
>> drivers/scsi/ibmvscsi/ibmvscsi.[ch]
>> drivers/scsi/mac53c94.c
>> drivers/scsi/mesh.c
>> drivers/scsi/nsp32.h
>> drivers/scsi/qla1280.c
>> drivers/scsi/qla2xxx/qla_os.c
>> drivers/scsi/qla4xxx/ql4_def.h
> ...
>
> There's no functional change in your patches to qla2xxx and qla4xxx.
> Perhaps a cut-n-paste typo from qla1280.c (which should be capped):
>
>> diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c
>> index 78d1103..e368f38 100644
>> --- a/drivers/scsi/qla2xxx/qla_os.c
>> +++ b/drivers/scsi/qla2xxx/qla_os.c
>> @@ -111,6 +111,8 @@ static int qla2x00_device_reset(scsi_qla_host_t *, fc_port_t *);
>> static int qla2x00_change_queue_depth(struct scsi_device *, int);
>> static int qla2x00_change_queue_type(struct scsi_device *, int);
>>
>> +#define QLA2XXX_MAX_SG 255
>> +
>> struct scsi_host_template qla2x00_driver_template = {
>> .module = THIS_MODULE,
>> .name = QLA2XXX_DRIVER_NAME,
>> diff --git a/drivers/scsi/qla4xxx/ql4_def.h b/drivers/scsi/qla4xxx/ql4_def.h
>> index accaf69..64cd43b 100644
>> --- a/drivers/scsi/qla4xxx/ql4_def.h
>> +++ b/drivers/scsi/qla4xxx/ql4_def.h
>> @@ -101,6 +101,7 @@
>> #define MBOX_AEN_REG_COUNT 5
>> #define MAX_INIT_RETRIES 5
>> #define IOCB_HIWAT_CUSHION 16
>> +#define QLA_MAX_SG 255
>
>
> I don't forsee any issues with maintaining SG_ALL (~0) usage within
> qla2xxx and qla4xxx, as the number of unused entries on the HBA's
> request-queue shall ultimately be the rate-limiting factor.
>
> --
Please forgive me I have forgot to put the use of this constants at
body, see patch below.
I have seen the use of a device memory at the scsi_for_each_sg loop and was
not at all sure what is the size limit for that. So I played it safe,
actually I changed nothing. Please give me the OK to remove ql[24]xxx from
these patches, and have them change to SG_ALL==~0 in the last patch.
Or should I resend the patch with below added.
Thanks for catching this
Boaz
--
diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c
index e368f38..b0999b6 100644
--- a/drivers/scsi/qla2xxx/qla_os.c
+++ b/drivers/scsi/qla2xxx/qla_os.c
@@ -134,7 +134,7 @@ struct scsi_host_template qla2x00_driver_template = {
.this_id = -1,
.cmd_per_lun = 3,
.use_clustering = ENABLE_CLUSTERING,
- .sg_tablesize = SG_ALL,
+ .sg_tablesize = QLA2XXX_MAX_SG,
/*
* The RISC allows for each command to transfer (2^32-1) bytes of data,
@@ -165,7 +165,7 @@ struct scsi_host_template qla24xx_driver_template = {
.this_id = -1,
.cmd_per_lun = 3,
.use_clustering = ENABLE_CLUSTERING,
- .sg_tablesize = SG_ALL,
+ .sg_tablesize = QLA2XXX_MAX_SG,
.max_sectors = 0xFFFF,
.shost_attrs = qla2x00_host_attrs,
diff --git a/drivers/scsi/qla4xxx/ql4_os.c b/drivers/scsi/qla4xxx/ql4_os.c
index b128da5..0b8de79 100644
--- a/drivers/scsi/qla4xxx/ql4_os.c
+++ b/drivers/scsi/qla4xxx/ql4_os.c
@@ -94,7 +94,7 @@ static struct scsi_host_template qla4xxx_driver_template = {
.this_id = -1,
.cmd_per_lun = 3,
.use_clustering = ENABLE_CLUSTERING,
- .sg_tablesize = SG_ALL,
+ .sg_tablesize = QLA_MAX_SG,
.max_sectors = 0xFFFF,
};
next prev parent reply other threads:[~2008-01-17 18:12 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-01-17 16:37 [patch 0/8] Change SG_ALL to mean "any size" Boaz Harrosh
2008-01-17 16:41 ` [PATCH 1/8] firewire: ieee1394: Move away from SG_ALL Boaz Harrosh
2008-01-17 17:51 ` Stefan Richter
2008-01-19 7:59 ` Stefan Richter
2008-01-19 15:01 ` James Bottomley
2008-01-19 15:16 ` Stefan Richter
2008-01-17 16:44 ` [PATCH 2/8] scsi-drivers Don't use SG_ALL as allocation size Boaz Harrosh
2008-01-17 17:47 ` Andrew Vasquez
2008-01-17 18:11 ` Boaz Harrosh [this message]
2008-01-17 18:30 ` Andrew Vasquez
2008-01-17 18:57 ` [PATCH 2/8 ver2] " Boaz Harrosh
2008-01-17 16:46 ` [PATCH 3/8] NCR5380: Not sg-chain ready Boaz Harrosh
2008-01-17 16:48 ` [PATCH 4/8] wd33c93: " Boaz Harrosh
2008-01-17 16:49 ` [PATCH 5/8] arm/scsi: " Boaz Harrosh
2008-01-17 16:51 ` scsi: Drivers not ready for sg-chaining Boaz Harrosh
2008-02-10 15:42 ` James Bottomley
2008-02-10 16:08 ` Boaz Harrosh
2008-02-10 16:16 ` James Bottomley
2008-02-10 16:36 ` Boaz Harrosh
2008-02-10 16:53 ` James Bottomley
2008-01-17 16:53 ` [PATCH 7/8] a100u2w: advansys: initio: Wrong use of SG_ALL Boaz Harrosh
2008-01-17 16:55 ` [PATCH 8/8] Change SG_ALL to mean "any size" Boaz Harrosh
2008-01-17 17:53 ` [patch 0/8] " Stefan Richter
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=478F9A6D.1010605@panasas.com \
--to=bharrosh@panasas.com \
--cc=James.Bottomley@SteelEye.com \
--cc=andrew.vasquez@qlogic.com \
--cc=linux-scsi@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.