diff options
author | Anirban Chakraborty <anirban.chakraborty@qlogic.com> | 2008-12-09 19:45:39 -0500 |
---|---|---|
committer | James Bottomley <James.Bottomley@HansenPartnership.com> | 2008-12-29 12:24:33 -0500 |
commit | 73208dfd7ab19f379d73e8a0fbf30f92c203e5e8 (patch) | |
tree | f69be5e89817d17b066ece4dbe04e395339c0754 /drivers/scsi/qla2xxx/qla_def.h | |
parent | 85b4aa4926a50210b683ac89326e338e7d131211 (diff) |
[SCSI] qla2xxx: add support for multi-queue adapter
Following changes have been made.
1. qla_hw_data structure holds an array for request queue pointers,
and an array for response queue pointers.
2. The base request and response queues are created by default.
3. Additional request and response queues are created at the time of vport
creation. If queue resources are exhausted during vport creation, newly
created vports use the default queue.
4. Requests are sent to the request queue that the vport was assigned
in the beginning.
5. Responses are completed on the response queue with which the request queue
is associated with.
[fixup memcpy argument reversal spotted by davej@redhat.com]
Signed-off-by: Anirban Chakraborty <anirban.chakraborty@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
Diffstat (limited to 'drivers/scsi/qla2xxx/qla_def.h')
-rw-r--r-- | drivers/scsi/qla2xxx/qla_def.h | 64 |
1 files changed, 52 insertions, 12 deletions
diff --git a/drivers/scsi/qla2xxx/qla_def.h b/drivers/scsi/qla2xxx/qla_def.h index edead2802517..5ecf29283b6b 100644 --- a/drivers/scsi/qla2xxx/qla_def.h +++ b/drivers/scsi/qla2xxx/qla_def.h | |||
@@ -369,9 +369,17 @@ struct device_reg_2xxx { | |||
369 | } u_end; | 369 | } u_end; |
370 | }; | 370 | }; |
371 | 371 | ||
372 | struct device_reg_25xxmq { | ||
373 | volatile uint32_t req_q_in; | ||
374 | volatile uint32_t req_q_out; | ||
375 | volatile uint32_t rsp_q_in; | ||
376 | volatile uint32_t rsp_q_out; | ||
377 | }; | ||
378 | |||
372 | typedef union { | 379 | typedef union { |
373 | struct device_reg_2xxx isp; | 380 | struct device_reg_2xxx isp; |
374 | struct device_reg_24xx isp24; | 381 | struct device_reg_24xx isp24; |
382 | struct device_reg_25xxmq isp25mq; | ||
375 | } device_reg_t; | 383 | } device_reg_t; |
376 | 384 | ||
377 | #define ISP_REQ_Q_IN(ha, reg) \ | 385 | #define ISP_REQ_Q_IN(ha, reg) \ |
@@ -2037,6 +2045,7 @@ typedef struct vport_params { | |||
2037 | #define VP_RET_CODE_NOT_FOUND 6 | 2045 | #define VP_RET_CODE_NOT_FOUND 6 |
2038 | 2046 | ||
2039 | struct qla_hw_data; | 2047 | struct qla_hw_data; |
2048 | struct req_que; | ||
2040 | 2049 | ||
2041 | /* | 2050 | /* |
2042 | * ISP operations | 2051 | * ISP operations |
@@ -2059,7 +2068,8 @@ struct isp_operations { | |||
2059 | void (*enable_intrs) (struct qla_hw_data *); | 2068 | void (*enable_intrs) (struct qla_hw_data *); |
2060 | void (*disable_intrs) (struct qla_hw_data *); | 2069 | void (*disable_intrs) (struct qla_hw_data *); |
2061 | 2070 | ||
2062 | int (*abort_command) (struct scsi_qla_host *, srb_t *); | 2071 | int (*abort_command) (struct scsi_qla_host *, srb_t *, |
2072 | struct req_que *); | ||
2063 | int (*target_reset) (struct fc_port *, unsigned int); | 2073 | int (*target_reset) (struct fc_port *, unsigned int); |
2064 | int (*lun_reset) (struct fc_port *, unsigned int); | 2074 | int (*lun_reset) (struct fc_port *, unsigned int); |
2065 | int (*fabric_login) (struct scsi_qla_host *, uint16_t, uint8_t, | 2075 | int (*fabric_login) (struct scsi_qla_host *, uint16_t, uint8_t, |
@@ -2102,16 +2112,18 @@ struct isp_operations { | |||
2102 | #define QLA_MSIX_DEFAULT 0x00 | 2112 | #define QLA_MSIX_DEFAULT 0x00 |
2103 | #define QLA_MSIX_RSP_Q 0x01 | 2113 | #define QLA_MSIX_RSP_Q 0x01 |
2104 | 2114 | ||
2105 | #define QLA_MSIX_ENTRIES 2 | ||
2106 | #define QLA_MIDX_DEFAULT 0 | 2115 | #define QLA_MIDX_DEFAULT 0 |
2107 | #define QLA_MIDX_RSP_Q 1 | 2116 | #define QLA_MIDX_RSP_Q 1 |
2117 | #define QLA_PCI_MSIX_CONTROL 0xa2 | ||
2108 | 2118 | ||
2109 | struct scsi_qla_host; | 2119 | struct scsi_qla_host; |
2120 | struct rsp_que; | ||
2110 | 2121 | ||
2111 | struct qla_msix_entry { | 2122 | struct qla_msix_entry { |
2112 | int have_irq; | 2123 | int have_irq; |
2113 | uint32_t msix_vector; | 2124 | uint32_t vector; |
2114 | uint16_t msix_entry; | 2125 | uint16_t entry; |
2126 | struct rsp_que *rsp; | ||
2115 | }; | 2127 | }; |
2116 | 2128 | ||
2117 | #define WATCH_INTERVAL 1 /* number of seconds */ | 2129 | #define WATCH_INTERVAL 1 /* number of seconds */ |
@@ -2162,6 +2174,23 @@ struct qla_statistics { | |||
2162 | uint64_t output_bytes; | 2174 | uint64_t output_bytes; |
2163 | }; | 2175 | }; |
2164 | 2176 | ||
2177 | /* Multi queue support */ | ||
2178 | #define MBC_INITIALIZE_MULTIQ 0x1f | ||
2179 | #define QLA_QUE_PAGE 0X1000 | ||
2180 | #define QLA_MQ_SIZE 32 | ||
2181 | #define QLA_MAX_HOST_QUES 16 | ||
2182 | #define QLA_MAX_QUEUES 256 | ||
2183 | #define ISP_QUE_REG(ha, id) \ | ||
2184 | ((ha->mqenable) ? \ | ||
2185 | ((void *)(ha->mqiobase) +\ | ||
2186 | (QLA_QUE_PAGE * id)) :\ | ||
2187 | ((void *)(ha->iobase))) | ||
2188 | #define QLA_REQ_QUE_ID(tag) \ | ||
2189 | ((tag < QLA_MAX_QUEUES && tag > 0) ? tag : 0) | ||
2190 | #define QLA_DEFAULT_QUE_QOS 5 | ||
2191 | #define QLA_PRECONFIG_VPORTS 32 | ||
2192 | #define QLA_MAX_VPORTS_QLA24XX 128 | ||
2193 | #define QLA_MAX_VPORTS_QLA25XX 256 | ||
2165 | /* Response queue data structure */ | 2194 | /* Response queue data structure */ |
2166 | struct rsp_que { | 2195 | struct rsp_que { |
2167 | dma_addr_t dma; | 2196 | dma_addr_t dma; |
@@ -2171,9 +2200,12 @@ struct rsp_que { | |||
2171 | uint16_t out_ptr; | 2200 | uint16_t out_ptr; |
2172 | uint16_t length; | 2201 | uint16_t length; |
2173 | uint16_t options; | 2202 | uint16_t options; |
2174 | uint16_t msix_vector; | ||
2175 | uint16_t rid; | 2203 | uint16_t rid; |
2204 | uint16_t id; | ||
2205 | uint16_t vp_idx; | ||
2176 | struct qla_hw_data *hw; | 2206 | struct qla_hw_data *hw; |
2207 | struct qla_msix_entry *msix; | ||
2208 | struct req_que *req; | ||
2177 | }; | 2209 | }; |
2178 | 2210 | ||
2179 | /* Request queue data structure */ | 2211 | /* Request queue data structure */ |
@@ -2187,10 +2219,10 @@ struct req_que { | |||
2187 | uint16_t length; | 2219 | uint16_t length; |
2188 | uint16_t options; | 2220 | uint16_t options; |
2189 | uint16_t rid; | 2221 | uint16_t rid; |
2222 | uint16_t id; | ||
2190 | uint16_t qos; | 2223 | uint16_t qos; |
2191 | uint16_t vp_idx; | 2224 | uint16_t vp_idx; |
2192 | struct rsp_que *asso_que; | 2225 | struct rsp_que *rsp; |
2193 | /* Outstandings ISP commands. */ | ||
2194 | srb_t *outstanding_cmds[MAX_OUTSTANDING_COMMANDS]; | 2226 | srb_t *outstanding_cmds[MAX_OUTSTANDING_COMMANDS]; |
2195 | uint32_t current_outstanding_cmd; | 2227 | uint32_t current_outstanding_cmd; |
2196 | int max_q_depth; | 2228 | int max_q_depth; |
@@ -2240,8 +2272,17 @@ struct qla_hw_data { | |||
2240 | resource_size_t pio_address; | 2272 | resource_size_t pio_address; |
2241 | 2273 | ||
2242 | #define MIN_IOBASE_LEN 0x100 | 2274 | #define MIN_IOBASE_LEN 0x100 |
2243 | struct req_que *req; | 2275 | /* Multi queue data structs */ |
2244 | struct rsp_que *rsp; | 2276 | device_reg_t *mqiobase; |
2277 | uint16_t msix_count; | ||
2278 | uint8_t mqenable; | ||
2279 | struct req_que **req_q_map; | ||
2280 | struct rsp_que **rsp_q_map; | ||
2281 | unsigned long req_qid_map[(QLA_MAX_QUEUES / 8) / sizeof(unsigned long)]; | ||
2282 | unsigned long rsp_qid_map[(QLA_MAX_QUEUES / 8) / sizeof(unsigned long)]; | ||
2283 | uint16_t max_queues; | ||
2284 | struct qla_npiv_entry *npiv_info; | ||
2285 | uint16_t nvram_npiv_size; | ||
2245 | 2286 | ||
2246 | uint16_t switch_cap; | 2287 | uint16_t switch_cap; |
2247 | #define FLOGI_SEQ_DEL BIT_8 | 2288 | #define FLOGI_SEQ_DEL BIT_8 |
@@ -2502,7 +2543,7 @@ struct qla_hw_data { | |||
2502 | uint16_t zio_timer; | 2543 | uint16_t zio_timer; |
2503 | struct fc_host_statistics fc_host_stat; | 2544 | struct fc_host_statistics fc_host_stat; |
2504 | 2545 | ||
2505 | struct qla_msix_entry msix_entries[QLA_MSIX_ENTRIES]; | 2546 | struct qla_msix_entry *msix_entries; |
2506 | 2547 | ||
2507 | struct list_head vp_list; /* list of VP */ | 2548 | struct list_head vp_list; /* list of VP */ |
2508 | unsigned long vp_idx_map[(MAX_MULTI_ID_FABRIC / 8) / | 2549 | unsigned long vp_idx_map[(MAX_MULTI_ID_FABRIC / 8) / |
@@ -2524,7 +2565,6 @@ typedef struct scsi_qla_host { | |||
2524 | struct list_head list; | 2565 | struct list_head list; |
2525 | struct list_head vp_fcports; /* list of fcports */ | 2566 | struct list_head vp_fcports; /* list of fcports */ |
2526 | struct list_head work_list; | 2567 | struct list_head work_list; |
2527 | |||
2528 | /* Commonly used flags and state information. */ | 2568 | /* Commonly used flags and state information. */ |
2529 | struct Scsi_Host *host; | 2569 | struct Scsi_Host *host; |
2530 | unsigned long host_no; | 2570 | unsigned long host_no; |
@@ -2640,9 +2680,9 @@ typedef struct scsi_qla_host { | |||
2640 | #define VP_ERR_FAB_LOGOUT 4 | 2680 | #define VP_ERR_FAB_LOGOUT 4 |
2641 | #define VP_ERR_ADAP_NORESOURCES 5 | 2681 | #define VP_ERR_ADAP_NORESOURCES 5 |
2642 | struct qla_hw_data *hw; | 2682 | struct qla_hw_data *hw; |
2683 | int req_ques[QLA_MAX_HOST_QUES]; | ||
2643 | } scsi_qla_host_t; | 2684 | } scsi_qla_host_t; |
2644 | 2685 | ||
2645 | |||
2646 | /* | 2686 | /* |
2647 | * Macros to help code, maintain, etc. | 2687 | * Macros to help code, maintain, etc. |
2648 | */ | 2688 | */ |