linux-scsi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jayamohan Kallickal <jayamohank@gmail.com>
To: jbottomley@parallels.com, linux-scsi@vger.kernel.org,
	michaelc@cs.wisc.edu
Cc: Jayamohan Kallickal <jayamohan.kallickal@emulex.com>,
	John Soni Jose <sony.john-n@emulex.com>
Subject: [PATCH V2 17/18] be2iscsi: Fix issue in passing the exp_cmdsn and  max_cmdsn
Date: Fri,  5 Apr 2013 20:38:37 -0700	[thread overview]
Message-ID: <1365219519-3457-17-git-send-email-jayamohan.kallickal@emulex.com> (raw)
In-Reply-To: <1365219519-3457-1-git-send-email-jayamohan.kallickal@emulex.com>

 Command Window value from the CQE was used to calculate the
 max_cmdsn for that session.The command window value extracted
 for SKH-R adapter was not proper. The value was extracted from
 BE adapter completion event. Fixed the issue by getting the
 cmd_wnd value from SKH-R CQE.

 The exp_cmdsn and max_cmdsn values were not converted to BE format
 before calling the __iscsi_complete_pdu(). Fixed the issue of converting
 to BE format.

Signed-off-by: John Soni Jose <sony.john-n@emulex.com>
Signed-off-by: Jayamohan Kallickal <jayamohan.kallickal@emulex.com>
---
 drivers/scsi/be2iscsi/be_main.c |   17 +++++++++--------
 1 file changed, 9 insertions(+), 8 deletions(-)

diff --git a/drivers/scsi/be2iscsi/be_main.c b/drivers/scsi/be2iscsi/be_main.c
index 39ac051..77c6fe4 100644
--- a/drivers/scsi/be2iscsi/be_main.c
+++ b/drivers/scsi/be2iscsi/be_main.c
@@ -1326,8 +1326,9 @@ be_complete_logout(struct beiscsi_conn *beiscsi_conn,
 	hdr->t2retain = 0;
 	hdr->flags = csol_cqe->i_flags;
 	hdr->response = csol_cqe->i_resp;
-	hdr->exp_cmdsn = csol_cqe->exp_cmdsn;
-	hdr->max_cmdsn = (csol_cqe->exp_cmdsn + csol_cqe->cmd_wnd - 1);
+	hdr->exp_cmdsn = cpu_to_be32(csol_cqe->exp_cmdsn);
+	hdr->max_cmdsn = cpu_to_be32(csol_cqe->exp_cmdsn +
+				     csol_cqe->cmd_wnd - 1);
 
 	hdr->dlength[0] = 0;
 	hdr->dlength[1] = 0;
@@ -1350,9 +1351,9 @@ be_complete_tmf(struct beiscsi_conn *beiscsi_conn,
 	hdr->opcode = ISCSI_OP_SCSI_TMFUNC_RSP;
 	hdr->flags = csol_cqe->i_flags;
 	hdr->response = csol_cqe->i_resp;
-	hdr->exp_cmdsn = csol_cqe->exp_cmdsn;
-	hdr->max_cmdsn = (csol_cqe->exp_cmdsn +
-			  csol_cqe->cmd_wnd - 1);
+	hdr->exp_cmdsn = cpu_to_be32(csol_cqe->exp_cmdsn);
+	hdr->max_cmdsn = cpu_to_be32(csol_cqe->exp_cmdsn +
+				     csol_cqe->cmd_wnd - 1);
 
 	hdr->itt = io_task->libiscsi_itt;
 	__iscsi_complete_pdu(conn, (struct iscsi_hdr *)hdr, NULL, 0);
@@ -1404,8 +1405,8 @@ be_complete_nopin_resp(struct beiscsi_conn *beiscsi_conn,
 	hdr = (struct iscsi_nopin *)task->hdr;
 	hdr->flags = csol_cqe->i_flags;
 	hdr->exp_cmdsn = cpu_to_be32(csol_cqe->exp_cmdsn);
-	hdr->max_cmdsn = be32_to_cpu(hdr->exp_cmdsn +
-			 csol_cqe->cmd_wnd - 1);
+	hdr->max_cmdsn = cpu_to_be32(csol_cqe->exp_cmdsn +
+				     csol_cqe->cmd_wnd - 1);
 
 	hdr->opcode = ISCSI_OP_NOOP_IN;
 	hdr->itt = io_task->libiscsi_itt;
@@ -1446,7 +1447,7 @@ static void adapter_get_sol_cqe(struct beiscsi_hba *phba,
 					      cid, psol);
 		csol_cqe->hw_sts = AMAP_GET_BITS(struct amap_sol_cqe_v2,
 						 hw_sts, psol);
-		csol_cqe->cmd_wnd = AMAP_GET_BITS(struct amap_sol_cqe,
+		csol_cqe->cmd_wnd = AMAP_GET_BITS(struct amap_sol_cqe_v2,
 						  i_cmd_wnd, psol);
 		if (AMAP_GET_BITS(struct amap_sol_cqe_v2,
 				  cmd_cmpl, psol))
-- 
1.7.10.4


  parent reply	other threads:[~2013-04-06  3:39 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-06  3:38 [PATCH V2 01/18] be2iscsi: Fix lack of uninitialize pattern to FW Jayamohan Kallickal
2013-04-06  3:38 ` [PATCH V2 02/18] be2iscsi: Fix returning Failure when MBX fails with Insufficient buffer error Jayamohan Kallickal
2013-04-06  3:38 ` [PATCH V2 03/18] be2iscsi: Fix MBX Command issues Jayamohan Kallickal
2013-04-06  3:38 ` [PATCH V2 04/18] be2iscsi: Fix MSIX support in SKH-R to 32 Jayamohan Kallickal
2013-04-06  3:38 ` [PATCH V2 05/18] be2iscsi: Fix freeing CXN specific driver resources Jayamohan Kallickal
2013-04-06  3:38 ` [PATCH V2 06/18] be2iscsi: Fix MACRO for checking the adapter type Jayamohan Kallickal
2013-04-06  3:38 ` [PATCH V2 07/18] be2iscsi: Fix support for DEFQ extension Jayamohan Kallickal
2013-04-06  3:38 ` [PATCH V2 08/18] be2iscsi: Fix displaying the FW Version from driver Jayamohan Kallickal
2013-04-06  3:38 ` [PATCH V2 09/18] be2iscsi: Fix displaying the Active Session Count " Jayamohan Kallickal
2013-04-06  3:38 ` [PATCH V2 10/18] be2iscsi: Fix the Port Link Status issue Jayamohan Kallickal
2013-04-06  3:38 ` [PATCH V2 11/18] be2iscsi : Fix the NOP-In handling code path Jayamohan Kallickal
2013-04-06  3:38 ` [PATCH V2 12/18] be2iscsi: Fix dynamic CID allocation Mechanism in driver Jayamohan Kallickal
2013-04-06  3:38 ` [PATCH V2 13/18] be2iscsi: Fix checking Adapter state while establishing CXN Jayamohan Kallickal
2013-04-06  3:38 ` [PATCH V2 14/18] be2scsi: Fix the copyright information Jayamohan Kallickal
2013-04-06  3:38 ` [PATCH V2 15/18] be2iscsi: Fix the session cleanup when reboot/shutdown happens Jayamohan Kallickal
2013-04-10 23:41   ` Mike Christie
2013-04-12 20:08     ` Kallickal, Jayamohan
2013-04-06  3:38 ` [PATCH V2 16/18] be2iscsi: Fix possible reentrancy issue in be_iopoll Jayamohan Kallickal
2013-05-02 15:20   ` James Bottomley
2013-04-06  3:38 ` Jayamohan Kallickal [this message]
2013-04-06  3:38 ` [PATCH V2 18/18] be2iscsi: Bump the driver version Jayamohan Kallickal
2013-04-06  3:38 ` be2iscsi: Patchset for be2iscsi Jayamohan Kallickal
2013-04-12 21:08   ` Mike Christie

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=1365219519-3457-17-git-send-email-jayamohan.kallickal@emulex.com \
    --to=jayamohank@gmail.com \
    --cc=jayamohan.kallickal@emulex.com \
    --cc=jbottomley@parallels.com \
    --cc=linux-scsi@vger.kernel.org \
    --cc=michaelc@cs.wisc.edu \
    --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).