diff --git a/drivers/s390/scsi/zfcp_dbf.c b/drivers/s390/scsi/zfcp_dbf.c index c1f69f611e6910d55e3a26ff6297685cbef1a6fb..9c9f9cfcd46d504a6d1bb4b4073f9fc3f3569a5f 100644 --- a/drivers/s390/scsi/zfcp_dbf.c +++ b/drivers/s390/scsi/zfcp_dbf.c @@ -318,6 +318,26 @@ void zfcp_hba_dbf_event_qdio(struct zfcp_adapter *adapter, 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 **p, struct zfcp_hba_dbf_record_qdio *r) 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(debug_info_t *id, struct debug_view *view, 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; diff --git a/drivers/s390/scsi/zfcp_dbf.h b/drivers/s390/scsi/zfcp_dbf.h index 0ddb18449d11b190a602d628461d2f5f01dc564d..e8f450801fea7f1cd351b7dad1049d02f82ab238 100644 --- a/drivers/s390/scsi/zfcp_dbf.h +++ b/drivers/s390/scsi/zfcp_dbf.h @@ -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)); diff --git a/drivers/s390/scsi/zfcp_ext.h b/drivers/s390/scsi/zfcp_ext.h index b8c5c37b2afaa9896ca8667df3743baff8d8e1c3..b5adeda93e1df562106979546b39614740ba1575 100644 --- a/drivers/s390/scsi/zfcp_ext.h +++ b/drivers/s390/scsi/zfcp_ext.h @@ -49,6 +49,8 @@ extern void zfcp_hba_dbf_event_fsf_unsol(const char *, struct zfcp_adapter *, 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 *); diff --git a/drivers/s390/scsi/zfcp_fsf.c b/drivers/s390/scsi/zfcp_fsf.c index c10b88d235d21ff10e55b6d9a3646c73482cbc2c..f073fff0868fa03f5df3ea20dd7255612fc4a2a8 100644 --- a/drivers/s390/scsi/zfcp_fsf.c +++ b/drivers/s390/scsi/zfcp_fsf.c @@ -294,6 +294,7 @@ static void zfcp_fsf_status_read_handler(struct zfcp_fsf_req *req) 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);