Commit 4a4a11b9 authored by Jayamohan Kallickal's avatar Jayamohan Kallickal Committed by James Bottomley

[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: default avatarMinh Tran <minhduc.tran@emulex.com>
Signed-off-by: default avatarJohn Soni Jose <sony.john-n@emulex.com>
Signed-off-by: default avatarJayamohan Kallickal <jayamohan.kallickal@emulex.com>
Reviewed-by: default avatarMike Christie <michaelc@cs.wisc.edu>
Signed-off-by: default avatarJames Bottomley <JBottomley@Parallels.com>
parent 6ea9b3b0
...@@ -1005,7 +1005,8 @@ static void beiscsi_free_ep(struct beiscsi_endpoint *beiscsi_ep) ...@@ -1005,7 +1005,8 @@ static void beiscsi_free_ep(struct beiscsi_endpoint *beiscsi_ep)
beiscsi_conn = beiscsi_ep->conn; beiscsi_conn = beiscsi_ep->conn;
if (beiscsi_conn->login_in_progress) { if (beiscsi_conn->login_in_progress) {
beiscsi_free_mgmt_task_handles(beiscsi_conn); beiscsi_free_mgmt_task_handles(beiscsi_conn,
beiscsi_conn->task);
beiscsi_conn->login_in_progress = 0; beiscsi_conn->login_in_progress = 0;
} }
} }
......
...@@ -1367,8 +1367,6 @@ hwi_complete_drvr_msgs(struct beiscsi_conn *beiscsi_conn, ...@@ -1367,8 +1367,6 @@ hwi_complete_drvr_msgs(struct beiscsi_conn *beiscsi_conn,
struct hwi_controller *phwi_ctrlr; struct hwi_controller *phwi_ctrlr;
struct iscsi_task *task; struct iscsi_task *task;
struct beiscsi_io_task *io_task; struct beiscsi_io_task *io_task;
struct iscsi_conn *conn = beiscsi_conn->conn;
struct iscsi_session *session = conn->session;
uint16_t wrb_index, cid; uint16_t wrb_index, cid;
phwi_ctrlr = phba->phwi_ctrlr; phwi_ctrlr = phba->phwi_ctrlr;
...@@ -1390,12 +1388,8 @@ hwi_complete_drvr_msgs(struct beiscsi_conn *beiscsi_conn, ...@@ -1390,12 +1388,8 @@ hwi_complete_drvr_msgs(struct beiscsi_conn *beiscsi_conn,
task = pwrb_handle->pio_handle; task = pwrb_handle->pio_handle;
io_task = task->dd_data; io_task = task->dd_data;
spin_lock_bh(&phba->mgmt_sgl_lock); memset(io_task->pwrb_handle->pwrb, 0, sizeof(struct iscsi_wrb));
free_mgmt_sgl_handle(phba, io_task->psgl_handle); iscsi_put_task(task);
spin_unlock_bh(&phba->mgmt_sgl_lock);
spin_lock_bh(&session->lock);
free_wrb_handle(phba, pwrb_context, pwrb_handle);
spin_unlock_bh(&session->lock);
} }
static void static void
...@@ -4073,11 +4067,13 @@ static void beiscsi_clean_port(struct beiscsi_hba *phba) ...@@ -4073,11 +4067,13 @@ static void beiscsi_clean_port(struct beiscsi_hba *phba)
/** /**
* beiscsi_free_mgmt_task_handles()- Free driver CXN resources * beiscsi_free_mgmt_task_handles()- Free driver CXN resources
* @beiscsi_conn: ptr to the conn to be cleaned up * @beiscsi_conn: ptr to the conn to be cleaned up
* @task: ptr to iscsi_task resource to be freed.
* *
* Free driver mgmt resources binded to CXN. * Free driver mgmt resources binded to CXN.
**/ **/
void void
beiscsi_free_mgmt_task_handles(struct beiscsi_conn *beiscsi_conn) beiscsi_free_mgmt_task_handles(struct beiscsi_conn *beiscsi_conn,
struct iscsi_task *task)
{ {
struct beiscsi_io_task *io_task; struct beiscsi_io_task *io_task;
struct beiscsi_hba *phba = beiscsi_conn->phba; struct beiscsi_hba *phba = beiscsi_conn->phba;
...@@ -4088,7 +4084,7 @@ beiscsi_free_mgmt_task_handles(struct beiscsi_conn *beiscsi_conn) ...@@ -4088,7 +4084,7 @@ beiscsi_free_mgmt_task_handles(struct beiscsi_conn *beiscsi_conn)
pwrb_context = &phwi_ctrlr->wrb_context pwrb_context = &phwi_ctrlr->wrb_context
[beiscsi_conn->beiscsi_conn_cid [beiscsi_conn->beiscsi_conn_cid
- phba->fw_config.iscsi_cid_start]; - phba->fw_config.iscsi_cid_start];
io_task = beiscsi_conn->task->dd_data; io_task = task->dd_data;
if (io_task->pwrb_handle) { if (io_task->pwrb_handle) {
memset(io_task->pwrb_handle->pwrb, 0, memset(io_task->pwrb_handle->pwrb, 0,
...@@ -4102,8 +4098,8 @@ beiscsi_free_mgmt_task_handles(struct beiscsi_conn *beiscsi_conn) ...@@ -4102,8 +4098,8 @@ beiscsi_free_mgmt_task_handles(struct beiscsi_conn *beiscsi_conn)
spin_lock_bh(&phba->mgmt_sgl_lock); spin_lock_bh(&phba->mgmt_sgl_lock);
free_mgmt_sgl_handle(phba, free_mgmt_sgl_handle(phba,
io_task->psgl_handle); io_task->psgl_handle);
spin_unlock_bh(&phba->mgmt_sgl_lock);
io_task->psgl_handle = NULL; io_task->psgl_handle = NULL;
spin_unlock_bh(&phba->mgmt_sgl_lock);
} }
if (io_task->mtask_addr) if (io_task->mtask_addr)
...@@ -4153,7 +4149,7 @@ static void beiscsi_cleanup_task(struct iscsi_task *task) ...@@ -4153,7 +4149,7 @@ static void beiscsi_cleanup_task(struct iscsi_task *task)
} }
} else { } else {
if (!beiscsi_conn->login_in_progress) if (!beiscsi_conn->login_in_progress)
beiscsi_free_mgmt_task_handles(beiscsi_conn); beiscsi_free_mgmt_task_handles(beiscsi_conn, task);
} }
} }
...@@ -4381,7 +4377,6 @@ int beiscsi_iotask_v2(struct iscsi_task *task, struct scatterlist *sg, ...@@ -4381,7 +4377,6 @@ int beiscsi_iotask_v2(struct iscsi_task *task, struct scatterlist *sg,
unsigned int doorbell = 0; unsigned int doorbell = 0;
pwrb = io_task->pwrb_handle->pwrb; pwrb = io_task->pwrb_handle->pwrb;
memset(pwrb, 0, sizeof(*pwrb));
io_task->cmd_bhs->iscsi_hdr.exp_statsn = 0; io_task->cmd_bhs->iscsi_hdr.exp_statsn = 0;
io_task->bhs_len = sizeof(struct be_cmd_bhs); io_task->bhs_len = sizeof(struct be_cmd_bhs);
......
...@@ -753,7 +753,8 @@ void ...@@ -753,7 +753,8 @@ void
free_mgmt_sgl_handle(struct beiscsi_hba *phba, struct sgl_handle *psgl_handle); free_mgmt_sgl_handle(struct beiscsi_hba *phba, struct sgl_handle *psgl_handle);
void beiscsi_process_all_cqs(struct work_struct *work); void beiscsi_process_all_cqs(struct work_struct *work);
void beiscsi_free_mgmt_task_handles(struct beiscsi_conn *beiscsi_conn); void beiscsi_free_mgmt_task_handles(struct beiscsi_conn *beiscsi_conn,
struct iscsi_task *task);
static inline bool beiscsi_error(struct beiscsi_hba *phba) static inline bool beiscsi_error(struct beiscsi_hba *phba)
{ {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment