Commit 4a4a11b98a39f479cdccef879635a72b0422049b

Authored by Jayamohan Kallickal
Committed by James Bottomley
1 parent 6ea9b3b033

[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>

Showing 3 changed files with 12 additions and 15 deletions Side-by-side Diff

drivers/scsi/be2iscsi/be_iscsi.c
... ... @@ -1005,7 +1005,8 @@
1005 1005  
1006 1006 beiscsi_conn = beiscsi_ep->conn;
1007 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 1010 beiscsi_conn->login_in_progress = 0;
1010 1011 }
1011 1012 }
drivers/scsi/be2iscsi/be_main.c
... ... @@ -1367,8 +1367,6 @@
1367 1367 struct hwi_controller *phwi_ctrlr;
1368 1368 struct iscsi_task *task;
1369 1369 struct beiscsi_io_task *io_task;
1370   - struct iscsi_conn *conn = beiscsi_conn->conn;
1371   - struct iscsi_session *session = conn->session;
1372 1370 uint16_t wrb_index, cid;
1373 1371  
1374 1372 phwi_ctrlr = phba->phwi_ctrlr;
... ... @@ -1390,12 +1388,8 @@
1390 1388 task = pwrb_handle->pio_handle;
1391 1389  
1392 1390 io_task = task->dd_data;
1393   - spin_lock_bh(&phba->mgmt_sgl_lock);
1394   - free_mgmt_sgl_handle(phba, io_task->psgl_handle);
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);
  1391 + memset(io_task->pwrb_handle->pwrb, 0, sizeof(struct iscsi_wrb));
  1392 + iscsi_put_task(task);
1399 1393 }
1400 1394  
1401 1395 static void
1402 1396  
... ... @@ -4073,11 +4067,13 @@
4073 4067 /**
4074 4068 * beiscsi_free_mgmt_task_handles()- Free driver CXN resources
4075 4069 * @beiscsi_conn: ptr to the conn to be cleaned up
  4070 + * @task: ptr to iscsi_task resource to be freed.
4076 4071 *
4077 4072 * Free driver mgmt resources binded to CXN.
4078 4073 **/
4079 4074 void
4080   -beiscsi_free_mgmt_task_handles(struct beiscsi_conn *beiscsi_conn)
  4075 +beiscsi_free_mgmt_task_handles(struct beiscsi_conn *beiscsi_conn,
  4076 + struct iscsi_task *task)
4081 4077 {
4082 4078 struct beiscsi_io_task *io_task;
4083 4079 struct beiscsi_hba *phba = beiscsi_conn->phba;
... ... @@ -4088,7 +4084,7 @@
4088 4084 pwrb_context = &phwi_ctrlr->wrb_context
4089 4085 [beiscsi_conn->beiscsi_conn_cid
4090 4086 - phba->fw_config.iscsi_cid_start];
4091   - io_task = beiscsi_conn->task->dd_data;
  4087 + io_task = task->dd_data;
4092 4088  
4093 4089 if (io_task->pwrb_handle) {
4094 4090 memset(io_task->pwrb_handle->pwrb, 0,
4095 4091  
... ... @@ -4102,8 +4098,8 @@
4102 4098 spin_lock_bh(&phba->mgmt_sgl_lock);
4103 4099 free_mgmt_sgl_handle(phba,
4104 4100 io_task->psgl_handle);
4105   - spin_unlock_bh(&phba->mgmt_sgl_lock);
4106 4101 io_task->psgl_handle = NULL;
  4102 + spin_unlock_bh(&phba->mgmt_sgl_lock);
4107 4103 }
4108 4104  
4109 4105 if (io_task->mtask_addr)
... ... @@ -4153,7 +4149,7 @@
4153 4149 }
4154 4150 } else {
4155 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 @@
4381 4377 unsigned int doorbell = 0;
4382 4378  
4383 4379 pwrb = io_task->pwrb_handle->pwrb;
4384   - memset(pwrb, 0, sizeof(*pwrb));
4385 4380  
4386 4381 io_task->cmd_bhs->iscsi_hdr.exp_statsn = 0;
4387 4382 io_task->bhs_len = sizeof(struct be_cmd_bhs);
drivers/scsi/be2iscsi/be_main.h
... ... @@ -753,7 +753,8 @@
753 753 free_mgmt_sgl_handle(struct beiscsi_hba *phba, struct sgl_handle *psgl_handle);
754 754  
755 755 void beiscsi_process_all_cqs(struct work_struct *work);
756   -void beiscsi_free_mgmt_task_handles(struct beiscsi_conn *beiscsi_conn);
  756 +void beiscsi_free_mgmt_task_handles(struct beiscsi_conn *beiscsi_conn,
  757 + struct iscsi_task *task);
757 758  
758 759 static inline bool beiscsi_error(struct beiscsi_hba *phba)
759 760 {