All of lore.kernel.org
 help / color / mirror / Atom feed
From: Christof Schmitt <christof.schmitt@de.ibm.com>
To: James Bottomley <James.Bottomley@HansenPartnership.com>
Cc: linux-scsi@vger.kernel.org, linux-s390@vger.kernel.org,
	schwidefsky@de.ibm.com, heiko.carstens@de.ibm.com,
	Swen Schillig <swen@vnet.ibm.com>,
	Christof Schmitt <christof.schmitt@de.ibm.com>
Subject: [patch 08/13] zfcp: put threshold data in hba trace
Date: Wed, 01 Oct 2008 12:42:21 +0200	[thread overview]
Message-ID: <20081001104802.157568000@de.ibm.com> (raw)
In-Reply-To: 20081001104213.585200000@de.ibm.com

[-- Attachment #1: bit_error_threshold.diff --]
[-- Type: text/plain, Size: 4960 bytes --]

From: Swen Schillig <swen@vnet.ibm.com>

Now that we removed the long messages for the bit error threshold
data, put the data in the hba trace. This way, we get a short warning
for the threshold event from the hardware and have the data in the
trace for further analysis.

Signed-off-by: Swen Schillig <swen@vnet.ibm.com>
Signed-off-by: Christof Schmitt <christof.schmitt@de.ibm.com>
---
 drivers/s390/scsi/zfcp_dbf.c |   46 +++++++++++++++++++++++++++++++++++++++++++
 drivers/s390/scsi/zfcp_dbf.h |    1 
 drivers/s390/scsi/zfcp_ext.h |    2 +
 drivers/s390/scsi/zfcp_fsf.c |    1 
 4 files changed, 50 insertions(+)

--- a/drivers/s390/scsi/zfcp_dbf.c	2008-10-01 11:08:09.000000000 +0200
+++ b/drivers/s390/scsi/zfcp_dbf.c	2008-10-01 11:09:31.000000000 +0200
@@ -318,6 +318,26 @@ void zfcp_hba_dbf_event_qdio(struct zfcp
 	spin_unlock_irqrestore(&adapter->hba_dbf_lock, flags);
 }
 
+/**
+ * zfcp_hba_dbf_event_berr - trace event for bit error threshold
+ * @adapter: adapter affected by this QDIO related event
+ * @req: fsf request
+ */
+void zfcp_hba_dbf_event_berr(struct zfcp_adapter *adapter,
+			     struct zfcp_fsf_req *req)
+{
+	struct zfcp_hba_dbf_record *r = &adapter->hba_dbf_buf;
+	struct fsf_status_read_buffer *sr_buf = req->data;
+	struct fsf_bit_error_payload *err = &sr_buf->payload.bit_error;
+	unsigned long flags;
+
+	spin_lock_irqsave(&adapter->hba_dbf_lock, flags);
+	memset(r, 0, sizeof(*r));
+	strncpy(r->tag, "berr", ZFCP_DBF_TAG_SIZE);
+	memcpy(&r->u.berr, err, sizeof(struct fsf_bit_error_payload));
+	debug_event(adapter->hba_dbf, 0, r, sizeof(*r));
+	spin_unlock_irqrestore(&adapter->hba_dbf_lock, flags);
+}
 static void zfcp_hba_dbf_view_response(char **p,
 				       struct zfcp_hba_dbf_record_response *r)
 {
@@ -399,6 +419,30 @@ static void zfcp_hba_dbf_view_qdio(char 
 	zfcp_dbf_out(p, "sbal_count", "0x%02x", r->sbal_count);
 }
 
+static void zfcp_hba_dbf_view_berr(char **p, struct fsf_bit_error_payload *r)
+{
+	zfcp_dbf_out(p, "link_failures", "%d", r->link_failure_error_count);
+	zfcp_dbf_out(p, "loss_of_sync_err", "%d", r->loss_of_sync_error_count);
+	zfcp_dbf_out(p, "loss_of_sig_err", "%d", r->loss_of_signal_error_count);
+	zfcp_dbf_out(p, "prim_seq_err", "%d",
+		     r->primitive_sequence_error_count);
+	zfcp_dbf_out(p, "inval_trans_word_err", "%d",
+		     r->invalid_transmission_word_error_count);
+	zfcp_dbf_out(p, "CRC_errors", "%d", r->crc_error_count);
+	zfcp_dbf_out(p, "prim_seq_event_to", "%d",
+		     r->primitive_sequence_event_timeout_count);
+	zfcp_dbf_out(p, "elast_buf_overrun_err", "%d",
+		     r->elastic_buffer_overrun_error_count);
+	zfcp_dbf_out(p, "adv_rec_buf2buf_cred", "%d",
+		     r->advertised_receive_b2b_credit);
+	zfcp_dbf_out(p, "curr_rec_buf2buf_cred", "%d",
+		     r->current_receive_b2b_credit);
+	zfcp_dbf_out(p, "adv_trans_buf2buf_cred", "%d",
+		     r->advertised_transmit_b2b_credit);
+	zfcp_dbf_out(p, "curr_trans_buf2buf_cred", "%d",
+		     r->current_transmit_b2b_credit);
+}
+
 static int zfcp_hba_dbf_view_format(debug_info_t *id, struct debug_view *view,
 				    char *out_buf, const char *in_buf)
 {
@@ -418,6 +462,8 @@ static int zfcp_hba_dbf_view_format(debu
 		zfcp_hba_dbf_view_status(&p, &r->u.status);
 	else if (strncmp(r->tag, "qdio", ZFCP_DBF_TAG_SIZE) == 0)
 		zfcp_hba_dbf_view_qdio(&p, &r->u.qdio);
+	else if (strncmp(r->tag, "berr", ZFCP_DBF_TAG_SIZE) == 0)
+		zfcp_hba_dbf_view_berr(&p, &r->u.berr);
 
 	p += sprintf(p, "\n");
 	return p - out_buf;
--- a/drivers/s390/scsi/zfcp_dbf.h	2008-10-01 11:02:42.000000000 +0200
+++ b/drivers/s390/scsi/zfcp_dbf.h	2008-10-01 11:09:31.000000000 +0200
@@ -151,6 +151,7 @@ struct zfcp_hba_dbf_record {
 		struct zfcp_hba_dbf_record_response response;
 		struct zfcp_hba_dbf_record_status status;
 		struct zfcp_hba_dbf_record_qdio qdio;
+		struct fsf_bit_error_payload berr;
 	} u;
 } __attribute__ ((packed));
 
--- a/drivers/s390/scsi/zfcp_ext.h	2008-10-01 11:08:47.000000000 +0200
+++ b/drivers/s390/scsi/zfcp_ext.h	2008-10-01 11:09:31.000000000 +0200
@@ -49,6 +49,8 @@ extern void zfcp_hba_dbf_event_fsf_unsol
 					 struct fsf_status_read_buffer *);
 extern void zfcp_hba_dbf_event_qdio(struct zfcp_adapter *, unsigned int, int,
 				    int);
+extern void zfcp_hba_dbf_event_berr(struct zfcp_adapter *,
+				    struct zfcp_fsf_req *);
 extern void zfcp_san_dbf_event_ct_request(struct zfcp_fsf_req *);
 extern void zfcp_san_dbf_event_ct_response(struct zfcp_fsf_req *);
 extern void zfcp_san_dbf_event_els_request(struct zfcp_fsf_req *);
--- a/drivers/s390/scsi/zfcp_fsf.c	2008-10-01 11:09:06.000000000 +0200
+++ b/drivers/s390/scsi/zfcp_fsf.c	2008-10-01 11:09:31.000000000 +0200
@@ -294,6 +294,7 @@ static void zfcp_fsf_status_read_handler
 		dev_warn(&adapter->ccw_device->dev,
 			 "The error threshold for checksum statistics "
 			 "has been exceeded\n");
+		zfcp_hba_dbf_event_berr(adapter, req);
 		break;
 	case FSF_STATUS_READ_LINK_DOWN:
 		zfcp_fsf_status_read_link_down(req);

-- 

  parent reply	other threads:[~2008-10-01 10:42 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-10-01 10:42 [patch 00/13] zfcp updates for 2.6.28 Christof Schmitt
2008-10-01 10:42 ` [patch 01/13] zfcp: add queue_full sysfs attribute Christof Schmitt
2008-10-01 10:42 ` [patch 02/13] zfcp: Update message with input from review Christof Schmitt
2008-10-01 10:42 ` [patch 03/13] zfcp: remove unused references, declarations and flags Christof Schmitt
2008-10-01 10:42 ` [patch 04/13] zfcp: attach and release SAN nameserver port on demand Christof Schmitt
2008-10-01 10:42 ` [patch 05/13] zfcp: remove all typedefs and replace them with standards Christof Schmitt
2008-10-01 10:42 ` [patch 06/13] zfcp: Simplify get_adapter_by_busid Christof Schmitt
2008-10-01 10:42 ` [patch 07/13] zfcp: Simplify zfcp data structures Christof Schmitt
2008-10-01 10:42 ` Christof Schmitt [this message]
2008-10-01 10:42 ` [patch 09/13] zfcp: deadlock via shared work queue tasks Christof Schmitt
2008-10-01 10:42 ` [patch 10/13] zfcp: prevent fc_remote_port_delete calls for unregistered rport Christof Schmitt
2008-10-01 10:42 ` [patch 11/13] zfcp: fix erp list usage without using locks Christof Schmitt
2008-10-01 10:42 ` [patch 12/13] zfcp: wait on SCSI work to be finished before proceeding with init dev Christof Schmitt
2008-10-01 10:42 ` [patch 13/13] zfcp: fix double dbf id usage Christof Schmitt

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=20081001104802.157568000@de.ibm.com \
    --to=christof.schmitt@de.ibm.com \
    --cc=James.Bottomley@HansenPartnership.com \
    --cc=heiko.carstens@de.ibm.com \
    --cc=linux-s390@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=schwidefsky@de.ibm.com \
    --cc=swen@vnet.ibm.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.