diff options
-rw-r--r-- | drivers/scsi/be2iscsi/be_iscsi.c | 7 | ||||
-rw-r--r-- | drivers/scsi/be2iscsi/be_main.c | 106 | ||||
-rw-r--r-- | drivers/scsi/be2iscsi/be_main.h | 10 | ||||
-rw-r--r-- | drivers/scsi/be2iscsi/be_mgmt.c | 11 |
4 files changed, 75 insertions, 59 deletions
diff --git a/drivers/scsi/be2iscsi/be_iscsi.c b/drivers/scsi/be2iscsi/be_iscsi.c index d587b0362f18..2b3c58bd6529 100644 --- a/drivers/scsi/be2iscsi/be_iscsi.c +++ b/drivers/scsi/be2iscsi/be_iscsi.c | |||
@@ -431,9 +431,10 @@ static int beiscsi_open_conn(struct iscsi_endpoint *ep, | |||
431 | } | 431 | } |
432 | SE_DEBUG(DBG_LVL_8, "In beiscsi_open_conn, ep_cid=%d ", | 432 | SE_DEBUG(DBG_LVL_8, "In beiscsi_open_conn, ep_cid=%d ", |
433 | beiscsi_ep->ep_cid); | 433 | beiscsi_ep->ep_cid); |
434 | phba->ep_array[beiscsi_ep->ep_cid] = ep; | 434 | phba->ep_array[beiscsi_ep->ep_cid - |
435 | if (beiscsi_ep->ep_cid > | 435 | phba->fw_config.iscsi_cid_start] = ep; |
436 | (phba->fw_config.iscsi_cid_start + phba->params.cxns_per_ctrl)) { | 436 | if (beiscsi_ep->ep_cid > (phba->fw_config.iscsi_cid_start + |
437 | phba->params.cxns_per_ctrl * 2)) { | ||
437 | SE_DEBUG(DBG_LVL_1, "Failed in allocate iscsi cid\n"); | 438 | SE_DEBUG(DBG_LVL_1, "Failed in allocate iscsi cid\n"); |
438 | return ret; | 439 | return ret; |
439 | } | 440 | } |
diff --git a/drivers/scsi/be2iscsi/be_main.c b/drivers/scsi/be2iscsi/be_main.c index 1a557fa77888..6c512b6416c2 100644 --- a/drivers/scsi/be2iscsi/be_main.c +++ b/drivers/scsi/be2iscsi/be_main.c | |||
@@ -230,29 +230,27 @@ static int be_ctrl_init(struct beiscsi_hba *phba, struct pci_dev *pdev) | |||
230 | 230 | ||
231 | static void beiscsi_get_params(struct beiscsi_hba *phba) | 231 | static void beiscsi_get_params(struct beiscsi_hba *phba) |
232 | { | 232 | { |
233 | phba->params.ios_per_ctrl = BE2_IO_DEPTH; | 233 | phba->params.ios_per_ctrl = (phba->fw_config.iscsi_icd_count |
234 | phba->params.cxns_per_ctrl = BE2_MAX_SESSIONS; | 234 | - (phba->fw_config.iscsi_cid_count |
235 | phba->params.asyncpdus_per_ctrl = BE2_ASYNCPDUS; | 235 | + BE2_TMFS |
236 | phba->params.icds_per_ctrl = BE2_MAX_ICDS / 2; | 236 | + BE2_NOPOUT_REQ)); |
237 | phba->params.cxns_per_ctrl = phba->fw_config.iscsi_cid_count; | ||
238 | phba->params.asyncpdus_per_ctrl = phba->fw_config.iscsi_cid_count;; | ||
239 | phba->params.icds_per_ctrl = phba->fw_config.iscsi_icd_count;; | ||
237 | phba->params.num_sge_per_io = BE2_SGE; | 240 | phba->params.num_sge_per_io = BE2_SGE; |
238 | phba->params.defpdu_hdr_sz = BE2_DEFPDU_HDR_SZ; | 241 | phba->params.defpdu_hdr_sz = BE2_DEFPDU_HDR_SZ; |
239 | phba->params.defpdu_data_sz = BE2_DEFPDU_DATA_SZ; | 242 | phba->params.defpdu_data_sz = BE2_DEFPDU_DATA_SZ; |
240 | phba->params.eq_timer = 64; | 243 | phba->params.eq_timer = 64; |
241 | phba->params.num_eq_entries = | 244 | phba->params.num_eq_entries = |
242 | (((BE2_CMDS_PER_CXN * 2 + BE2_LOGOUTS + BE2_TMFS + BE2_ASYNCPDUS) / | 245 | (((BE2_CMDS_PER_CXN * 2 + phba->fw_config.iscsi_cid_count * 2 |
243 | 512) + 1) * 512; | 246 | + BE2_TMFS) / 512) + 1) * 512; |
244 | phba->params.num_eq_entries = (phba->params.num_eq_entries < 1024) | 247 | phba->params.num_eq_entries = (phba->params.num_eq_entries < 1024) |
245 | ? 1024 : phba->params.num_eq_entries; | 248 | ? 1024 : phba->params.num_eq_entries; |
246 | SE_DEBUG(DBG_LVL_8, "phba->params.num_eq_entries=%d \n", | 249 | SE_DEBUG(DBG_LVL_8, "phba->params.num_eq_entries=%d \n", |
247 | phba->params.num_eq_entries); | 250 | phba->params.num_eq_entries); |
248 | phba->params.num_cq_entries = | 251 | phba->params.num_cq_entries = |
249 | (((BE2_CMDS_PER_CXN * 2 + BE2_LOGOUTS + BE2_TMFS + BE2_ASYNCPDUS) / | 252 | (((BE2_CMDS_PER_CXN * 2 + phba->fw_config.iscsi_cid_count * 2 |
250 | 512) + 1) * 512; | 253 | + BE2_TMFS) / 512) + 1) * 512; |
251 | SE_DEBUG(DBG_LVL_8, | ||
252 | "phba->params.num_cq_entries=%d BE2_CMDS_PER_CXN=%d" | ||
253 | "BE2_LOGOUTS=%d BE2_TMFS=%d BE2_ASYNCPDUS=%d \n", | ||
254 | phba->params.num_cq_entries, BE2_CMDS_PER_CXN, | ||
255 | BE2_LOGOUTS, BE2_TMFS, BE2_ASYNCPDUS); | ||
256 | phba->params.wrbs_per_cxn = 256; | 254 | phba->params.wrbs_per_cxn = 256; |
257 | } | 255 | } |
258 | 256 | ||
@@ -877,7 +875,8 @@ hwi_complete_drvr_msgs(struct beiscsi_conn *beiscsi_conn, | |||
877 | } else { | 875 | } else { |
878 | pwrb_context = &phwi_ctrlr->wrb_context[((psol-> | 876 | pwrb_context = &phwi_ctrlr->wrb_context[((psol-> |
879 | dw[offsetof(struct amap_sol_cqe, cid) / 32] & | 877 | dw[offsetof(struct amap_sol_cqe, cid) / 32] & |
880 | SOL_CID_MASK) >> 6)]; | 878 | SOL_CID_MASK) >> 6) - |
879 | phba->fw_config.iscsi_cid_start]; | ||
881 | pwrb_handle = pwrb_context->pwrb_handle_basestd[((psol-> | 880 | pwrb_handle = pwrb_context->pwrb_handle_basestd[((psol-> |
882 | dw[offsetof(struct amap_sol_cqe, wrb_index) / | 881 | dw[offsetof(struct amap_sol_cqe, wrb_index) / |
883 | 32] & SOL_WRB_INDEX_MASK) >> 16)]; | 882 | 32] & SOL_WRB_INDEX_MASK) >> 16)]; |
@@ -939,7 +938,8 @@ static void hwi_complete_cmd(struct beiscsi_conn *beiscsi_conn, | |||
939 | pwrb_context = &phwi_ctrlr-> | 938 | pwrb_context = &phwi_ctrlr-> |
940 | wrb_context[((psol->dw[offsetof | 939 | wrb_context[((psol->dw[offsetof |
941 | (struct amap_sol_cqe, cid) / 32] | 940 | (struct amap_sol_cqe, cid) / 32] |
942 | & SOL_CID_MASK) >> 6)]; | 941 | & SOL_CID_MASK) >> 6) - |
942 | phba->fw_config.iscsi_cid_start]; | ||
943 | pwrb_handle = pwrb_context->pwrb_handle_basestd[((psol-> | 943 | pwrb_handle = pwrb_context->pwrb_handle_basestd[((psol-> |
944 | dw[offsetof(struct amap_sol_cqe, wrb_index) / | 944 | dw[offsetof(struct amap_sol_cqe, wrb_index) / |
945 | 32] & SOL_WRB_INDEX_MASK) >> 16)]; | 945 | 32] & SOL_WRB_INDEX_MASK) >> 16)]; |
@@ -1077,7 +1077,8 @@ hwi_get_async_handle(struct beiscsi_hba *phba, | |||
1077 | 1077 | ||
1078 | WARN_ON(!pasync_handle); | 1078 | WARN_ON(!pasync_handle); |
1079 | 1079 | ||
1080 | pasync_handle->cri = (unsigned short)beiscsi_conn->beiscsi_conn_cid; | 1080 | pasync_handle->cri = (unsigned short)beiscsi_conn->beiscsi_conn_cid - |
1081 | phba->fw_config.iscsi_cid_start; | ||
1081 | pasync_handle->is_header = is_header; | 1082 | pasync_handle->is_header = is_header; |
1082 | pasync_handle->buffer_len = ((pdpdu_cqe-> | 1083 | pasync_handle->buffer_len = ((pdpdu_cqe-> |
1083 | dw[offsetof(struct amap_i_t_dpdu_cqe, dpl) / 32] | 1084 | dw[offsetof(struct amap_i_t_dpdu_cqe, dpl) / 32] |
@@ -1327,9 +1328,10 @@ hwi_fwd_async_msg(struct beiscsi_conn *beiscsi_conn, | |||
1327 | } | 1328 | } |
1328 | 1329 | ||
1329 | status = beiscsi_process_async_pdu(beiscsi_conn, phba, | 1330 | status = beiscsi_process_async_pdu(beiscsi_conn, phba, |
1330 | beiscsi_conn->beiscsi_conn_cid, | 1331 | (beiscsi_conn->beiscsi_conn_cid - |
1331 | phdr, hdr_len, pfirst_buffer, | 1332 | phba->fw_config.iscsi_cid_start), |
1332 | buf_len); | 1333 | phdr, hdr_len, pfirst_buffer, |
1334 | buf_len); | ||
1333 | 1335 | ||
1334 | if (status == 0) | 1336 | if (status == 0) |
1335 | hwi_free_async_msg(phba, cri); | 1337 | hwi_free_async_msg(phba, cri); |
@@ -1456,10 +1458,10 @@ static unsigned int beiscsi_process_cq(struct be_eq_obj *pbe_eq) | |||
1456 | } | 1458 | } |
1457 | 1459 | ||
1458 | } else { | 1460 | } else { |
1459 | beiscsi_conn = phba->conn_table[(u32) (sol-> | 1461 | beiscsi_conn = phba->conn_table[(u32) ((sol-> |
1460 | dw[offsetof(struct amap_sol_cqe, cid) / 32] & | 1462 | dw[offsetof(struct amap_sol_cqe, cid) / 32] & |
1461 | SOL_CID_MASK) >> 6]; | 1463 | SOL_CID_MASK) >> 6) - |
1462 | 1464 | phba->fw_config.iscsi_cid_start]; | |
1463 | if (!beiscsi_conn || !beiscsi_conn->ep) { | 1465 | if (!beiscsi_conn || !beiscsi_conn->ep) { |
1464 | shost_printk(KERN_WARNING, phba->shost, | 1466 | shost_printk(KERN_WARNING, phba->shost, |
1465 | "Connection table empty for cid = %d\n", | 1467 | "Connection table empty for cid = %d\n", |
@@ -1557,8 +1559,8 @@ static unsigned int beiscsi_process_cq(struct be_eq_obj *pbe_eq) | |||
1557 | "0x%x...\n", | 1559 | "0x%x...\n", |
1558 | sol->dw[offsetof(struct amap_sol_cqe, code) / | 1560 | sol->dw[offsetof(struct amap_sol_cqe, code) / |
1559 | 32] & CQE_CODE_MASK, | 1561 | 32] & CQE_CODE_MASK, |
1560 | sol->dw[offsetof(struct amap_sol_cqe, cid) / | 1562 | (sol->dw[offsetof(struct amap_sol_cqe, cid) / |
1561 | 32] & CQE_CID_MASK); | 1563 | 32] & CQE_CID_MASK)); |
1562 | } | 1564 | } |
1563 | iscsi_conn_failure(beiscsi_conn->conn, | 1565 | iscsi_conn_failure(beiscsi_conn->conn, |
1564 | ISCSI_ERR_CONN_FAILED); | 1566 | ISCSI_ERR_CONN_FAILED); |
@@ -1575,8 +1577,8 @@ static unsigned int beiscsi_process_cq(struct be_eq_obj *pbe_eq) | |||
1575 | "received/sent on CID 0x%x...\n", | 1577 | "received/sent on CID 0x%x...\n", |
1576 | sol->dw[offsetof(struct amap_sol_cqe, code) / | 1578 | sol->dw[offsetof(struct amap_sol_cqe, code) / |
1577 | 32] & CQE_CODE_MASK, | 1579 | 32] & CQE_CODE_MASK, |
1578 | sol->dw[offsetof(struct amap_sol_cqe, cid) / | 1580 | (sol->dw[offsetof(struct amap_sol_cqe, cid) / |
1579 | 32] & CQE_CID_MASK); | 1581 | 32] & CQE_CID_MASK)); |
1580 | } | 1582 | } |
1581 | iscsi_conn_failure(beiscsi_conn->conn, | 1583 | iscsi_conn_failure(beiscsi_conn->conn, |
1582 | ISCSI_ERR_CONN_FAILED); | 1584 | ISCSI_ERR_CONN_FAILED); |
@@ -1586,8 +1588,8 @@ static unsigned int beiscsi_process_cq(struct be_eq_obj *pbe_eq) | |||
1586 | "received on CID 0x%x...\n", | 1588 | "received on CID 0x%x...\n", |
1587 | sol->dw[offsetof(struct amap_sol_cqe, code) / | 1589 | sol->dw[offsetof(struct amap_sol_cqe, code) / |
1588 | 32] & CQE_CODE_MASK, | 1590 | 32] & CQE_CODE_MASK, |
1589 | sol->dw[offsetof(struct amap_sol_cqe, cid) / | 1591 | (sol->dw[offsetof(struct amap_sol_cqe, cid) / |
1590 | 32] & CQE_CID_MASK); | 1592 | 32] & CQE_CID_MASK)); |
1591 | break; | 1593 | break; |
1592 | } | 1594 | } |
1593 | 1595 | ||
@@ -2383,7 +2385,7 @@ static int beiscsi_create_cqs(struct beiscsi_hba *phba, | |||
2383 | &paddr); | 2385 | &paddr); |
2384 | if (!cq_vaddress) | 2386 | if (!cq_vaddress) |
2385 | goto create_cq_error; | 2387 | goto create_cq_error; |
2386 | ret = be_fill_queue(cq, phba->params.icds_per_ctrl / 2, | 2388 | ret = be_fill_queue(cq, phba->params.num_cq_entries, |
2387 | sizeof(struct sol_cqe), cq_vaddress); | 2389 | sizeof(struct sol_cqe), cq_vaddress); |
2388 | if (ret) { | 2390 | if (ret) { |
2389 | shost_printk(KERN_ERR, phba->shost, | 2391 | shost_printk(KERN_ERR, phba->shost, |
@@ -2634,7 +2636,8 @@ beiscsi_create_wrb_rings(struct beiscsi_hba *phba, | |||
2634 | "wrbq create failed."); | 2636 | "wrbq create failed."); |
2635 | return status; | 2637 | return status; |
2636 | } | 2638 | } |
2637 | phwi_ctrlr->wrb_context[i].cid = phwi_context->be_wrbq[i].id; | 2639 | phwi_ctrlr->wrb_context[i * 2].cid = phwi_context->be_wrbq[i]. |
2640 | id; | ||
2638 | } | 2641 | } |
2639 | kfree(pwrb_arr); | 2642 | kfree(pwrb_arr); |
2640 | return 0; | 2643 | return 0; |
@@ -2807,12 +2810,6 @@ static int hwi_init_port(struct beiscsi_hba *phba) | |||
2807 | ring_mode = 1; | 2810 | ring_mode = 1; |
2808 | else | 2811 | else |
2809 | ring_mode = 0; | 2812 | ring_mode = 0; |
2810 | status = mgmt_get_fw_config(ctrl, phba); | ||
2811 | if (status != 0) { | ||
2812 | shost_printk(KERN_ERR, phba->shost, | ||
2813 | "Error getting fw config\n"); | ||
2814 | goto error; | ||
2815 | } | ||
2816 | 2813 | ||
2817 | status = beiscsi_create_cqs(phba, phwi_context); | 2814 | status = beiscsi_create_cqs(phba, phwi_context); |
2818 | if (status != 0) { | 2815 | if (status != 0) { |
@@ -3032,7 +3029,7 @@ static int beiscsi_init_sgl_handle(struct beiscsi_hba *phba) | |||
3032 | AMAP_SET_BITS(struct amap_iscsi_sge, addr_lo, pfrag, 0); | 3029 | AMAP_SET_BITS(struct amap_iscsi_sge, addr_lo, pfrag, 0); |
3033 | pfrag += phba->params.num_sge_per_io; | 3030 | pfrag += phba->params.num_sge_per_io; |
3034 | psgl_handle->sgl_index = | 3031 | psgl_handle->sgl_index = |
3035 | phba->fw_config.iscsi_cid_start + arr_index++; | 3032 | phba->fw_config.iscsi_icd_start + arr_index++; |
3036 | } | 3033 | } |
3037 | idx++; | 3034 | idx++; |
3038 | } | 3035 | } |
@@ -3064,7 +3061,7 @@ static int hba_setup_cid_tbls(struct beiscsi_hba *phba) | |||
3064 | kfree(phba->cid_array); | 3061 | kfree(phba->cid_array); |
3065 | return -ENOMEM; | 3062 | return -ENOMEM; |
3066 | } | 3063 | } |
3067 | new_cid = phba->fw_config.iscsi_icd_start; | 3064 | new_cid = phba->fw_config.iscsi_cid_start; |
3068 | for (i = 0; i < phba->params.cxns_per_ctrl; i++) { | 3065 | for (i = 0; i < phba->params.cxns_per_ctrl; i++) { |
3069 | phba->cid_array[i] = new_cid; | 3066 | phba->cid_array[i] = new_cid; |
3070 | new_cid += 2; | 3067 | new_cid += 2; |
@@ -3219,7 +3216,8 @@ beiscsi_offload_connection(struct beiscsi_conn *beiscsi_conn, | |||
3219 | * We can always use 0 here because it is reserved by libiscsi for | 3216 | * We can always use 0 here because it is reserved by libiscsi for |
3220 | * login/startup related tasks. | 3217 | * login/startup related tasks. |
3221 | */ | 3218 | */ |
3222 | pwrb_handle = alloc_wrb_handle(phba, beiscsi_conn->beiscsi_conn_cid, 0); | 3219 | pwrb_handle = alloc_wrb_handle(phba, (beiscsi_conn->beiscsi_conn_cid - |
3220 | phba->fw_config.iscsi_cid_start), 0); | ||
3223 | pwrb = (struct iscsi_target_context_update_wrb *)pwrb_handle->pwrb; | 3221 | pwrb = (struct iscsi_target_context_update_wrb *)pwrb_handle->pwrb; |
3224 | memset(pwrb, 0, sizeof(*pwrb)); | 3222 | memset(pwrb, 0, sizeof(*pwrb)); |
3225 | AMAP_SET_BITS(struct amap_iscsi_target_context_update_wrb, | 3223 | AMAP_SET_BITS(struct amap_iscsi_target_context_update_wrb, |
@@ -3328,7 +3326,8 @@ static int beiscsi_alloc_pdu(struct iscsi_task *task, uint8_t opcode) | |||
3328 | io_task->bhs_pa.u.a64.address = paddr; | 3326 | io_task->bhs_pa.u.a64.address = paddr; |
3329 | io_task->libiscsi_itt = (itt_t)task->itt; | 3327 | io_task->libiscsi_itt = (itt_t)task->itt; |
3330 | io_task->pwrb_handle = alloc_wrb_handle(phba, | 3328 | io_task->pwrb_handle = alloc_wrb_handle(phba, |
3331 | beiscsi_conn->beiscsi_conn_cid, | 3329 | beiscsi_conn->beiscsi_conn_cid - |
3330 | phba->fw_config.iscsi_cid_start, | ||
3332 | task->itt); | 3331 | task->itt); |
3333 | io_task->conn = beiscsi_conn; | 3332 | io_task->conn = beiscsi_conn; |
3334 | 3333 | ||
@@ -3372,10 +3371,11 @@ static int beiscsi_alloc_pdu(struct iscsi_task *task, uint8_t opcode) | |||
3372 | (io_task->psgl_handle->sgl_index)); | 3371 | (io_task->psgl_handle->sgl_index)); |
3373 | if (ring_mode) { | 3372 | if (ring_mode) { |
3374 | phba->sgl_hndl_array[io_task->psgl_handle->sgl_index - | 3373 | phba->sgl_hndl_array[io_task->psgl_handle->sgl_index - |
3375 | phba->fw_config.iscsi_cid_start] = | 3374 | phba->fw_config.iscsi_icd_start] = |
3376 | io_task->psgl_handle; | 3375 | io_task->psgl_handle; |
3377 | io_task->psgl_handle->task = task; | 3376 | io_task->psgl_handle->task = task; |
3378 | io_task->psgl_handle->cid = beiscsi_conn->beiscsi_conn_cid; | 3377 | io_task->psgl_handle->cid = beiscsi_conn->beiscsi_conn_cid - |
3378 | phba->fw_config.iscsi_cid_start; | ||
3379 | } else | 3379 | } else |
3380 | io_task->pwrb_handle->pio_handle = task; | 3380 | io_task->pwrb_handle->pio_handle = task; |
3381 | 3381 | ||
@@ -3384,7 +3384,9 @@ static int beiscsi_alloc_pdu(struct iscsi_task *task, uint8_t opcode) | |||
3384 | 3384 | ||
3385 | free_hndls: | 3385 | free_hndls: |
3386 | phwi_ctrlr = phba->phwi_ctrlr; | 3386 | phwi_ctrlr = phba->phwi_ctrlr; |
3387 | pwrb_context = &phwi_ctrlr->wrb_context[beiscsi_conn->beiscsi_conn_cid]; | 3387 | pwrb_context = &phwi_ctrlr->wrb_context[ |
3388 | beiscsi_conn->beiscsi_conn_cid - | ||
3389 | phba->fw_config.iscsi_cid_start]; | ||
3388 | free_wrb_handle(phba, pwrb_context, io_task->pwrb_handle); | 3390 | free_wrb_handle(phba, pwrb_context, io_task->pwrb_handle); |
3389 | io_task->pwrb_handle = NULL; | 3391 | io_task->pwrb_handle = NULL; |
3390 | pci_pool_free(beiscsi_sess->bhs_pool, io_task->cmd_bhs, | 3392 | pci_pool_free(beiscsi_sess->bhs_pool, io_task->cmd_bhs, |
@@ -3404,7 +3406,8 @@ static void beiscsi_cleanup_task(struct iscsi_task *task) | |||
3404 | struct hwi_controller *phwi_ctrlr; | 3406 | struct hwi_controller *phwi_ctrlr; |
3405 | 3407 | ||
3406 | phwi_ctrlr = phba->phwi_ctrlr; | 3408 | phwi_ctrlr = phba->phwi_ctrlr; |
3407 | pwrb_context = &phwi_ctrlr->wrb_context[beiscsi_conn->beiscsi_conn_cid]; | 3409 | pwrb_context = &phwi_ctrlr->wrb_context[beiscsi_conn->beiscsi_conn_cid |
3410 | - phba->fw_config.iscsi_cid_start]; | ||
3408 | if (io_task->pwrb_handle) { | 3411 | if (io_task->pwrb_handle) { |
3409 | free_wrb_handle(phba, pwrb_context, io_task->pwrb_handle); | 3412 | free_wrb_handle(phba, pwrb_context, io_task->pwrb_handle); |
3410 | io_task->pwrb_handle = NULL; | 3413 | io_task->pwrb_handle = NULL; |
@@ -3561,7 +3564,8 @@ static int beiscsi_mtask(struct iscsi_task *task) | |||
3561 | session = conn->session; | 3564 | session = conn->session; |
3562 | i = ((struct iscsi_tm *)task->hdr)->rtt; | 3565 | i = ((struct iscsi_tm *)task->hdr)->rtt; |
3563 | phwi_ctrlr = phba->phwi_ctrlr; | 3566 | phwi_ctrlr = phba->phwi_ctrlr; |
3564 | pwrb_context = &phwi_ctrlr->wrb_context[cid]; | 3567 | pwrb_context = &phwi_ctrlr->wrb_context[cid - |
3568 | phba->fw_config.iscsi_cid_start]; | ||
3565 | pwrb_handle = pwrb_context->pwrb_handle_basestd[be32_to_cpu(i) | 3569 | pwrb_handle = pwrb_context->pwrb_handle_basestd[be32_to_cpu(i) |
3566 | >> 16]; | 3570 | >> 16]; |
3567 | aborted_task = pwrb_handle->pio_handle; | 3571 | aborted_task = pwrb_handle->pio_handle; |
@@ -3754,6 +3758,14 @@ static int __devinit beiscsi_dev_probe(struct pci_dev *pcidev, | |||
3754 | spin_lock_init(&phba->io_sgl_lock); | 3758 | spin_lock_init(&phba->io_sgl_lock); |
3755 | spin_lock_init(&phba->mgmt_sgl_lock); | 3759 | spin_lock_init(&phba->mgmt_sgl_lock); |
3756 | spin_lock_init(&phba->isr_lock); | 3760 | spin_lock_init(&phba->isr_lock); |
3761 | ret = mgmt_get_fw_config(&phba->ctrl, phba); | ||
3762 | if (ret != 0) { | ||
3763 | shost_printk(KERN_ERR, phba->shost, | ||
3764 | "Error getting fw config\n"); | ||
3765 | goto free_port; | ||
3766 | } | ||
3767 | phba->shost->max_id = phba->fw_config.iscsi_cid_count; | ||
3768 | phba->shost->can_queue = phba->params.ios_per_ctrl; | ||
3757 | beiscsi_get_params(phba); | 3769 | beiscsi_get_params(phba); |
3758 | ret = beiscsi_init_port(phba); | 3770 | ret = beiscsi_init_port(phba); |
3759 | if (ret < 0) { | 3771 | if (ret < 0) { |
@@ -3859,7 +3871,7 @@ struct iscsi_transport beiscsi_iscsi_transport = { | |||
3859 | ISCSI_USERNAME | ISCSI_PASSWORD | | 3871 | ISCSI_USERNAME | ISCSI_PASSWORD | |
3860 | ISCSI_USERNAME_IN | ISCSI_PASSWORD_IN | | 3872 | ISCSI_USERNAME_IN | ISCSI_PASSWORD_IN | |
3861 | ISCSI_FAST_ABORT | ISCSI_ABORT_TMO | | 3873 | ISCSI_FAST_ABORT | ISCSI_ABORT_TMO | |
3862 | ISCSI_LU_RESET_TMO | ISCSI_TGT_RESET_TMO | | 3874 | ISCSI_LU_RESET_TMO | |
3863 | ISCSI_PING_TMO | ISCSI_RECV_TMO | | 3875 | ISCSI_PING_TMO | ISCSI_RECV_TMO | |
3864 | ISCSI_IFACE_NAME | ISCSI_INITIATOR_NAME, | 3876 | ISCSI_IFACE_NAME | ISCSI_INITIATOR_NAME, |
3865 | .host_param_mask = ISCSI_HOST_HWADDRESS | ISCSI_HOST_IPADDRESS | | 3877 | .host_param_mask = ISCSI_HOST_HWADDRESS | ISCSI_HOST_IPADDRESS | |
diff --git a/drivers/scsi/be2iscsi/be_main.h b/drivers/scsi/be2iscsi/be_main.h index 25e6b208b771..0e2eac627bee 100644 --- a/drivers/scsi/be2iscsi/be_main.h +++ b/drivers/scsi/be2iscsi/be_main.h | |||
@@ -46,23 +46,18 @@ | |||
46 | #define OC_DEVICE_ID3 0x712 | 46 | #define OC_DEVICE_ID3 0x712 |
47 | #define OC_DEVICE_ID4 0x222 | 47 | #define OC_DEVICE_ID4 0x222 |
48 | 48 | ||
49 | #define BE2_MAX_SESSIONS 64 | 49 | #define BE2_IO_DEPTH 1024 |
50 | #define BE2_MAX_SESSIONS 256 | ||
50 | #define BE2_CMDS_PER_CXN 128 | 51 | #define BE2_CMDS_PER_CXN 128 |
51 | #define BE2_LOGOUTS BE2_MAX_SESSIONS | ||
52 | #define BE2_TMFS 16 | 52 | #define BE2_TMFS 16 |
53 | #define BE2_NOPOUT_REQ 16 | 53 | #define BE2_NOPOUT_REQ 16 |
54 | #define BE2_ASYNCPDUS BE2_MAX_SESSIONS | ||
55 | #define BE2_MAX_ICDS 2048 | ||
56 | #define BE2_SGE 32 | 54 | #define BE2_SGE 32 |
57 | #define BE2_DEFPDU_HDR_SZ 64 | 55 | #define BE2_DEFPDU_HDR_SZ 64 |
58 | #define BE2_DEFPDU_DATA_SZ 8192 | 56 | #define BE2_DEFPDU_DATA_SZ 8192 |
59 | #define BE2_IO_DEPTH \ | ||
60 | (BE2_MAX_ICDS / 2 - (BE2_LOGOUTS + BE2_TMFS + BE2_NOPOUT_REQ)) | ||
61 | 57 | ||
62 | #define MAX_CPUS 31 | 58 | #define MAX_CPUS 31 |
63 | #define BEISCSI_SGLIST_ELEMENTS BE2_SGE | 59 | #define BEISCSI_SGLIST_ELEMENTS BE2_SGE |
64 | 60 | ||
65 | #define BEISCSI_MAX_CMNDS 1024 /* Max IO's per Ctrlr sht->can_queue */ | ||
66 | #define BEISCSI_CMD_PER_LUN 128 /* scsi_host->cmd_per_lun */ | 61 | #define BEISCSI_CMD_PER_LUN 128 /* scsi_host->cmd_per_lun */ |
67 | #define BEISCSI_MAX_SECTORS 2048 /* scsi_host->max_sectors */ | 62 | #define BEISCSI_MAX_SECTORS 2048 /* scsi_host->max_sectors */ |
68 | 63 | ||
@@ -802,7 +797,6 @@ struct hwi_controller { | |||
802 | struct be_ring default_pdu_hdr; | 797 | struct be_ring default_pdu_hdr; |
803 | struct be_ring default_pdu_data; | 798 | struct be_ring default_pdu_data; |
804 | struct hwi_context_memory *phwi_ctxt; | 799 | struct hwi_context_memory *phwi_ctxt; |
805 | unsigned short cq_errors[CXN_KILLED_CMND_DATA_NOT_ON_SAME_CONN]; | ||
806 | }; | 800 | }; |
807 | 801 | ||
808 | enum hwh_type_enum { | 802 | enum hwh_type_enum { |
diff --git a/drivers/scsi/be2iscsi/be_mgmt.c b/drivers/scsi/be2iscsi/be_mgmt.c index 79c2bd525a84..df1b327fe17b 100644 --- a/drivers/scsi/be2iscsi/be_mgmt.c +++ b/drivers/scsi/be2iscsi/be_mgmt.c | |||
@@ -48,6 +48,14 @@ unsigned char mgmt_get_fw_config(struct be_ctrl_info *ctrl, | |||
48 | pfw_cfg->ulp[0].sq_base; | 48 | pfw_cfg->ulp[0].sq_base; |
49 | phba->fw_config.iscsi_cid_count = | 49 | phba->fw_config.iscsi_cid_count = |
50 | pfw_cfg->ulp[0].sq_count; | 50 | pfw_cfg->ulp[0].sq_count; |
51 | if (phba->fw_config.iscsi_cid_count > (BE2_MAX_SESSIONS / 2)) { | ||
52 | status = 1; | ||
53 | shost_printk(KERN_WARNING, phba->shost, | ||
54 | "FW reported MAX CXNS as %d \t" | ||
55 | "Max Supported = %d. Failing to load \n", | ||
56 | phba->fw_config.iscsi_cid_count, | ||
57 | BE2_MAX_SESSIONS); | ||
58 | } | ||
51 | } else { | 59 | } else { |
52 | shost_printk(KERN_WARNING, phba->shost, | 60 | shost_printk(KERN_WARNING, phba->shost, |
53 | "Failed in mgmt_get_fw_config \n"); | 61 | "Failed in mgmt_get_fw_config \n"); |
@@ -317,7 +325,8 @@ int mgmt_open_connection(struct beiscsi_hba *phba, | |||
317 | struct tcp_connect_and_offload_out *ptcpcnct_out = | 325 | struct tcp_connect_and_offload_out *ptcpcnct_out = |
318 | embedded_payload(wrb); | 326 | embedded_payload(wrb); |
319 | 327 | ||
320 | ep = phba->ep_array[ptcpcnct_out->cid]; | 328 | ep = phba->ep_array[ptcpcnct_out->cid - |
329 | phba->fw_config.iscsi_cid_start]; | ||
321 | beiscsi_ep = ep->dd_data; | 330 | beiscsi_ep = ep->dd_data; |
322 | beiscsi_ep->fw_handle = ptcpcnct_out->connection_handle; | 331 | beiscsi_ep->fw_handle = ptcpcnct_out->connection_handle; |
323 | beiscsi_ep->cid_vld = 1; | 332 | beiscsi_ep->cid_vld = 1; |