Commit 9728d8d0 authored by Jayamohan Kallickal's avatar Jayamohan Kallickal Committed by James Bottomley

[SCSI] be2iscsi: Check ASYNC PDU Handle corresponds to HDR/DATA Handle

For each ASYNC PDU received there is an HDR and DATA handle for it.
There will be only 1 HDR ASYNC Handle, but DATA Handle can be more
than 1 for each ASYNC PDU received. Checking if the ASYNC Handle
correspongs to HDR or DATA while returning the Handle to the free list.
hwi_free_async_msg just return the handles to the free list. No return
values are needed so changing the return type to void.
Signed-off-by: default avatarJohn Soni Jose <sony.john-n@emulex.com>
Signed-off-by: default avatarJayamohan Kallickal <jayamohan.kallickal@emulex.com>
Signed-off-by: default avatarMike Christie <michaelc@cs.wisc.edu>
Signed-off-by: default avatarJames Bottomley <JBottomley@Parallels.com>
parent 76d15dbd
...@@ -1471,14 +1471,13 @@ hwi_update_async_writables(struct hwi_async_pdu_context *pasync_ctx, ...@@ -1471,14 +1471,13 @@ hwi_update_async_writables(struct hwi_async_pdu_context *pasync_ctx,
return 0; return 0;
} }
static unsigned int hwi_free_async_msg(struct beiscsi_hba *phba, static void hwi_free_async_msg(struct beiscsi_hba *phba,
unsigned int cri) unsigned int cri)
{ {
struct hwi_controller *phwi_ctrlr; struct hwi_controller *phwi_ctrlr;
struct hwi_async_pdu_context *pasync_ctx; struct hwi_async_pdu_context *pasync_ctx;
struct async_pdu_handle *pasync_handle, *tmp_handle; struct async_pdu_handle *pasync_handle, *tmp_handle;
struct list_head *plist; struct list_head *plist;
unsigned int i = 0;
phwi_ctrlr = phba->phwi_ctrlr; phwi_ctrlr = phba->phwi_ctrlr;
pasync_ctx = HWI_GET_ASYNC_PDU_CTX(phwi_ctrlr); pasync_ctx = HWI_GET_ASYNC_PDU_CTX(phwi_ctrlr);
...@@ -1488,23 +1487,20 @@ static unsigned int hwi_free_async_msg(struct beiscsi_hba *phba, ...@@ -1488,23 +1487,20 @@ static unsigned int hwi_free_async_msg(struct beiscsi_hba *phba,
list_for_each_entry_safe(pasync_handle, tmp_handle, plist, link) { list_for_each_entry_safe(pasync_handle, tmp_handle, plist, link) {
list_del(&pasync_handle->link); list_del(&pasync_handle->link);
if (i == 0) { if (pasync_handle->is_header) {
list_add_tail(&pasync_handle->link, list_add_tail(&pasync_handle->link,
&pasync_ctx->async_header.free_list); &pasync_ctx->async_header.free_list);
pasync_ctx->async_header.free_entries++; pasync_ctx->async_header.free_entries++;
i++;
} else { } else {
list_add_tail(&pasync_handle->link, list_add_tail(&pasync_handle->link,
&pasync_ctx->async_data.free_list); &pasync_ctx->async_data.free_list);
pasync_ctx->async_data.free_entries++; pasync_ctx->async_data.free_entries++;
i++;
} }
} }
INIT_LIST_HEAD(&pasync_ctx->async_entry[cri].wait_queue.list); INIT_LIST_HEAD(&pasync_ctx->async_entry[cri].wait_queue.list);
pasync_ctx->async_entry[cri].wait_queue.hdr_received = 0; pasync_ctx->async_entry[cri].wait_queue.hdr_received = 0;
pasync_ctx->async_entry[cri].wait_queue.bytes_received = 0; pasync_ctx->async_entry[cri].wait_queue.bytes_received = 0;
return 0;
} }
static struct phys_addr * static struct phys_addr *
......
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