linux-scsi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: michaelc@cs.wisc.edu
To: linux-scsi@vger.kernel.org
Cc: Jayamohan Kallickal <jayamohan.kallickal@emulex.com>,
	John Soni Jose <sony.john-n@emulex.com>,
	Mike Christie <michaelc@cs.wisc.edu>
Subject: [PATCH 12/17] be2iscsi: Check ASYNC PDU Handle corresponds to HDR/DATA Handle
Date: Tue,  3 Apr 2012 23:41:47 -0500	[thread overview]
Message-ID: <1333514512-21799-13-git-send-email-michaelc@cs.wisc.edu> (raw)
In-Reply-To: <1333514512-21799-1-git-send-email-michaelc@cs.wisc.edu>

From: Jayamohan Kallickal <jayamohan.kallickal@emulex.com>

 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: John Soni Jose <sony.john-n@emulex.com>
Signed-off-by: Jayamohan Kallickal <jayamohan.kallickal@emulex.com>
Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
---
 drivers/scsi/be2iscsi/be_main.c |    8 ++------
 1 files changed, 2 insertions(+), 6 deletions(-)

diff --git a/drivers/scsi/be2iscsi/be_main.c b/drivers/scsi/be2iscsi/be_main.c
index 595dea5..9b5fbff 100644
--- a/drivers/scsi/be2iscsi/be_main.c
+++ b/drivers/scsi/be2iscsi/be_main.c
@@ -1471,14 +1471,13 @@ hwi_update_async_writables(struct hwi_async_pdu_context *pasync_ctx,
 	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)
 {
 	struct hwi_controller *phwi_ctrlr;
 	struct hwi_async_pdu_context *pasync_ctx;
 	struct async_pdu_handle *pasync_handle, *tmp_handle;
 	struct list_head *plist;
-	unsigned int i = 0;
 
 	phwi_ctrlr = phba->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,
 	list_for_each_entry_safe(pasync_handle, tmp_handle, plist, link) {
 		list_del(&pasync_handle->link);
 
-		if (i == 0) {
+		if (pasync_handle->is_header) {
 			list_add_tail(&pasync_handle->link,
 				      &pasync_ctx->async_header.free_list);
 			pasync_ctx->async_header.free_entries++;
-			i++;
 		} else {
 			list_add_tail(&pasync_handle->link,
 				      &pasync_ctx->async_data.free_list);
 			pasync_ctx->async_data.free_entries++;
-			i++;
 		}
 	}
 
 	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.bytes_received = 0;
-	return 0;
 }
 
 static struct phys_addr *
-- 
1.7.7.6


  parent reply	other threads:[~2012-04-04  4:42 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-04  4:41 be2iscsi update v2 michaelc
2012-04-04  4:41 ` [PATCH 01/17] be2iscsi: Fix in the Asynchronous Code Path michaelc
2012-04-04  4:41 ` [PATCH 02/17] be2iscsi: Fix in ASYNC PDU stitching logic michaelc
2012-04-04  4:41 ` [PATCH 03/17] be2iscsi: WRB Initialization and Failure code path change michaelc
2012-04-04  4:41 ` [PATCH 04/17] be2iscsi:Freeing of WRB and SGL Handle in cleanup task michaelc
2012-04-18  8:06   ` Mike Christie
2012-04-04  4:41 ` [PATCH 05/17] be2iscsi:Fix typo function name mismatch michaelc
2012-04-04  4:41 ` [PATCH 06/17] be2iscsi:Set num_cpu = 1 if pci_enable_msix fails michaelc
2012-04-04  4:41 ` [PATCH 07/17] be2iscsi:Fix double free of MCCQ info memory michaelc
2012-04-25  8:13   ` James Bottomley
2012-04-25 19:27     ` Jayamohan.Kallickal
2012-04-04  4:41 ` [PATCH 08/17] be2iscsi:Code cleanup, removing the goto statement michaelc
2012-04-04  4:41 ` [PATCH 09/17] be2iscsi:Fix the function return values michaelc
2012-04-04  4:41 ` [PATCH 10/17] be2iscsi: Update in Copyright information michaelc
2012-04-25  8:23   ` James Bottomley
2012-04-25 16:49     ` Jayamohan.Kallickal
2012-04-04  4:41 ` [PATCH 11/17] be2iscsi:Bump the driver Version michaelc
2012-04-04  4:41 ` michaelc [this message]
2012-04-04  4:41 ` [PATCH 13/17] be2iscsi: Return async handle of unknown opcode to free list michaelc
2012-04-04  4:41 ` [PATCH 14/17] be2iscsi: Get Initiator Name for the iSCSI_Host michaelc
2012-04-04  4:41 ` [PATCH 15/17] be2iscsi: Adding bsg interface for be2iscsi michaelc
2012-04-04  4:41 ` [PATCH 16/17] be2iscsi: adding functionality to change network settings using iscsiadm michaelc
2012-04-04  4:41 ` [PATCH 17/17] be2iscsi: Get Port State and Speed of the Adapter michaelc
  -- strict thread matches above, loose matches on Subject: below --
2012-03-21  1:47 be2iscsi update michaelc
2012-03-21  1:48 ` [PATCH 12/17] be2iscsi: Check ASYNC PDU Handle corresponds to HDR/DATA Handle michaelc

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1333514512-21799-13-git-send-email-michaelc@cs.wisc.edu \
    --to=michaelc@cs.wisc.edu \
    --cc=jayamohan.kallickal@emulex.com \
    --cc=linux-scsi@vger.kernel.org \
    --cc=sony.john-n@emulex.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).