From: Boaz Harrosh <bharrosh@panasas.com>
To: James Bottomley <James.Bottomley@SteelEye.com>,
linux-scsi <linux-scsi@vger.kernel.org>
Subject: [PATCH 1/8] firewire: ieee1394: Move away from SG_ALL
Date: Thu, 17 Jan 2008 18:41:47 +0200 [thread overview]
Message-ID: <478F854B.2030302@panasas.com> (raw)
In-Reply-To: <478F8435.5000907@panasas.com>
SG_ALL wants to be ~0 meaning "any future size".
Below group of drivers preallocate a scatter list
buffer of max_size, so set that size to be 255 (Like before).
A better schema can be advised with a more dynamic allocation.
Perhaps from a kmem_cache.
List of drivers/files:
drivers/firewire/fw-sbp2.c
drivers/ieee1394/sbp2.[ch]
Signed-off-by: Boaz Harrosh <bharrosh@panasas.com>
---
drivers/firewire/fw-sbp2.c | 6 ++++--
drivers/ieee1394/sbp2.c | 2 +-
drivers/ieee1394/sbp2.h | 4 +++-
3 files changed, 8 insertions(+), 4 deletions(-)
diff --git a/drivers/firewire/fw-sbp2.c b/drivers/firewire/fw-sbp2.c
index c2169d2..078501c 100644
--- a/drivers/firewire/fw-sbp2.c
+++ b/drivers/firewire/fw-sbp2.c
@@ -151,6 +151,7 @@ struct sbp2_target {
};
#define SBP2_MAX_SG_ELEMENT_LENGTH 0xf000
+#define SBP2_MAX_SG_COUNT 255
#define SBP2_MAX_SECTORS 255 /* Max sectors supported */
#define SBP2_ORB_TIMEOUT 2000 /* Timeout in ms */
@@ -272,7 +273,8 @@ struct sbp2_command_orb {
scsi_done_fn_t done;
struct sbp2_logical_unit *lu;
- struct sbp2_pointer page_table[SG_ALL] __attribute__((aligned(8)));
+ struct sbp2_pointer page_table[SBP2_MAX_SG_COUNT]
+ __attribute__((aligned(8)));
dma_addr_t page_table_bus;
};
@@ -1329,7 +1331,7 @@ static struct scsi_host_template scsi_driver_template = {
.slave_configure = sbp2_scsi_slave_configure,
.eh_abort_handler = sbp2_scsi_abort,
.this_id = -1,
- .sg_tablesize = SG_ALL,
+ .sg_tablesize = SBP2_MAX_SG_COUNT,
.use_clustering = ENABLE_CLUSTERING,
.cmd_per_lun = 1,
.can_queue = 1,
diff --git a/drivers/ieee1394/sbp2.c b/drivers/ieee1394/sbp2.c
index 1eda11a..070763a 100644
--- a/drivers/ieee1394/sbp2.c
+++ b/drivers/ieee1394/sbp2.c
@@ -324,7 +324,7 @@ static struct scsi_host_template sbp2_shost_template = {
.slave_configure = sbp2scsi_slave_configure,
.slave_destroy = sbp2scsi_slave_destroy,
.this_id = -1,
- .sg_tablesize = SG_ALL,
+ .sg_tablesize = SBP2_MAX_SG_COUNT,
.use_clustering = ENABLE_CLUSTERING,
.cmd_per_lun = SBP2_MAX_CMDS,
.can_queue = SBP2_MAX_CMDS,
diff --git a/drivers/ieee1394/sbp2.h b/drivers/ieee1394/sbp2.h
index 333a4bb..ae31788 100644
--- a/drivers/ieee1394/sbp2.h
+++ b/drivers/ieee1394/sbp2.h
@@ -222,6 +222,7 @@ struct sbp2_status_block {
*/
#define SBP2_MAX_SG_ELEMENT_LENGTH 0xf000
+#define SBP2_MAX_SG_COUNT 255
#define SBP2_MAX_SECTORS 255
/* There is no real limitation of the queue depth (i.e. length of the linked
* list of command ORBs) at the target. The chosen depth is merely an
@@ -257,7 +258,8 @@ struct sbp2_command_info {
/* Also need s/g structure for each sbp2 command */
struct sbp2_unrestricted_page_table
- scatter_gather_element[SG_ALL] __attribute__((aligned(8)));
+ scatter_gather_element[SBP2_MAX_SG_COUNT]
+ __attribute__((aligned(8)));
dma_addr_t sge_dma;
void *sge_buffer;
dma_addr_t cmd_dma;
--
1.5.3.3
next prev parent reply other threads:[~2008-01-17 16:42 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 ` Boaz Harrosh [this message]
2008-01-17 17:51 ` [PATCH 1/8] firewire: ieee1394: Move away from SG_ALL 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
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=478F854B.2030302@panasas.com \
--to=bharrosh@panasas.com \
--cc=James.Bottomley@SteelEye.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.