aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/s390/scsi/zfcp_dbf.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/s390/scsi/zfcp_dbf.c')
-rw-r--r--drivers/s390/scsi/zfcp_dbf.c75
1 files changed, 60 insertions, 15 deletions
diff --git a/drivers/s390/scsi/zfcp_dbf.c b/drivers/s390/scsi/zfcp_dbf.c
index fca48b88fc53..060f5f2352ec 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,
318 spin_unlock_irqrestore(&adapter->hba_dbf_lock, flags); 318 spin_unlock_irqrestore(&adapter->hba_dbf_lock, flags);
319} 319}
320 320
321/**
322 * zfcp_hba_dbf_event_berr - trace event for bit error threshold
323 * @adapter: adapter affected by this QDIO related event
324 * @req: fsf request
325 */
326void zfcp_hba_dbf_event_berr(struct zfcp_adapter *adapter,
327 struct zfcp_fsf_req *req)
328{
329 struct zfcp_hba_dbf_record *r = &adapter->hba_dbf_buf;
330 struct fsf_status_read_buffer *sr_buf = req->data;
331 struct fsf_bit_error_payload *err = &sr_buf->payload.bit_error;
332 unsigned long flags;
333
334 spin_lock_irqsave(&adapter->hba_dbf_lock, flags);
335 memset(r, 0, sizeof(*r));
336 strncpy(r->tag, "berr", ZFCP_DBF_TAG_SIZE);
337 memcpy(&r->u.berr, err, sizeof(struct fsf_bit_error_payload));
338 debug_event(adapter->hba_dbf, 0, r, sizeof(*r));
339 spin_unlock_irqrestore(&adapter->hba_dbf_lock, flags);
340}
321static void zfcp_hba_dbf_view_response(char **p, 341static void zfcp_hba_dbf_view_response(char **p,
322 struct zfcp_hba_dbf_record_response *r) 342 struct zfcp_hba_dbf_record_response *r)
323{ 343{
@@ -399,6 +419,30 @@ static void zfcp_hba_dbf_view_qdio(char **p, struct zfcp_hba_dbf_record_qdio *r)
399 zfcp_dbf_out(p, "sbal_count", "0x%02x", r->sbal_count); 419 zfcp_dbf_out(p, "sbal_count", "0x%02x", r->sbal_count);
400} 420}
401 421
422static void zfcp_hba_dbf_view_berr(char **p, struct fsf_bit_error_payload *r)
423{
424 zfcp_dbf_out(p, "link_failures", "%d", r->link_failure_error_count);
425 zfcp_dbf_out(p, "loss_of_sync_err", "%d", r->loss_of_sync_error_count);
426 zfcp_dbf_out(p, "loss_of_sig_err", "%d", r->loss_of_signal_error_count);
427 zfcp_dbf_out(p, "prim_seq_err", "%d",
428 r->primitive_sequence_error_count);
429 zfcp_dbf_out(p, "inval_trans_word_err", "%d",
430 r->invalid_transmission_word_error_count);
431 zfcp_dbf_out(p, "CRC_errors", "%d", r->crc_error_count);
432 zfcp_dbf_out(p, "prim_seq_event_to", "%d",
433 r->primitive_sequence_event_timeout_count);
434 zfcp_dbf_out(p, "elast_buf_overrun_err", "%d",
435 r->elastic_buffer_overrun_error_count);
436 zfcp_dbf_out(p, "adv_rec_buf2buf_cred", "%d",
437 r->advertised_receive_b2b_credit);
438 zfcp_dbf_out(p, "curr_rec_buf2buf_cred", "%d",
439 r->current_receive_b2b_credit);
440 zfcp_dbf_out(p, "adv_trans_buf2buf_cred", "%d",
441 r->advertised_transmit_b2b_credit);
442 zfcp_dbf_out(p, "curr_trans_buf2buf_cred", "%d",
443 r->current_transmit_b2b_credit);
444}
445
402static int zfcp_hba_dbf_view_format(debug_info_t *id, struct debug_view *view, 446static int zfcp_hba_dbf_view_format(debug_info_t *id, struct debug_view *view,
403 char *out_buf, const char *in_buf) 447 char *out_buf, const char *in_buf)
404{ 448{
@@ -418,6 +462,8 @@ static int zfcp_hba_dbf_view_format(debug_info_t *id, struct debug_view *view,
418 zfcp_hba_dbf_view_status(&p, &r->u.status); 462 zfcp_hba_dbf_view_status(&p, &r->u.status);
419 else if (strncmp(r->tag, "qdio", ZFCP_DBF_TAG_SIZE) == 0) 463 else if (strncmp(r->tag, "qdio", ZFCP_DBF_TAG_SIZE) == 0)
420 zfcp_hba_dbf_view_qdio(&p, &r->u.qdio); 464 zfcp_hba_dbf_view_qdio(&p, &r->u.qdio);
465 else if (strncmp(r->tag, "berr", ZFCP_DBF_TAG_SIZE) == 0)
466 zfcp_hba_dbf_view_berr(&p, &r->u.berr);
421 467
422 p += sprintf(p, "\n"); 468 p += sprintf(p, "\n");
423 return p - out_buf; 469 return p - out_buf;
@@ -519,14 +565,14 @@ static const char *zfcp_rec_dbf_ids[] = {
519 [75] = "physical port recovery escalation after failed port " 565 [75] = "physical port recovery escalation after failed port "
520 "recovery", 566 "recovery",
521 [76] = "port recovery escalation after failed unit recovery", 567 [76] = "port recovery escalation after failed unit recovery",
522 [77] = "recovery opening nameserver port", 568 [77] = "",
523 [78] = "duplicate request id", 569 [78] = "duplicate request id",
524 [79] = "link down", 570 [79] = "link down",
525 [80] = "exclusive read-only unit access unsupported", 571 [80] = "exclusive read-only unit access unsupported",
526 [81] = "shared read-write unit access unsupported", 572 [81] = "shared read-write unit access unsupported",
527 [82] = "incoming rscn", 573 [82] = "incoming rscn",
528 [83] = "incoming wwpn", 574 [83] = "incoming wwpn",
529 [84] = "", 575 [84] = "wka port handle not valid close port",
530 [85] = "online", 576 [85] = "online",
531 [86] = "offline", 577 [86] = "offline",
532 [87] = "ccw device gone", 578 [87] = "ccw device gone",
@@ -570,7 +616,7 @@ static const char *zfcp_rec_dbf_ids[] = {
570 [125] = "need newer zfcp", 616 [125] = "need newer zfcp",
571 [126] = "need newer microcode", 617 [126] = "need newer microcode",
572 [127] = "arbitrated loop not supported", 618 [127] = "arbitrated loop not supported",
573 [128] = "unknown topology", 619 [128] = "",
574 [129] = "qtcb size mismatch", 620 [129] = "qtcb size mismatch",
575 [130] = "unknown fsf status ecd", 621 [130] = "unknown fsf status ecd",
576 [131] = "fcp request too big", 622 [131] = "fcp request too big",
@@ -829,9 +875,9 @@ void zfcp_rec_dbf_event_action(u8 id2, struct zfcp_erp_action *erp_action)
829void zfcp_san_dbf_event_ct_request(struct zfcp_fsf_req *fsf_req) 875void zfcp_san_dbf_event_ct_request(struct zfcp_fsf_req *fsf_req)
830{ 876{
831 struct zfcp_send_ct *ct = (struct zfcp_send_ct *)fsf_req->data; 877 struct zfcp_send_ct *ct = (struct zfcp_send_ct *)fsf_req->data;
832 struct zfcp_port *port = ct->port; 878 struct zfcp_wka_port *wka_port = ct->wka_port;
833 struct zfcp_adapter *adapter = port->adapter; 879 struct zfcp_adapter *adapter = wka_port->adapter;
834 struct ct_hdr *hdr = zfcp_sg_to_address(ct->req); 880 struct ct_hdr *hdr = sg_virt(ct->req);
835 struct zfcp_san_dbf_record *r = &adapter->san_dbf_buf; 881 struct zfcp_san_dbf_record *r = &adapter->san_dbf_buf;
836 struct zfcp_san_dbf_record_ct_request *oct = &r->u.ct_req; 882 struct zfcp_san_dbf_record_ct_request *oct = &r->u.ct_req;
837 unsigned long flags; 883 unsigned long flags;
@@ -842,7 +888,7 @@ void zfcp_san_dbf_event_ct_request(struct zfcp_fsf_req *fsf_req)
842 r->fsf_reqid = (unsigned long)fsf_req; 888 r->fsf_reqid = (unsigned long)fsf_req;
843 r->fsf_seqno = fsf_req->seq_no; 889 r->fsf_seqno = fsf_req->seq_no;
844 r->s_id = fc_host_port_id(adapter->scsi_host); 890 r->s_id = fc_host_port_id(adapter->scsi_host);
845 r->d_id = port->d_id; 891 r->d_id = wka_port->d_id;
846 oct->cmd_req_code = hdr->cmd_rsp_code; 892 oct->cmd_req_code = hdr->cmd_rsp_code;
847 oct->revision = hdr->revision; 893 oct->revision = hdr->revision;
848 oct->gs_type = hdr->gs_type; 894 oct->gs_type = hdr->gs_type;
@@ -863,9 +909,9 @@ void zfcp_san_dbf_event_ct_request(struct zfcp_fsf_req *fsf_req)
863void zfcp_san_dbf_event_ct_response(struct zfcp_fsf_req *fsf_req) 909void zfcp_san_dbf_event_ct_response(struct zfcp_fsf_req *fsf_req)
864{ 910{
865 struct zfcp_send_ct *ct = (struct zfcp_send_ct *)fsf_req->data; 911 struct zfcp_send_ct *ct = (struct zfcp_send_ct *)fsf_req->data;
866 struct zfcp_port *port = ct->port; 912 struct zfcp_wka_port *wka_port = ct->wka_port;
867 struct zfcp_adapter *adapter = port->adapter; 913 struct zfcp_adapter *adapter = wka_port->adapter;
868 struct ct_hdr *hdr = zfcp_sg_to_address(ct->resp); 914 struct ct_hdr *hdr = sg_virt(ct->resp);
869 struct zfcp_san_dbf_record *r = &adapter->san_dbf_buf; 915 struct zfcp_san_dbf_record *r = &adapter->san_dbf_buf;
870 struct zfcp_san_dbf_record_ct_response *rct = &r->u.ct_resp; 916 struct zfcp_san_dbf_record_ct_response *rct = &r->u.ct_resp;
871 unsigned long flags; 917 unsigned long flags;
@@ -875,7 +921,7 @@ void zfcp_san_dbf_event_ct_response(struct zfcp_fsf_req *fsf_req)
875 strncpy(r->tag, "rctc", ZFCP_DBF_TAG_SIZE); 921 strncpy(r->tag, "rctc", ZFCP_DBF_TAG_SIZE);
876 r->fsf_reqid = (unsigned long)fsf_req; 922 r->fsf_reqid = (unsigned long)fsf_req;
877 r->fsf_seqno = fsf_req->seq_no; 923 r->fsf_seqno = fsf_req->seq_no;
878 r->s_id = port->d_id; 924 r->s_id = wka_port->d_id;
879 r->d_id = fc_host_port_id(adapter->scsi_host); 925 r->d_id = fc_host_port_id(adapter->scsi_host);
880 rct->cmd_rsp_code = hdr->cmd_rsp_code; 926 rct->cmd_rsp_code = hdr->cmd_rsp_code;
881 rct->revision = hdr->revision; 927 rct->revision = hdr->revision;
@@ -922,8 +968,8 @@ void zfcp_san_dbf_event_els_request(struct zfcp_fsf_req *fsf_req)
922 968
923 zfcp_san_dbf_event_els("oels", 2, fsf_req, 969 zfcp_san_dbf_event_els("oels", 2, fsf_req,
924 fc_host_port_id(els->adapter->scsi_host), 970 fc_host_port_id(els->adapter->scsi_host),
925 els->d_id, *(u8 *) zfcp_sg_to_address(els->req), 971 els->d_id, *(u8 *) sg_virt(els->req),
926 zfcp_sg_to_address(els->req), els->req->length); 972 sg_virt(els->req), els->req->length);
927} 973}
928 974
929/** 975/**
@@ -936,8 +982,7 @@ void zfcp_san_dbf_event_els_response(struct zfcp_fsf_req *fsf_req)
936 982
937 zfcp_san_dbf_event_els("rels", 2, fsf_req, els->d_id, 983 zfcp_san_dbf_event_els("rels", 2, fsf_req, els->d_id,
938 fc_host_port_id(els->adapter->scsi_host), 984 fc_host_port_id(els->adapter->scsi_host),
939 *(u8 *)zfcp_sg_to_address(els->req), 985 *(u8 *)sg_virt(els->req), sg_virt(els->resp),
940 zfcp_sg_to_address(els->resp),
941 els->resp->length); 986 els->resp->length);
942} 987}
943 988