aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/be2iscsi
diff options
context:
space:
mode:
authorJayamohan Kallickal <jayamohank@gmail.com>2013-04-05 23:38:31 -0400
committerJames Bottomley <JBottomley@Parallels.com>2013-05-02 11:14:07 -0400
commit4a4a11b98a39f479cdccef879635a72b0422049b (patch)
tree6258c5bb957ce940c6f0be9ab9c8eb1e8d6f121b /drivers/scsi/be2iscsi
parent6ea9b3b0337d55c901cea38e2d85103e2268d757 (diff)
[SCSI] be2iscsi : Fix the NOP-In handling code path
When target send a NOP-IN with valid TTT, driver issues a NOP-OUT and the task was not freed from driver. The task list available for the session used to run out, and as no more task list were available no more iSCSI commands were exchanged on that session. This patches fixed the issue, by calling iscsi_put_task. Signed-off-by: Minh Tran <minhduc.tran@emulex.com> Signed-off-by: John Soni Jose <sony.john-n@emulex.com> Signed-off-by: Jayamohan Kallickal <jayamohan.kallickal@emulex.com> Reviewed-by: Mike Christie <michaelc@cs.wisc.edu> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Diffstat (limited to 'drivers/scsi/be2iscsi')
-rw-r--r--drivers/scsi/be2iscsi/be_iscsi.c3
-rw-r--r--drivers/scsi/be2iscsi/be_main.c21
-rw-r--r--drivers/scsi/be2iscsi/be_main.h3
3 files changed, 12 insertions, 15 deletions
diff --git a/drivers/scsi/be2iscsi/be_iscsi.c b/drivers/scsi/be2iscsi/be_iscsi.c
index dd5beff92c61..5b64fd4b3c35 100644
--- a/drivers/scsi/be2iscsi/be_iscsi.c
+++ b/drivers/scsi/be2iscsi/be_iscsi.c
@@ -1005,7 +1005,8 @@ static void beiscsi_free_ep(struct beiscsi_endpoint *beiscsi_ep)
1005 1005
1006 beiscsi_conn = beiscsi_ep->conn; 1006 beiscsi_conn = beiscsi_ep->conn;
1007 if (beiscsi_conn->login_in_progress) { 1007 if (beiscsi_conn->login_in_progress) {
1008 beiscsi_free_mgmt_task_handles(beiscsi_conn); 1008 beiscsi_free_mgmt_task_handles(beiscsi_conn,
1009 beiscsi_conn->task);
1009 beiscsi_conn->login_in_progress = 0; 1010 beiscsi_conn->login_in_progress = 0;
1010 } 1011 }
1011} 1012}
diff --git a/drivers/scsi/be2iscsi/be_main.c b/drivers/scsi/be2iscsi/be_main.c
index ff89b4cc3634..a60a43d4d947 100644
--- a/drivers/scsi/be2iscsi/be_main.c
+++ b/drivers/scsi/be2iscsi/be_main.c
@@ -1367,8 +1367,6 @@ hwi_complete_drvr_msgs(struct beiscsi_conn *beiscsi_conn,
1367 struct hwi_controller *phwi_ctrlr; 1367 struct hwi_controller *phwi_ctrlr;
1368 struct iscsi_task *task; 1368 struct iscsi_task *task;
1369 struct beiscsi_io_task *io_task; 1369 struct beiscsi_io_task *io_task;
1370 struct iscsi_conn *conn = beiscsi_conn->conn;
1371 struct iscsi_session *session = conn->session;
1372 uint16_t wrb_index, cid; 1370 uint16_t wrb_index, cid;
1373 1371
1374 phwi_ctrlr = phba->phwi_ctrlr; 1372 phwi_ctrlr = phba->phwi_ctrlr;
@@ -1390,12 +1388,8 @@ hwi_complete_drvr_msgs(struct beiscsi_conn *beiscsi_conn,
1390 task = pwrb_handle->pio_handle; 1388 task = pwrb_handle->pio_handle;
1391 1389
1392 io_task = task->dd_data; 1390 io_task = task->dd_data;
1393 spin_lock_bh(&phba->mgmt_sgl_lock); 1391 memset(io_task->pwrb_handle->pwrb, 0, sizeof(struct iscsi_wrb));
1394 free_mgmt_sgl_handle(phba, io_task->psgl_handle); 1392 iscsi_put_task(task);
1395 spin_unlock_bh(&phba->mgmt_sgl_lock);
1396 spin_lock_bh(&session->lock);
1397 free_wrb_handle(phba, pwrb_context, pwrb_handle);
1398 spin_unlock_bh(&session->lock);
1399} 1393}
1400 1394
1401static void 1395static void
@@ -4073,11 +4067,13 @@ static void beiscsi_clean_port(struct beiscsi_hba *phba)
4073/** 4067/**
4074 * beiscsi_free_mgmt_task_handles()- Free driver CXN resources 4068 * beiscsi_free_mgmt_task_handles()- Free driver CXN resources
4075 * @beiscsi_conn: ptr to the conn to be cleaned up 4069 * @beiscsi_conn: ptr to the conn to be cleaned up
4070 * @task: ptr to iscsi_task resource to be freed.
4076 * 4071 *
4077 * Free driver mgmt resources binded to CXN. 4072 * Free driver mgmt resources binded to CXN.
4078 **/ 4073 **/
4079void 4074void
4080beiscsi_free_mgmt_task_handles(struct beiscsi_conn *beiscsi_conn) 4075beiscsi_free_mgmt_task_handles(struct beiscsi_conn *beiscsi_conn,
4076 struct iscsi_task *task)
4081{ 4077{
4082 struct beiscsi_io_task *io_task; 4078 struct beiscsi_io_task *io_task;
4083 struct beiscsi_hba *phba = beiscsi_conn->phba; 4079 struct beiscsi_hba *phba = beiscsi_conn->phba;
@@ -4088,7 +4084,7 @@ beiscsi_free_mgmt_task_handles(struct beiscsi_conn *beiscsi_conn)
4088 pwrb_context = &phwi_ctrlr->wrb_context 4084 pwrb_context = &phwi_ctrlr->wrb_context
4089 [beiscsi_conn->beiscsi_conn_cid 4085 [beiscsi_conn->beiscsi_conn_cid
4090 - phba->fw_config.iscsi_cid_start]; 4086 - phba->fw_config.iscsi_cid_start];
4091 io_task = beiscsi_conn->task->dd_data; 4087 io_task = task->dd_data;
4092 4088
4093 if (io_task->pwrb_handle) { 4089 if (io_task->pwrb_handle) {
4094 memset(io_task->pwrb_handle->pwrb, 0, 4090 memset(io_task->pwrb_handle->pwrb, 0,
@@ -4102,8 +4098,8 @@ beiscsi_free_mgmt_task_handles(struct beiscsi_conn *beiscsi_conn)
4102 spin_lock_bh(&phba->mgmt_sgl_lock); 4098 spin_lock_bh(&phba->mgmt_sgl_lock);
4103 free_mgmt_sgl_handle(phba, 4099 free_mgmt_sgl_handle(phba,
4104 io_task->psgl_handle); 4100 io_task->psgl_handle);
4105 spin_unlock_bh(&phba->mgmt_sgl_lock);
4106 io_task->psgl_handle = NULL; 4101 io_task->psgl_handle = NULL;
4102 spin_unlock_bh(&phba->mgmt_sgl_lock);
4107 } 4103 }
4108 4104
4109 if (io_task->mtask_addr) 4105 if (io_task->mtask_addr)
@@ -4153,7 +4149,7 @@ static void beiscsi_cleanup_task(struct iscsi_task *task)
4153 } 4149 }
4154 } else { 4150 } else {
4155 if (!beiscsi_conn->login_in_progress) 4151 if (!beiscsi_conn->login_in_progress)
4156 beiscsi_free_mgmt_task_handles(beiscsi_conn); 4152 beiscsi_free_mgmt_task_handles(beiscsi_conn, task);
4157 } 4153 }
4158} 4154}
4159 4155
@@ -4381,7 +4377,6 @@ int beiscsi_iotask_v2(struct iscsi_task *task, struct scatterlist *sg,
4381 unsigned int doorbell = 0; 4377 unsigned int doorbell = 0;
4382 4378
4383 pwrb = io_task->pwrb_handle->pwrb; 4379 pwrb = io_task->pwrb_handle->pwrb;
4384 memset(pwrb, 0, sizeof(*pwrb));
4385 4380
4386 io_task->cmd_bhs->iscsi_hdr.exp_statsn = 0; 4381 io_task->cmd_bhs->iscsi_hdr.exp_statsn = 0;
4387 io_task->bhs_len = sizeof(struct be_cmd_bhs); 4382 io_task->bhs_len = sizeof(struct be_cmd_bhs);
diff --git a/drivers/scsi/be2iscsi/be_main.h b/drivers/scsi/be2iscsi/be_main.h
index 3c5df9219b03..ac4ef34d80b1 100644
--- a/drivers/scsi/be2iscsi/be_main.h
+++ b/drivers/scsi/be2iscsi/be_main.h
@@ -753,7 +753,8 @@ void
753free_mgmt_sgl_handle(struct beiscsi_hba *phba, struct sgl_handle *psgl_handle); 753free_mgmt_sgl_handle(struct beiscsi_hba *phba, struct sgl_handle *psgl_handle);
754 754
755void beiscsi_process_all_cqs(struct work_struct *work); 755void beiscsi_process_all_cqs(struct work_struct *work);
756void beiscsi_free_mgmt_task_handles(struct beiscsi_conn *beiscsi_conn); 756void beiscsi_free_mgmt_task_handles(struct beiscsi_conn *beiscsi_conn,
757 struct iscsi_task *task);
757 758
758static inline bool beiscsi_error(struct beiscsi_hba *phba) 759static inline bool beiscsi_error(struct beiscsi_hba *phba)
759{ 760{