diff options
author | Martin Peschke <mp3@de.ibm.com> | 2008-03-27 09:22:03 -0400 |
---|---|---|
committer | James Bottomley <James.Bottomley@HansenPartnership.com> | 2008-04-07 13:19:04 -0400 |
commit | 9467a9b3efdd9041202f71cc270bda827a7ec777 (patch) | |
tree | 9e7b8e167da9aa5065b1f7ed1d2a1ab9c2ad47da /drivers/s390/scsi/zfcp_dbf.c | |
parent | 698ec01635819c5ae60090bb4efcbeffc41642fb (diff) |
[SCSI] zfcp: Trace all triggers of error recovery activity
This patch allows any recovery event to be traced back to an exact
cause, e.g. a particular request identified by an id (address).
Signed-off-by: Martin Peschke <mp3@de.ibm.com>
Signed-off-by: Christof Schmitt <christof.schmitt@de.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
Diffstat (limited to 'drivers/s390/scsi/zfcp_dbf.c')
-rw-r--r-- | drivers/s390/scsi/zfcp_dbf.c | 134 |
1 files changed, 134 insertions, 0 deletions
diff --git a/drivers/s390/scsi/zfcp_dbf.c b/drivers/s390/scsi/zfcp_dbf.c index 2fcfe9bec554..f207b0bd0cad 100644 --- a/drivers/s390/scsi/zfcp_dbf.c +++ b/drivers/s390/scsi/zfcp_dbf.c | |||
@@ -523,6 +523,7 @@ static struct debug_view zfcp_hba_dbf_view = { | |||
523 | static const char *zfcp_rec_dbf_tags[] = { | 523 | static const char *zfcp_rec_dbf_tags[] = { |
524 | [ZFCP_REC_DBF_ID_THREAD] = "thread", | 524 | [ZFCP_REC_DBF_ID_THREAD] = "thread", |
525 | [ZFCP_REC_DBF_ID_TARGET] = "target", | 525 | [ZFCP_REC_DBF_ID_TARGET] = "target", |
526 | [ZFCP_REC_DBF_ID_TRIGGER] = "trigger", | ||
526 | }; | 527 | }; |
527 | 528 | ||
528 | static const char *zfcp_rec_dbf_ids[] = { | 529 | static const char *zfcp_rec_dbf_ids[] = { |
@@ -587,6 +588,89 @@ static const char *zfcp_rec_dbf_ids[] = { | |||
587 | [59] = "unit access denied open unit", | 588 | [59] = "unit access denied open unit", |
588 | [60] = "shared unit access denied open unit", | 589 | [60] = "shared unit access denied open unit", |
589 | [61] = "unit access denied fcp", | 590 | [61] = "unit access denied fcp", |
591 | [62] = "request timeout", | ||
592 | [63] = "adisc link test reject or timeout", | ||
593 | [64] = "adisc link test d_id changed", | ||
594 | [65] = "adisc link test failed", | ||
595 | [66] = "recovery out of memory", | ||
596 | [67] = "adapter recovery repeated after state change", | ||
597 | [68] = "port recovery repeated after state change", | ||
598 | [69] = "unit recovery repeated after state change", | ||
599 | [70] = "port recovery follow-up after successful adapter recovery", | ||
600 | [71] = "adapter recovery escalation after failed adapter recovery", | ||
601 | [72] = "port recovery follow-up after successful physical port " | ||
602 | "recovery", | ||
603 | [73] = "adapter recovery escalation after failed physical port " | ||
604 | "recovery", | ||
605 | [74] = "unit recovery follow-up after successful port recovery", | ||
606 | [75] = "physical port recovery escalation after failed port " | ||
607 | "recovery", | ||
608 | [76] = "port recovery escalation after failed unit recovery", | ||
609 | [77] = "recovery opening nameserver port", | ||
610 | [78] = "duplicate request id", | ||
611 | [79] = "link down", | ||
612 | [80] = "exclusive read-only unit access unsupported", | ||
613 | [81] = "shared read-write unit access unsupported", | ||
614 | [82] = "incoming rscn", | ||
615 | [83] = "incoming plogi", | ||
616 | [84] = "incoming logo", | ||
617 | [85] = "online", | ||
618 | [86] = "offline", | ||
619 | [87] = "ccw device gone", | ||
620 | [88] = "ccw device no path", | ||
621 | [89] = "ccw device operational", | ||
622 | [90] = "ccw device shutdown", | ||
623 | [91] = "sysfs port addition", | ||
624 | [92] = "sysfs port removal", | ||
625 | [93] = "sysfs adapter recovery", | ||
626 | [94] = "sysfs unit addition", | ||
627 | [95] = "sysfs unit removal", | ||
628 | [96] = "sysfs port recovery", | ||
629 | [97] = "sysfs unit recovery", | ||
630 | [98] = "sequence number mismatch", | ||
631 | [99] = "link up", | ||
632 | [100] = "error state", | ||
633 | [101] = "status read physical port closed", | ||
634 | [102] = "link up status read", | ||
635 | [103] = "too many failed status read buffers", | ||
636 | [104] = "port handle not valid abort", | ||
637 | [105] = "lun handle not valid abort", | ||
638 | [106] = "port handle not valid ct", | ||
639 | [107] = "port handle not valid close port", | ||
640 | [108] = "port handle not valid close physical port", | ||
641 | [109] = "port handle not valid open unit", | ||
642 | [110] = "port handle not valid close unit", | ||
643 | [111] = "lun handle not valid close unit", | ||
644 | [112] = "port handle not valid fcp", | ||
645 | [113] = "lun handle not valid fcp", | ||
646 | [114] = "handle mismatch fcp", | ||
647 | [115] = "lun not valid fcp", | ||
648 | [116] = "qdio send failed", | ||
649 | [117] = "version mismatch", | ||
650 | [118] = "incompatible qtcb type", | ||
651 | [119] = "unknown protocol status", | ||
652 | [120] = "unknown fsf command", | ||
653 | [121] = "no recommendation for status qualifier", | ||
654 | [122] = "status read physical port closed in error", | ||
655 | [123] = "fc service class not supported ct", | ||
656 | [124] = "fc service class not supported els", | ||
657 | [125] = "need newer zfcp", | ||
658 | [126] = "need newer microcode", | ||
659 | [127] = "arbitrated loop not supported", | ||
660 | [128] = "unknown topology", | ||
661 | [129] = "qtcb size mismatch", | ||
662 | [130] = "unknown fsf status ecd", | ||
663 | [131] = "fcp request too big", | ||
664 | [132] = "fc service class not supported fcp", | ||
665 | [133] = "data direction not valid fcp", | ||
666 | [134] = "command length not valid fcp", | ||
667 | [135] = "status read act update", | ||
668 | [136] = "status read cfdc update", | ||
669 | [137] = "hbaapi port open", | ||
670 | [138] = "hbaapi unit open", | ||
671 | [139] = "hbaapi unit shutdown", | ||
672 | [140] = "qdio error", | ||
673 | [141] = "scsi host reset", | ||
590 | }; | 674 | }; |
591 | 675 | ||
592 | static int zfcp_rec_dbf_view_format(debug_info_t *id, struct debug_view *view, | 676 | static int zfcp_rec_dbf_view_format(debug_info_t *id, struct debug_view *view, |
@@ -613,6 +697,17 @@ static int zfcp_rec_dbf_view_format(debug_info_t *id, struct debug_view *view, | |||
613 | zfcp_dbf_out(&p, "wwpn", "0x%016Lx", r->u.target.wwpn); | 697 | zfcp_dbf_out(&p, "wwpn", "0x%016Lx", r->u.target.wwpn); |
614 | zfcp_dbf_out(&p, "fcp_lun", "0x%016Lx", r->u.target.fcp_lun); | 698 | zfcp_dbf_out(&p, "fcp_lun", "0x%016Lx", r->u.target.fcp_lun); |
615 | break; | 699 | break; |
700 | case ZFCP_REC_DBF_ID_TRIGGER: | ||
701 | zfcp_dbf_out(&p, "reference", "0x%016Lx", r->u.trigger.ref); | ||
702 | zfcp_dbf_out(&p, "erp_action", "0x%016Lx", r->u.trigger.action); | ||
703 | zfcp_dbf_out(&p, "requested", "%d", r->u.trigger.want); | ||
704 | zfcp_dbf_out(&p, "executed", "%d", r->u.trigger.need); | ||
705 | zfcp_dbf_out(&p, "wwpn", "0x%016Lx", r->u.trigger.wwpn); | ||
706 | zfcp_dbf_out(&p, "fcp_lun", "0x%016Lx", r->u.trigger.fcp_lun); | ||
707 | zfcp_dbf_out(&p, "adapter_status", "0x%08x", r->u.trigger.as); | ||
708 | zfcp_dbf_out(&p, "port_status", "0x%08x", r->u.trigger.ps); | ||
709 | zfcp_dbf_out(&p, "unit_status", "0x%08x", r->u.trigger.us); | ||
710 | break; | ||
616 | } | 711 | } |
617 | sprintf(p, "\n"); | 712 | sprintf(p, "\n"); |
618 | return (p - buf) + 1; | 713 | return (p - buf) + 1; |
@@ -727,6 +822,45 @@ void zfcp_rec_dbf_event_unit(u8 id, u64 ref, struct zfcp_unit *unit) | |||
727 | unit->fcp_lun); | 822 | unit->fcp_lun); |
728 | } | 823 | } |
729 | 824 | ||
825 | /** | ||
826 | * zfcp_rec_dbf_event_trigger - trace event for triggered error recovery | ||
827 | * @id2: identifier for error recovery trigger | ||
828 | * @ref: additional reference (e.g. request) | ||
829 | * @want: originally requested error recovery action | ||
830 | * @need: error recovery action actually initiated | ||
831 | * @action: address of error recovery action struct | ||
832 | * @adapter: adapter | ||
833 | * @port: port | ||
834 | * @unit: unit | ||
835 | */ | ||
836 | void zfcp_rec_dbf_event_trigger(u8 id2, u64 ref, u8 want, u8 need, u64 action, | ||
837 | struct zfcp_adapter *adapter, | ||
838 | struct zfcp_port *port, struct zfcp_unit *unit) | ||
839 | { | ||
840 | struct zfcp_rec_dbf_record *r = &adapter->rec_dbf_buf; | ||
841 | unsigned long flags; | ||
842 | |||
843 | spin_lock_irqsave(&adapter->rec_dbf_lock, flags); | ||
844 | memset(r, 0, sizeof(*r)); | ||
845 | r->id = ZFCP_REC_DBF_ID_TRIGGER; | ||
846 | r->id2 = id2; | ||
847 | r->u.trigger.ref = ref; | ||
848 | r->u.trigger.want = want; | ||
849 | r->u.trigger.need = need; | ||
850 | r->u.trigger.action = action; | ||
851 | r->u.trigger.as = atomic_read(&adapter->status); | ||
852 | if (port) { | ||
853 | r->u.trigger.ps = atomic_read(&port->status); | ||
854 | r->u.trigger.wwpn = port->wwpn; | ||
855 | } | ||
856 | if (unit) { | ||
857 | r->u.trigger.us = atomic_read(&unit->status); | ||
858 | r->u.trigger.fcp_lun = unit->fcp_lun; | ||
859 | } | ||
860 | debug_event(adapter->rec_dbf, action ? 1 : 4, r, sizeof(*r)); | ||
861 | spin_unlock_irqrestore(&adapter->rec_dbf_lock, flags); | ||
862 | } | ||
863 | |||
730 | static void | 864 | static void |
731 | _zfcp_san_dbf_event_common_ct(const char *tag, struct zfcp_fsf_req *fsf_req, | 865 | _zfcp_san_dbf_event_common_ct(const char *tag, struct zfcp_fsf_req *fsf_req, |
732 | u32 s_id, u32 d_id, void *buffer, int buflen) | 866 | u32 s_id, u32 d_id, void *buffer, int buflen) |