aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi
diff options
context:
space:
mode:
authorMike Christie <michaelc@cs.wisc.edu>2009-03-05 15:46:04 -0500
committerJames Bottomley <James.Bottomley@HansenPartnership.com>2009-03-13 16:28:55 -0400
commit4d1083509a69a36cc1394f188b7b8956e5526a16 (patch)
tree7afdc7d1e1ae88ee5199d57d3fc8952f985620b7 /drivers/scsi
parent32ae763e3fce4192cd008956a340353a2e5c3192 (diff)
[SCSI] iscsi lib: remove qdepth param from iscsi host allocation
The qdepth setting was useful when we needed libiscsi to verify the setting. Now we just need to make sure if older tools passed in zero then we need to set some default. So this patch just has us use the sht->cmd_per_lun or if for LLD does a host per session then we can set it on per host basis. Signed-off-by: Mike Christie <michaelc@cs.wisc.edu> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
Diffstat (limited to 'drivers/scsi')
-rw-r--r--drivers/scsi/cxgb3i/cxgb3i_iscsi.c5
-rw-r--r--drivers/scsi/iscsi_tcp.c3
-rw-r--r--drivers/scsi/libiscsi.c11
3 files changed, 8 insertions, 11 deletions
diff --git a/drivers/scsi/cxgb3i/cxgb3i_iscsi.c b/drivers/scsi/cxgb3i/cxgb3i_iscsi.c
index f6ed9c62efb0..307f55e329f5 100644
--- a/drivers/scsi/cxgb3i/cxgb3i_iscsi.c
+++ b/drivers/scsi/cxgb3i/cxgb3i_iscsi.c
@@ -170,8 +170,7 @@ struct cxgb3i_hba *cxgb3i_hba_host_add(struct cxgb3i_adapter *snic,
170 int err; 170 int err;
171 171
172 shost = iscsi_host_alloc(&cxgb3i_host_template, 172 shost = iscsi_host_alloc(&cxgb3i_host_template,
173 sizeof(struct cxgb3i_hba), 173 sizeof(struct cxgb3i_hba), 1);
174 CXGB3I_SCSI_QDEPTH_DFLT, 1);
175 if (!shost) { 174 if (!shost) {
176 cxgb3i_log_info("iscsi_host_alloc failed.\n"); 175 cxgb3i_log_info("iscsi_host_alloc failed.\n");
177 return NULL; 176 return NULL;
@@ -843,7 +842,7 @@ static struct scsi_host_template cxgb3i_host_template = {
843 .can_queue = CXGB3I_SCSI_QDEPTH_DFLT - 1, 842 .can_queue = CXGB3I_SCSI_QDEPTH_DFLT - 1,
844 .sg_tablesize = SG_ALL, 843 .sg_tablesize = SG_ALL,
845 .max_sectors = 0xFFFF, 844 .max_sectors = 0xFFFF,
846 .cmd_per_lun = ISCSI_DEF_CMD_PER_LUN, 845 .cmd_per_lun = CXGB3I_SCSI_QDEPTH_DFLT,
847 .eh_abort_handler = iscsi_eh_abort, 846 .eh_abort_handler = iscsi_eh_abort,
848 .eh_device_reset_handler = iscsi_eh_device_reset, 847 .eh_device_reset_handler = iscsi_eh_device_reset,
849 .eh_target_reset_handler = iscsi_eh_target_reset, 848 .eh_target_reset_handler = iscsi_eh_target_reset,
diff --git a/drivers/scsi/iscsi_tcp.c b/drivers/scsi/iscsi_tcp.c
index 79a706a94c68..ad8676c98c68 100644
--- a/drivers/scsi/iscsi_tcp.c
+++ b/drivers/scsi/iscsi_tcp.c
@@ -777,10 +777,11 @@ iscsi_sw_tcp_session_create(struct iscsi_endpoint *ep, uint16_t cmds_max,
777 return NULL; 777 return NULL;
778 } 778 }
779 779
780 shost = iscsi_host_alloc(&iscsi_sw_tcp_sht, 0, qdepth, 1); 780 shost = iscsi_host_alloc(&iscsi_sw_tcp_sht, 0, 1);
781 if (!shost) 781 if (!shost)
782 return NULL; 782 return NULL;
783 shost->transportt = iscsi_sw_tcp_scsi_transport; 783 shost->transportt = iscsi_sw_tcp_scsi_transport;
784 shost->cmd_per_lun = qdepth;
784 shost->max_lun = iscsi_max_lun; 785 shost->max_lun = iscsi_max_lun;
785 shost->max_id = 0; 786 shost->max_id = 0;
786 shost->max_channel = 0; 787 shost->max_channel = 0;
diff --git a/drivers/scsi/libiscsi.c b/drivers/scsi/libiscsi.c
index ff891543df22..d12f9794fcd0 100644
--- a/drivers/scsi/libiscsi.c
+++ b/drivers/scsi/libiscsi.c
@@ -2046,6 +2046,9 @@ int iscsi_host_add(struct Scsi_Host *shost, struct device *pdev)
2046 if (!shost->can_queue) 2046 if (!shost->can_queue)
2047 shost->can_queue = ISCSI_DEF_XMIT_CMDS_MAX; 2047 shost->can_queue = ISCSI_DEF_XMIT_CMDS_MAX;
2048 2048
2049 if (!shost->cmd_per_lun)
2050 shost->cmd_per_lun = ISCSI_DEF_CMD_PER_LUN;
2051
2049 if (!shost->transportt->eh_timed_out) 2052 if (!shost->transportt->eh_timed_out)
2050 shost->transportt->eh_timed_out = iscsi_eh_cmd_timed_out; 2053 shost->transportt->eh_timed_out = iscsi_eh_cmd_timed_out;
2051 return scsi_add_host(shost, pdev); 2054 return scsi_add_host(shost, pdev);
@@ -2056,15 +2059,13 @@ EXPORT_SYMBOL_GPL(iscsi_host_add);
2056 * iscsi_host_alloc - allocate a host and driver data 2059 * iscsi_host_alloc - allocate a host and driver data
2057 * @sht: scsi host template 2060 * @sht: scsi host template
2058 * @dd_data_size: driver host data size 2061 * @dd_data_size: driver host data size
2059 * @qdepth: default device queue depth
2060 * @xmit_can_sleep: bool indicating if LLD will queue IO from a work queue 2062 * @xmit_can_sleep: bool indicating if LLD will queue IO from a work queue
2061 * 2063 *
2062 * This should be called by partial offload and software iscsi drivers. 2064 * This should be called by partial offload and software iscsi drivers.
2063 * To access the driver specific memory use the iscsi_host_priv() macro. 2065 * To access the driver specific memory use the iscsi_host_priv() macro.
2064 */ 2066 */
2065struct Scsi_Host *iscsi_host_alloc(struct scsi_host_template *sht, 2067struct Scsi_Host *iscsi_host_alloc(struct scsi_host_template *sht,
2066 int dd_data_size, uint16_t qdepth, 2068 int dd_data_size, bool xmit_can_sleep)
2067 bool xmit_can_sleep)
2068{ 2069{
2069 struct Scsi_Host *shost; 2070 struct Scsi_Host *shost;
2070 struct iscsi_host *ihost; 2071 struct iscsi_host *ihost;
@@ -2072,10 +2073,6 @@ struct Scsi_Host *iscsi_host_alloc(struct scsi_host_template *sht,
2072 shost = scsi_host_alloc(sht, sizeof(struct iscsi_host) + dd_data_size); 2073 shost = scsi_host_alloc(sht, sizeof(struct iscsi_host) + dd_data_size);
2073 if (!shost) 2074 if (!shost)
2074 return NULL; 2075 return NULL;
2075
2076 if (qdepth == 0)
2077 qdepth = ISCSI_DEF_CMD_PER_LUN;
2078 shost->cmd_per_lun = qdepth;
2079 ihost = shost_priv(shost); 2076 ihost = shost_priv(shost);
2080 2077
2081 if (xmit_can_sleep) { 2078 if (xmit_can_sleep) {