diff options
author | Mike Christie <michaelc@cs.wisc.edu> | 2008-06-16 11:11:33 -0400 |
---|---|---|
committer | James Bottomley <James.Bottomley@HansenPartnership.com> | 2008-07-12 09:22:29 -0400 |
commit | 8e9a20cee4511be4560f9c858d9994eb6913731e (patch) | |
tree | ccfdb98eb453c5c02c10ac98a9ed5eb141924910 | |
parent | c95fddc729fafb43f420747027eeb998c2e5e798 (diff) |
[SCSI] libiscsi, iscsi_tcp, ib_iser: fix setting of can_queue with old tools.
This patch fixes two bugs that are related.
1. Old tools did not set can_queue/cmds_max. This patch modifies
libiscsi so that when we add the host we catch this and set it
to the default.
2. iscsi_tcp thought that the scsi command that was passed to
the eh functions needed a iscsi_cmd_task allocated for it. It
only needed a mgmt task, and now it does not matter since it
all comes from the same pool and libiscsi handles this for the
drivers. ib_iser had copied iscsi_tcp's code and set can_queue
to its max - 1 to handle this. So this patch removes the max -1,
and just sets it to the max.
Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
-rw-r--r-- | drivers/infiniband/ulp/iser/iscsi_iser.c | 1 | ||||
-rw-r--r-- | drivers/scsi/iscsi_tcp.c | 1 | ||||
-rw-r--r-- | drivers/scsi/libiscsi.c | 6 |
3 files changed, 6 insertions, 2 deletions
diff --git a/drivers/infiniband/ulp/iser/iscsi_iser.c b/drivers/infiniband/ulp/iser/iscsi_iser.c index c02eabd383a1..a56931e03976 100644 --- a/drivers/infiniband/ulp/iser/iscsi_iser.c +++ b/drivers/infiniband/ulp/iser/iscsi_iser.c | |||
@@ -595,7 +595,6 @@ static struct scsi_host_template iscsi_iser_sht = { | |||
595 | .name = "iSCSI Initiator over iSER, v." DRV_VER, | 595 | .name = "iSCSI Initiator over iSER, v." DRV_VER, |
596 | .queuecommand = iscsi_queuecommand, | 596 | .queuecommand = iscsi_queuecommand, |
597 | .change_queue_depth = iscsi_change_queue_depth, | 597 | .change_queue_depth = iscsi_change_queue_depth, |
598 | .can_queue = ISCSI_DEF_XMIT_CMDS_MAX - 1, | ||
599 | .sg_tablesize = ISCSI_ISER_SG_TABLESIZE, | 598 | .sg_tablesize = ISCSI_ISER_SG_TABLESIZE, |
600 | .max_sectors = 1024, | 599 | .max_sectors = 1024, |
601 | .cmd_per_lun = ISCSI_MAX_CMD_PER_LUN, | 600 | .cmd_per_lun = ISCSI_MAX_CMD_PER_LUN, |
diff --git a/drivers/scsi/iscsi_tcp.c b/drivers/scsi/iscsi_tcp.c index 0bd8b3dc3c19..2a2f0094570f 100644 --- a/drivers/scsi/iscsi_tcp.c +++ b/drivers/scsi/iscsi_tcp.c | |||
@@ -1865,7 +1865,6 @@ iscsi_tcp_session_create(struct iscsi_endpoint *ep, uint16_t cmds_max, | |||
1865 | shost->max_id = 0; | 1865 | shost->max_id = 0; |
1866 | shost->max_channel = 0; | 1866 | shost->max_channel = 0; |
1867 | shost->max_cmd_len = SCSI_MAX_VARLEN_CDB_SIZE; | 1867 | shost->max_cmd_len = SCSI_MAX_VARLEN_CDB_SIZE; |
1868 | shost->can_queue = cmds_max; | ||
1869 | 1868 | ||
1870 | if (iscsi_host_add(shost, NULL)) | 1869 | if (iscsi_host_add(shost, NULL)) |
1871 | goto free_host; | 1870 | goto free_host; |
diff --git a/drivers/scsi/libiscsi.c b/drivers/scsi/libiscsi.c index 8b4e412a0974..299e075a7b34 100644 --- a/drivers/scsi/libiscsi.c +++ b/drivers/scsi/libiscsi.c | |||
@@ -1857,6 +1857,9 @@ EXPORT_SYMBOL_GPL(iscsi_pool_free); | |||
1857 | */ | 1857 | */ |
1858 | int iscsi_host_add(struct Scsi_Host *shost, struct device *pdev) | 1858 | int iscsi_host_add(struct Scsi_Host *shost, struct device *pdev) |
1859 | { | 1859 | { |
1860 | if (!shost->can_queue) | ||
1861 | shost->can_queue = ISCSI_DEF_XMIT_CMDS_MAX; | ||
1862 | |||
1860 | return scsi_add_host(shost, pdev); | 1863 | return scsi_add_host(shost, pdev); |
1861 | } | 1864 | } |
1862 | EXPORT_SYMBOL_GPL(iscsi_host_add); | 1865 | EXPORT_SYMBOL_GPL(iscsi_host_add); |
@@ -1942,6 +1945,9 @@ iscsi_session_setup(struct iscsi_transport *iscsit, struct Scsi_Host *shost, | |||
1942 | struct iscsi_session *session; | 1945 | struct iscsi_session *session; |
1943 | struct iscsi_cls_session *cls_session; | 1946 | struct iscsi_cls_session *cls_session; |
1944 | int cmd_i, scsi_cmds, total_cmds = cmds_max; | 1947 | int cmd_i, scsi_cmds, total_cmds = cmds_max; |
1948 | |||
1949 | if (!total_cmds) | ||
1950 | total_cmds = ISCSI_DEF_XMIT_CMDS_MAX; | ||
1945 | /* | 1951 | /* |
1946 | * The iscsi layer needs some tasks for nop handling and tmfs, | 1952 | * The iscsi layer needs some tasks for nop handling and tmfs, |
1947 | * so the cmds_max must at least be greater than ISCSI_MGMT_CMDS_MAX | 1953 | * so the cmds_max must at least be greater than ISCSI_MGMT_CMDS_MAX |