aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/be2iscsi/be_main.c
diff options
context:
space:
mode:
authorJitendra Bhivare <jitendra.bhivare@broadcom.com>2016-08-19 05:50:22 -0400
committerMartin K. Petersen <martin.petersen@oracle.com>2016-08-23 22:42:44 -0400
commite1f9d31eb3272b4351239ecb7481f541d9eb76be (patch)
treeaf873ce90152059878e38032a153d46864a25a0f /drivers/scsi/be2iscsi/be_main.c
parent938f372c7d3d2a9a732a1ed7c9a0131ab1ab2e5b (diff)
scsi: be2iscsi: Fix bad WRB index error
In very rare scenario, connection gets killed after throwing this error: scsi host0: BM_2312 : Event CXN_KILLED_BAD_WRB_INDEX_ERROR[15]... CID : 4 connection1:0: detected conn error (1011) memset ISCSI_WRB descriptor to zero for all allocations of WRB handle. Signed-off-by: Jitendra Bhivare <jitendra.bhivare@broadcom.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'drivers/scsi/be2iscsi/be_main.c')
-rw-r--r--drivers/scsi/be2iscsi/be_main.c18
1 files changed, 6 insertions, 12 deletions
diff --git a/drivers/scsi/be2iscsi/be_main.c b/drivers/scsi/be2iscsi/be_main.c
index 5024651e3a68..50d865eeb4c3 100644
--- a/drivers/scsi/be2iscsi/be_main.c
+++ b/drivers/scsi/be2iscsi/be_main.c
@@ -967,6 +967,7 @@ beiscsi_get_wrb_handle(struct hwi_wrb_context *pwrb_context,
967 else 967 else
968 pwrb_context->alloc_index++; 968 pwrb_context->alloc_index++;
969 spin_unlock_bh(&pwrb_context->wrb_lock); 969 spin_unlock_bh(&pwrb_context->wrb_lock);
970 memset(pwrb_handle->pwrb, 0, sizeof(*pwrb_handle->pwrb));
970 971
971 return pwrb_handle; 972 return pwrb_handle;
972} 973}
@@ -1209,11 +1210,10 @@ hwi_complete_drvr_msgs(struct beiscsi_conn *beiscsi_conn,
1209 struct beiscsi_hba *phba, struct sol_cqe *psol) 1210 struct beiscsi_hba *phba, struct sol_cqe *psol)
1210{ 1211{
1211 struct hwi_wrb_context *pwrb_context; 1212 struct hwi_wrb_context *pwrb_context;
1212 struct wrb_handle *pwrb_handle = NULL; 1213 uint16_t wrb_index, cid, cri_index;
1213 struct hwi_controller *phwi_ctrlr; 1214 struct hwi_controller *phwi_ctrlr;
1215 struct wrb_handle *pwrb_handle;
1214 struct iscsi_task *task; 1216 struct iscsi_task *task;
1215 struct beiscsi_io_task *io_task;
1216 uint16_t wrb_index, cid, cri_index;
1217 1217
1218 phwi_ctrlr = phba->phwi_ctrlr; 1218 phwi_ctrlr = phba->phwi_ctrlr;
1219 if (is_chip_be2_be3r(phba)) { 1219 if (is_chip_be2_be3r(phba)) {
@@ -1232,9 +1232,6 @@ hwi_complete_drvr_msgs(struct beiscsi_conn *beiscsi_conn,
1232 pwrb_context = &phwi_ctrlr->wrb_context[cri_index]; 1232 pwrb_context = &phwi_ctrlr->wrb_context[cri_index];
1233 pwrb_handle = pwrb_context->pwrb_handle_basestd[wrb_index]; 1233 pwrb_handle = pwrb_context->pwrb_handle_basestd[wrb_index];
1234 task = pwrb_handle->pio_handle; 1234 task = pwrb_handle->pio_handle;
1235
1236 io_task = task->dd_data;
1237 memset(io_task->pwrb_handle->pwrb, 0, sizeof(struct iscsi_wrb));
1238 iscsi_put_task(task); 1235 iscsi_put_task(task);
1239} 1236}
1240 1237
@@ -4295,16 +4292,12 @@ beiscsi_free_mgmt_task_handles(struct beiscsi_conn *beiscsi_conn,
4295 io_task = task->dd_data; 4292 io_task = task->dd_data;
4296 4293
4297 if (io_task->pwrb_handle) { 4294 if (io_task->pwrb_handle) {
4298 memset(io_task->pwrb_handle->pwrb, 0, 4295 free_wrb_handle(phba, pwrb_context, io_task->pwrb_handle);
4299 sizeof(struct iscsi_wrb));
4300 free_wrb_handle(phba, pwrb_context,
4301 io_task->pwrb_handle);
4302 io_task->pwrb_handle = NULL; 4296 io_task->pwrb_handle = NULL;
4303 } 4297 }
4304 4298
4305 if (io_task->psgl_handle) { 4299 if (io_task->psgl_handle) {
4306 free_mgmt_sgl_handle(phba, 4300 free_mgmt_sgl_handle(phba, io_task->psgl_handle);
4307 io_task->psgl_handle);
4308 io_task->psgl_handle = NULL; 4301 io_task->psgl_handle = NULL;
4309 } 4302 }
4310 4303
@@ -4341,6 +4334,7 @@ static void beiscsi_cleanup_task(struct iscsi_task *task)
4341 pci_pool_free(beiscsi_sess->bhs_pool, io_task->cmd_bhs, 4334 pci_pool_free(beiscsi_sess->bhs_pool, io_task->cmd_bhs,
4342 io_task->bhs_pa.u.a64.address); 4335 io_task->bhs_pa.u.a64.address);
4343 io_task->cmd_bhs = NULL; 4336 io_task->cmd_bhs = NULL;
4337 task->hdr = NULL;
4344 } 4338 }
4345 4339
4346 if (task->sc) { 4340 if (task->sc) {