Commit 4d108350 authored by Mike Christie's avatar Mike Christie Committed by James Bottomley

[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: default avatarMike Christie <michaelc@cs.wisc.edu>
Signed-off-by: default avatarJames Bottomley <James.Bottomley@HansenPartnership.com>
parent 32ae763e
...@@ -404,7 +404,7 @@ iscsi_iser_session_create(struct iscsi_endpoint *ep, ...@@ -404,7 +404,7 @@ iscsi_iser_session_create(struct iscsi_endpoint *ep,
struct Scsi_Host *shost; struct Scsi_Host *shost;
struct iser_conn *ib_conn; struct iser_conn *ib_conn;
shost = iscsi_host_alloc(&iscsi_iser_sht, 0, ISER_DEF_CMD_PER_LUN, 1); shost = iscsi_host_alloc(&iscsi_iser_sht, 0, 1);
if (!shost) if (!shost)
return NULL; return NULL;
shost->transportt = iscsi_iser_scsi_transport; shost->transportt = iscsi_iser_scsi_transport;
......
...@@ -170,8 +170,7 @@ struct cxgb3i_hba *cxgb3i_hba_host_add(struct cxgb3i_adapter *snic, ...@@ -170,8 +170,7 @@ struct cxgb3i_hba *cxgb3i_hba_host_add(struct cxgb3i_adapter *snic,
int err; int err;
shost = iscsi_host_alloc(&cxgb3i_host_template, shost = iscsi_host_alloc(&cxgb3i_host_template,
sizeof(struct cxgb3i_hba), sizeof(struct cxgb3i_hba), 1);
CXGB3I_SCSI_QDEPTH_DFLT, 1);
if (!shost) { if (!shost) {
cxgb3i_log_info("iscsi_host_alloc failed.\n"); cxgb3i_log_info("iscsi_host_alloc failed.\n");
return NULL; return NULL;
...@@ -843,7 +842,7 @@ static struct scsi_host_template cxgb3i_host_template = { ...@@ -843,7 +842,7 @@ static struct scsi_host_template cxgb3i_host_template = {
.can_queue = CXGB3I_SCSI_QDEPTH_DFLT - 1, .can_queue = CXGB3I_SCSI_QDEPTH_DFLT - 1,
.sg_tablesize = SG_ALL, .sg_tablesize = SG_ALL,
.max_sectors = 0xFFFF, .max_sectors = 0xFFFF,
.cmd_per_lun = ISCSI_DEF_CMD_PER_LUN, .cmd_per_lun = CXGB3I_SCSI_QDEPTH_DFLT,
.eh_abort_handler = iscsi_eh_abort, .eh_abort_handler = iscsi_eh_abort,
.eh_device_reset_handler = iscsi_eh_device_reset, .eh_device_reset_handler = iscsi_eh_device_reset,
.eh_target_reset_handler = iscsi_eh_target_reset, .eh_target_reset_handler = iscsi_eh_target_reset,
......
...@@ -777,10 +777,11 @@ iscsi_sw_tcp_session_create(struct iscsi_endpoint *ep, uint16_t cmds_max, ...@@ -777,10 +777,11 @@ iscsi_sw_tcp_session_create(struct iscsi_endpoint *ep, uint16_t cmds_max,
return NULL; return NULL;
} }
shost = iscsi_host_alloc(&iscsi_sw_tcp_sht, 0, qdepth, 1); shost = iscsi_host_alloc(&iscsi_sw_tcp_sht, 0, 1);
if (!shost) if (!shost)
return NULL; return NULL;
shost->transportt = iscsi_sw_tcp_scsi_transport; shost->transportt = iscsi_sw_tcp_scsi_transport;
shost->cmd_per_lun = qdepth;
shost->max_lun = iscsi_max_lun; shost->max_lun = iscsi_max_lun;
shost->max_id = 0; shost->max_id = 0;
shost->max_channel = 0; shost->max_channel = 0;
......
...@@ -2046,6 +2046,9 @@ int iscsi_host_add(struct Scsi_Host *shost, struct device *pdev) ...@@ -2046,6 +2046,9 @@ int iscsi_host_add(struct Scsi_Host *shost, struct device *pdev)
if (!shost->can_queue) if (!shost->can_queue)
shost->can_queue = ISCSI_DEF_XMIT_CMDS_MAX; shost->can_queue = ISCSI_DEF_XMIT_CMDS_MAX;
if (!shost->cmd_per_lun)
shost->cmd_per_lun = ISCSI_DEF_CMD_PER_LUN;
if (!shost->transportt->eh_timed_out) if (!shost->transportt->eh_timed_out)
shost->transportt->eh_timed_out = iscsi_eh_cmd_timed_out; shost->transportt->eh_timed_out = iscsi_eh_cmd_timed_out;
return scsi_add_host(shost, pdev); return scsi_add_host(shost, pdev);
...@@ -2056,15 +2059,13 @@ EXPORT_SYMBOL_GPL(iscsi_host_add); ...@@ -2056,15 +2059,13 @@ EXPORT_SYMBOL_GPL(iscsi_host_add);
* iscsi_host_alloc - allocate a host and driver data * iscsi_host_alloc - allocate a host and driver data
* @sht: scsi host template * @sht: scsi host template
* @dd_data_size: driver host data size * @dd_data_size: driver host data size
* @qdepth: default device queue depth
* @xmit_can_sleep: bool indicating if LLD will queue IO from a work queue * @xmit_can_sleep: bool indicating if LLD will queue IO from a work queue
* *
* This should be called by partial offload and software iscsi drivers. * This should be called by partial offload and software iscsi drivers.
* To access the driver specific memory use the iscsi_host_priv() macro. * To access the driver specific memory use the iscsi_host_priv() macro.
*/ */
struct Scsi_Host *iscsi_host_alloc(struct scsi_host_template *sht, struct Scsi_Host *iscsi_host_alloc(struct scsi_host_template *sht,
int dd_data_size, uint16_t qdepth, int dd_data_size, bool xmit_can_sleep)
bool xmit_can_sleep)
{ {
struct Scsi_Host *shost; struct Scsi_Host *shost;
struct iscsi_host *ihost; struct iscsi_host *ihost;
...@@ -2072,10 +2073,6 @@ struct Scsi_Host *iscsi_host_alloc(struct scsi_host_template *sht, ...@@ -2072,10 +2073,6 @@ struct Scsi_Host *iscsi_host_alloc(struct scsi_host_template *sht,
shost = scsi_host_alloc(sht, sizeof(struct iscsi_host) + dd_data_size); shost = scsi_host_alloc(sht, sizeof(struct iscsi_host) + dd_data_size);
if (!shost) if (!shost)
return NULL; return NULL;
if (qdepth == 0)
qdepth = ISCSI_DEF_CMD_PER_LUN;
shost->cmd_per_lun = qdepth;
ihost = shost_priv(shost); ihost = shost_priv(shost);
if (xmit_can_sleep) { if (xmit_can_sleep) {
......
...@@ -346,7 +346,7 @@ extern int iscsi_host_get_param(struct Scsi_Host *shost, ...@@ -346,7 +346,7 @@ extern int iscsi_host_get_param(struct Scsi_Host *shost,
enum iscsi_host_param param, char *buf); enum iscsi_host_param param, char *buf);
extern int iscsi_host_add(struct Scsi_Host *shost, struct device *pdev); extern int iscsi_host_add(struct Scsi_Host *shost, struct device *pdev);
extern struct Scsi_Host *iscsi_host_alloc(struct scsi_host_template *sht, extern struct Scsi_Host *iscsi_host_alloc(struct scsi_host_template *sht,
int dd_data_size, uint16_t qdepth, int dd_data_size,
bool xmit_can_sleep); bool xmit_can_sleep);
extern void iscsi_host_remove(struct Scsi_Host *shost); extern void iscsi_host_remove(struct Scsi_Host *shost);
extern void iscsi_host_free(struct Scsi_Host *shost); extern void iscsi_host_free(struct Scsi_Host *shost);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment