aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/qla2xxx
diff options
context:
space:
mode:
authorAndrew Vasquez <andrew.vasquez@qlogic.com>2009-03-24 12:08:15 -0400
committerJames Bottomley <James.Bottomley@HansenPartnership.com>2009-04-03 10:22:52 -0400
commitd743de66754a662399bd9fe7da7a34e189f71876 (patch)
treedb205f7c01d0c2db4114a7aa6d574e18d36d83b1 /drivers/scsi/qla2xxx
parent3d79038f92841052aced9aec43c9d9aa864d28ab (diff)
[SCSI] qla2xxx: Reduce request queue-size overhead with recent ISPs.
The original code to 'resize request-queues' based on iocb-counts and employed during early ISP23xx testing was too overly-pessimistic with regards to latencies in the firmware pulling requests. Recent ISPs can easily keep up processing a stream of commands from an abbreviated (effectively, half the original size) queue. Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
Diffstat (limited to 'drivers/scsi/qla2xxx')
-rw-r--r--drivers/scsi/qla2xxx/qla_def.h3
-rw-r--r--drivers/scsi/qla2xxx/qla_init.c67
2 files changed, 6 insertions, 64 deletions
diff --git a/drivers/scsi/qla2xxx/qla_def.h b/drivers/scsi/qla2xxx/qla_def.h
index 01b7fc6f000b..1a84dbf82510 100644
--- a/drivers/scsi/qla2xxx/qla_def.h
+++ b/drivers/scsi/qla2xxx/qla_def.h
@@ -176,8 +176,7 @@
176/* ISP request and response entry counts (37-65535) */ 176/* ISP request and response entry counts (37-65535) */
177#define REQUEST_ENTRY_CNT_2100 128 /* Number of request entries. */ 177#define REQUEST_ENTRY_CNT_2100 128 /* Number of request entries. */
178#define REQUEST_ENTRY_CNT_2200 2048 /* Number of request entries. */ 178#define REQUEST_ENTRY_CNT_2200 2048 /* Number of request entries. */
179#define REQUEST_ENTRY_CNT_2XXX_EXT_MEM 4096 /* Number of request entries. */ 179#define REQUEST_ENTRY_CNT_24XX 2048 /* Number of request entries. */
180#define REQUEST_ENTRY_CNT_24XX 4096 /* Number of request entries. */
181#define RESPONSE_ENTRY_CNT_2100 64 /* Number of response entries.*/ 180#define RESPONSE_ENTRY_CNT_2100 64 /* Number of response entries.*/
182#define RESPONSE_ENTRY_CNT_2300 512 /* Number of response entries.*/ 181#define RESPONSE_ENTRY_CNT_2300 512 /* Number of response entries.*/
183 182
diff --git a/drivers/scsi/qla2xxx/qla_init.c b/drivers/scsi/qla2xxx/qla_init.c
index 997c83b07e8a..f90fd3774f19 100644
--- a/drivers/scsi/qla2xxx/qla_init.c
+++ b/drivers/scsi/qla2xxx/qla_init.c
@@ -20,7 +20,6 @@
20* QLogic ISP2x00 Hardware Support Function Prototypes. 20* QLogic ISP2x00 Hardware Support Function Prototypes.
21*/ 21*/
22static int qla2x00_isp_firmware(scsi_qla_host_t *); 22static int qla2x00_isp_firmware(scsi_qla_host_t *);
23static void qla2x00_resize_request_q(scsi_qla_host_t *);
24static int qla2x00_setup_chip(scsi_qla_host_t *); 23static int qla2x00_setup_chip(scsi_qla_host_t *);
25static int qla2x00_init_rings(scsi_qla_host_t *); 24static int qla2x00_init_rings(scsi_qla_host_t *);
26static int qla2x00_fw_ready(scsi_qla_host_t *); 25static int qla2x00_fw_ready(scsi_qla_host_t *);
@@ -893,62 +892,6 @@ cont_alloc:
893} 892}
894 893
895/** 894/**
896 * qla2x00_resize_request_q() - Resize request queue given available ISP memory.
897 * @ha: HA context
898 *
899 * Returns 0 on success.
900 */
901static void
902qla2x00_resize_request_q(scsi_qla_host_t *vha)
903{
904 int rval;
905 uint16_t fw_iocb_cnt = 0;
906 uint16_t request_q_length = REQUEST_ENTRY_CNT_2XXX_EXT_MEM;
907 dma_addr_t request_dma;
908 request_t *request_ring;
909 struct qla_hw_data *ha = vha->hw;
910 struct req_que *req = ha->req_q_map[0];
911
912 /* Valid only on recent ISPs. */
913 if (IS_QLA2100(ha) || IS_QLA2200(ha))
914 return;
915
916 /* Retrieve IOCB counts available to the firmware. */
917 rval = qla2x00_get_resource_cnts(vha, NULL, NULL, NULL, &fw_iocb_cnt,
918 &ha->max_npiv_vports);
919 if (rval)
920 return;
921 /* No point in continuing if current settings are sufficient. */
922 if (fw_iocb_cnt < 1024)
923 return;
924 if (req->length >= request_q_length)
925 return;
926
927 /* Attempt to claim larger area for request queue. */
928 request_ring = dma_alloc_coherent(&ha->pdev->dev,
929 (request_q_length + 1) * sizeof(request_t), &request_dma,
930 GFP_KERNEL);
931 if (request_ring == NULL)
932 return;
933
934 /* Resize successful, report extensions. */
935 qla_printk(KERN_INFO, ha, "Extended memory detected (%d KB)...\n",
936 (ha->fw_memory_size + 1) / 1024);
937 qla_printk(KERN_INFO, ha, "Resizing request queue depth "
938 "(%d -> %d)...\n", req->length, request_q_length);
939
940 /* Clear old allocations. */
941 dma_free_coherent(&ha->pdev->dev,
942 (req->length + 1) * sizeof(request_t), req->ring,
943 req->dma);
944
945 /* Begin using larger queue. */
946 req->length = request_q_length;
947 req->ring = request_ring;
948 req->dma = request_dma;
949}
950
951/**
952 * qla2x00_setup_chip() - Load and start RISC firmware. 895 * qla2x00_setup_chip() - Load and start RISC firmware.
953 * @ha: HA context 896 * @ha: HA context
954 * 897 *
@@ -1005,11 +948,11 @@ qla2x00_setup_chip(scsi_qla_host_t *vha)
1005 ha->max_npiv_vports = 948 ha->max_npiv_vports =
1006 MIN_MULTI_ID_FABRIC - 1; 949 MIN_MULTI_ID_FABRIC - 1;
1007 } 950 }
1008 if (!fw_major_version) { 951 qla2x00_get_resource_cnts(vha, NULL, NULL,
1009 qla2x00_resize_request_q(vha); 952 NULL, NULL, &ha->max_npiv_vports);
1010 if (ql2xallocfwdump) 953
1011 qla2x00_alloc_fw_dump(vha); 954 if (!fw_major_version && ql2xallocfwdump)
1012 } 955 qla2x00_alloc_fw_dump(vha);
1013 } 956 }
1014 } else { 957 } else {
1015 DEBUG2(printk(KERN_INFO 958 DEBUG2(printk(KERN_INFO