linux-scsi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: michaelc@cs.wisc.edu
To: linux-scsi@vger.kernel.org
Cc: Mike Christie <michaelc@cs.wisc.edu>
Subject: [PATCH 2/3] libiscsi: update nop stats
Date: Thu, 14 Jun 2012 23:15:46 -0500	[thread overview]
Message-ID: <1339733747-14731-3-git-send-email-michaelc@cs.wisc.edu> (raw)
In-Reply-To: <1339733747-14731-1-git-send-email-michaelc@cs.wisc.edu>

From: Mike Christie <michaelc@cs.wisc.edu>

The nop tx/rx counters were not getting updated.

Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
---
 drivers/scsi/libiscsi.c |    7 ++++++-
 include/scsi/libiscsi.h |    2 ++
 2 files changed, 8 insertions(+), 1 deletions(-)

diff --git a/drivers/scsi/libiscsi.c b/drivers/scsi/libiscsi.c
index 5b4adc4..d134b40 100644
--- a/drivers/scsi/libiscsi.c
+++ b/drivers/scsi/libiscsi.c
@@ -978,6 +978,7 @@ static int iscsi_send_nopout(struct iscsi_conn *conn, struct iscsi_nopin *rhdr)
 		conn->ping_task = task;
 		conn->last_ping = jiffies;
 	}
+	conn->noptx_pdus++;
 
 	return 0;
 }
@@ -1146,6 +1147,8 @@ int __iscsi_complete_pdu(struct iscsi_conn *conn, struct iscsi_hdr *hdr,
 
 		switch(opcode) {
 		case ISCSI_OP_NOOP_IN:
+			conn->noprx_pdus++;
+
 			if (datalen) {
 				rc = ISCSI_ERR_PROTO;
 				break;
@@ -1184,11 +1187,13 @@ int __iscsi_complete_pdu(struct iscsi_conn *conn, struct iscsi_hdr *hdr,
 		 * LLD handles R2Ts if they need to.
 		 */
 		return 0;
+	case ISCSI_OP_NOOP_IN:
+		conn->noprx_pdus++;
+		/* fall through */
 	case ISCSI_OP_LOGOUT_RSP:
 	case ISCSI_OP_LOGIN_RSP:
 	case ISCSI_OP_TEXT_RSP:
 	case ISCSI_OP_SCSI_TMFUNC_RSP:
-	case ISCSI_OP_NOOP_IN:
 		task = iscsi_itt_to_task(conn, hdr->itt);
 		if (!task)
 			return ISCSI_ERR_BAD_ITT;
diff --git a/include/scsi/libiscsi.h b/include/scsi/libiscsi.h
index 6e33386..b9ffcc5 100644
--- a/include/scsi/libiscsi.h
+++ b/include/scsi/libiscsi.h
@@ -221,6 +221,8 @@ struct iscsi_conn {
 	uint32_t		scsirsp_pdus_cnt;
 	uint32_t		datain_pdus_cnt;
 	uint32_t		r2t_pdus_cnt;
+	uint32_t		noptx_pdus;
+	uint32_t		noprx_pdus;
 	uint32_t		tmfcmd_pdus_cnt;
 	int32_t			tmfrsp_pdus_cnt;
 
-- 
1.7.7.6


  parent reply	other threads:[~2012-06-15  5:05 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-06-15  4:15 iscsi changes for scsi misc michaelc
2012-06-15  4:15 ` [PATCH 1/3] libiscsi: fix nop xmit failure handling michaelc
2012-06-15  4:15 ` michaelc [this message]
2012-06-15  4:15 ` [PATCH 3/3] iscsi drivers: use libiscsi get stats fn 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=1339733747-14731-3-git-send-email-michaelc@cs.wisc.edu \
    --to=michaelc@cs.wisc.edu \
    --cc=linux-scsi@vger.kernel.org \
    /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).