xref: /titanic_51/usr/src/cmd/fm/eversholt/files/common/disk.esc (revision db3659e514c8bf3f03bcca6dd082e363bd7b466a)
1/*
2 * CDDL HEADER START
3 *
4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License (the "License").
6 * You may not use this file except in compliance with the License.
7 *
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 * or http://www.opensolaris.org/os/licensing.
10 * See the License for the specific language governing permissions
11 * and limitations under the License.
12 *
13 * When distributing Covered Code, include this CDDL HEADER in each
14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 * If applicable, add the following below this CDDL HEADER, with the
16 * fields enclosed by brackets "[]" replaced with your own identifying
17 * information: Portions Copyright [yyyy] [name of copyright owner]
18 *
19 * CDDL HEADER END
20 */
21/*
22 * Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
23 * Use is subject to license terms.
24 */
25
26#pragma dictionary "DISK"
27
28#define	P	disk
29
30fru P;
31asru P;
32
33/*
34 * disk-as-detector: The disk-as-detector DE provides the mapping between
35 * ereports generated by a kernel disk driver sd(7D) and resulting faults.
36 */
37
38/*
39 * disk-as-detector: fault events.
40 */
41event fault.io.scsi.cmd.disk.dev.rqs.derr@P;
42event fault.io.scsi.cmd.disk.dev.rqs.merr@P;
43/*
44 * The uderr fault will be defined at some future time.
45 * event fault.io.scsi.cmd.disk.dev.uderr@P;
46 */
47
48/*
49 * disk-as-detector: upset events.
50 * NOTE: For now we define an upset to implement discard.
51 */
52event upset.io.scsi.cmd.disk.dev.rqs.derr@P;
53event upset.io.scsi.cmd.disk.dev.rqs.merr@P;
54event upset.io.scsi.cmd.disk.dev.uderr@P;
55event upset.io.scsi.cmd.disk.dev.serr@P;
56event upset.io.scsi.cmd.disk.tran@P;
57event upset.io.scsi.cmd.disk.recovered@P;
58
59/*
60 * disk-as-detector: ereports from the kernel.
61 *
62 * We don't know the topology for all scsi disks, but the kernel will always
63 * generate ereport telemetry assuming that we do. We define these ereports
64 * with 'discard_if_config_unknown=1', which permits ereports against things
65 * with unknown topology to be silently discarded.  The ereport data is logged
66 * in either case, and can be viewed via 'fmdump -eV'.
67 */
68event ereport.io.scsi.cmd.disk.dev.rqs.derr@P, discard_if_config_unknown=1;
69event ereport.io.scsi.cmd.disk.dev.rqs.merr@P, discard_if_config_unknown=1;
70event ereport.io.scsi.cmd.disk.dev.serr@P, discard_if_config_unknown=1;
71event ereport.io.scsi.cmd.disk.dev.uderr@P, discard_if_config_unknown=1;
72event ereport.io.scsi.cmd.disk.recovered@P, discard_if_config_unknown=1;
73event ereport.io.scsi.cmd.disk.tran@P, discard_if_config_unknown=1;
74
75/*
76 * For some ereports we let the 'driver-assessment', communicated as part of
77 * the ereport payload, determine fault .vs. upset via propagation constraints.
78 */
79#define DRIVER_ASSESSMENT_FATAL		\
80	    (payloadprop_contains("driver-assessment", "fatal"))
81#define DRIVER_ASSESSMENT_NONFATAL	(!DRIVER_ASSESSMENT_FATAL)
82
83/*
84 * disk-as-detector: propagations from faults(based on
85 * DRIVER_ASSESSMENT_FATAL).
86 * We need to set additional fault payloads to indicate fault details.
87 * The payload we may need are listed as following:
88 * fault.io.scsi.cmd.disk.dev.rqs.derr
89 *     op_code, key, asc, ascq
90 * fault.io.scsi.cmd.disk.dev.rqs.merr
91 *     op_code, key, asc, ascq, lba
92 */
93prop fault.io.scsi.cmd.disk.dev.rqs.derr@P->
94    ereport.io.scsi.cmd.disk.dev.rqs.derr@P{ DRIVER_ASSESSMENT_FATAL &&
95    setpayloadprop("key", payloadprop("key")) &&
96    setpayloadprop("asc", payloadprop("asc")) &&
97    setpayloadprop("ascq", payloadprop("ascq"))};
98
99prop fault.io.scsi.cmd.disk.dev.rqs.merr@P->
100    ereport.io.scsi.cmd.disk.dev.rqs.merr@P{ DRIVER_ASSESSMENT_FATAL &&
101    setpayloadprop("key", payloadprop("key")) &&
102    setpayloadprop("asc", payloadprop("asc")) &&
103    setpayloadprop("ascq", payloadprop("ascq")) &&
104    setpayloadprop("lba", payloadprop("lba"))};
105
106/*
107 * The uderr fault will be propagated at some future time.
108 * prop fault.io.scsi.cmd.disk.dev.uderr@P->
109 *     ereport.io.scsi.cmd.disk.dev.uderr@P{ DRIVER_ASSESSMENT_FATAL };
110 */
111
112/*
113 * disk-as-detector: propagations from upsets(based on
114 * DRIVER_ASSESSMENT_NONFATAL).
115 */
116prop upset.io.scsi.cmd.disk.dev.rqs.derr@P->
117    ereport.io.scsi.cmd.disk.dev.rqs.derr@P{ DRIVER_ASSESSMENT_NONFATAL };
118
119prop upset.io.scsi.cmd.disk.dev.rqs.merr@P->
120    ereport.io.scsi.cmd.disk.dev.rqs.merr@P{ DRIVER_ASSESSMENT_NONFATAL };
121
122/*
123 * disk-as-detector: propagations from upsets(independent of
124 * driver-assessment)
125 */
126
127prop upset.io.scsi.cmd.disk.dev.serr@P->
128    ereport.io.scsi.cmd.disk.dev.serr@P;
129
130prop upset.io.scsi.cmd.disk.dev.uderr@P->
131    ereport.io.scsi.cmd.disk.dev.uderr@P;
132
133prop upset.io.scsi.cmd.disk.recovered@P->
134    ereport.io.scsi.cmd.disk.recovered@P;
135
136prop upset.io.scsi.cmd.disk.tran@P->
137    ereport.io.scsi.cmd.disk.tran@P;
138
139/*
140 * --------------------------------------
141 * The remainder of this file contains rules associated with the operation of
142 * cmd/fm/modules/common/disk-monitor/disk_monitor.c code.
143 *
144 * The disk DE provides a very simple 1-to-1 mapping between SCSI disk events
145 * generated by the disk-transport fmd module, and the resulting faults.
146 */
147
148/*
149 * Fault events.
150 */
151event fault.io.disk.over-temperature@P,
152    FITrate=10, FRU=P, ASRU=P;
153event fault.io.disk.predictive-failure@P, FITrate=10,
154    FITrate=10, FRU=P, ASRU=P;
155event fault.io.disk.self-test-failure@P, FITrate=10,
156    FITrate=10, FRU=P, ASRU=P;
157
158/*
159 * ereports.
160 */
161event ereport.io.scsi.disk.over-temperature@P;
162event ereport.io.scsi.disk.predictive-failure@P;
163event ereport.io.scsi.disk.self-test-failure@P;
164
165/*
166 * Propagations.
167 */
168prop fault.io.disk.over-temperature@P ->
169    ereport.io.scsi.disk.over-temperature@P;
170
171prop fault.io.disk.self-test-failure@P ->
172    ereport.io.scsi.disk.self-test-failure@P;
173
174prop fault.io.disk.predictive-failure@P ->
175    ereport.io.scsi.disk.predictive-failure@P;
176