diff options
author | Michael Albaugh <michael.albaugh@qlogic.com> | 2007-05-17 10:26:28 -0400 |
---|---|---|
committer | Roland Dreier <rolandd@cisco.com> | 2007-07-09 23:12:25 -0400 |
commit | aecd3b5ab19624ca9644b9df9c61615282d8923f (patch) | |
tree | d4f4b5367a40bd737899b7e3dbfcfab6021891e0 /drivers/infiniband/hw/ipath/ipath_kernel.h | |
parent | 8e9ab3f1c9e34d5c28446c3738983d33a3937fe0 (diff) |
IB/ipath: Log "active" time and some errors to EEPROM
We currently track various errors, now we enhance that capability by
logging some of them to EEPROM. We also now log a cumulative "active"
time defined by traffic though the InfiniPath HCA beyond the normal SM
traffic.
Signed-off-by: Michael Albaugh <michael.albaugh@qlogic.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
Diffstat (limited to 'drivers/infiniband/hw/ipath/ipath_kernel.h')
-rw-r--r-- | drivers/infiniband/hw/ipath/ipath_kernel.h | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/drivers/infiniband/hw/ipath/ipath_kernel.h b/drivers/infiniband/hw/ipath/ipath_kernel.h index bd1088a99891..2a4414b948ee 100644 --- a/drivers/infiniband/hw/ipath/ipath_kernel.h +++ b/drivers/infiniband/hw/ipath/ipath_kernel.h | |||
@@ -57,6 +57,24 @@ | |||
57 | extern struct infinipath_stats ipath_stats; | 57 | extern struct infinipath_stats ipath_stats; |
58 | 58 | ||
59 | #define IPATH_CHIP_SWVERSION IPATH_CHIP_VERS_MAJ | 59 | #define IPATH_CHIP_SWVERSION IPATH_CHIP_VERS_MAJ |
60 | /* | ||
61 | * First-cut critierion for "device is active" is | ||
62 | * two thousand dwords combined Tx, Rx traffic per | ||
63 | * 5-second interval. SMA packets are 64 dwords, | ||
64 | * and occur "a few per second", presumably each way. | ||
65 | */ | ||
66 | #define IPATH_TRAFFIC_ACTIVE_THRESHOLD (2000) | ||
67 | /* | ||
68 | * Struct used to indicate which errors are logged in each of the | ||
69 | * error-counters that are logged to EEPROM. A counter is incremented | ||
70 | * _once_ (saturating at 255) for each event with any bits set in | ||
71 | * the error or hwerror register masks below. | ||
72 | */ | ||
73 | #define IPATH_EEP_LOG_CNT (4) | ||
74 | struct ipath_eep_log_mask { | ||
75 | u64 errs_to_log; | ||
76 | u64 hwerrs_to_log; | ||
77 | }; | ||
60 | 78 | ||
61 | struct ipath_portdata { | 79 | struct ipath_portdata { |
62 | void **port_rcvegrbuf; | 80 | void **port_rcvegrbuf; |
@@ -588,6 +606,24 @@ struct ipath_devdata { | |||
588 | /* Used to flash LEDs in override mode */ | 606 | /* Used to flash LEDs in override mode */ |
589 | struct timer_list ipath_led_override_timer; | 607 | struct timer_list ipath_led_override_timer; |
590 | 608 | ||
609 | /* Support (including locks) for EEPROM logging of errors and time */ | ||
610 | /* control access to actual counters, timer */ | ||
611 | spinlock_t ipath_eep_st_lock; | ||
612 | /* control high-level access to EEPROM */ | ||
613 | struct semaphore ipath_eep_sem; | ||
614 | /* Below inc'd by ipath_snap_cntrs(), locked by ipath_eep_st_lock */ | ||
615 | uint64_t ipath_traffic_wds; | ||
616 | /* active time is kept in seconds, but logged in hours */ | ||
617 | atomic_t ipath_active_time; | ||
618 | /* Below are nominal shadow of EEPROM, new since last EEPROM update */ | ||
619 | uint8_t ipath_eep_st_errs[IPATH_EEP_LOG_CNT]; | ||
620 | uint8_t ipath_eep_st_new_errs[IPATH_EEP_LOG_CNT]; | ||
621 | uint16_t ipath_eep_hrs; | ||
622 | /* | ||
623 | * masks for which bits of errs, hwerrs that cause | ||
624 | * each of the counters to increment. | ||
625 | */ | ||
626 | struct ipath_eep_log_mask ipath_eep_st_masks[IPATH_EEP_LOG_CNT]; | ||
591 | }; | 627 | }; |
592 | 628 | ||
593 | /* Private data for file operations */ | 629 | /* Private data for file operations */ |
@@ -726,6 +762,8 @@ u32 __iomem *ipath_getpiobuf(struct ipath_devdata *, u32 *); | |||
726 | void ipath_init_iba6120_funcs(struct ipath_devdata *); | 762 | void ipath_init_iba6120_funcs(struct ipath_devdata *); |
727 | void ipath_init_iba6110_funcs(struct ipath_devdata *); | 763 | void ipath_init_iba6110_funcs(struct ipath_devdata *); |
728 | void ipath_get_eeprom_info(struct ipath_devdata *); | 764 | void ipath_get_eeprom_info(struct ipath_devdata *); |
765 | int ipath_update_eeprom_log(struct ipath_devdata *dd); | ||
766 | void ipath_inc_eeprom_err(struct ipath_devdata *dd, u32 eidx, u32 incr); | ||
729 | u64 ipath_snap_cntr(struct ipath_devdata *, ipath_creg); | 767 | u64 ipath_snap_cntr(struct ipath_devdata *, ipath_creg); |
730 | void ipath_disarm_senderrbufs(struct ipath_devdata *, int); | 768 | void ipath_disarm_senderrbufs(struct ipath_devdata *, int); |
731 | 769 | ||