diff options
author | Swen Schillig <swen@vnet.ibm.com> | 2010-12-02 09:16:14 -0500 |
---|---|---|
committer | James Bottomley <James.Bottomley@suse.de> | 2010-12-21 13:24:45 -0500 |
commit | a54ca0f62f953898b05549391ac2a8a4dad6482b (patch) | |
tree | f7376c8be33b2247e9dcc694cf88f38304847e79 /drivers/s390/scsi/zfcp_dbf.h | |
parent | 2c55b750a884b86dea8b4cc5f15e1484cc47a25c (diff) |
[SCSI] zfcp: Redesign of the debug tracing for HBA records.
This patch is the continuation to redesign the zfcp tracing to a more
straight-forward and easy to extend scheme.
This patch deals with all trace records of the zfcp HBA area.
Signed-off-by: Swen Schillig <swen@vnet.ibm.com>
Signed-off-by: Christof Schmitt <christof.schmitt@de.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Diffstat (limited to 'drivers/s390/scsi/zfcp_dbf.h')
-rw-r--r-- | drivers/s390/scsi/zfcp_dbf.h | 197 |
1 files changed, 93 insertions, 104 deletions
diff --git a/drivers/s390/scsi/zfcp_dbf.h b/drivers/s390/scsi/zfcp_dbf.h index a3af6bd3d5aa..5dc0b414cf28 100644 --- a/drivers/s390/scsi/zfcp_dbf.h +++ b/drivers/s390/scsi/zfcp_dbf.h | |||
@@ -1,22 +1,8 @@ | |||
1 | /* | 1 | /* |
2 | * This file is part of the zfcp device driver for | 2 | * zfcp device driver |
3 | * FCP adapters for IBM System z9 and zSeries. | 3 | * debug feature declarations |
4 | * | 4 | * |
5 | * Copyright IBM Corp. 2008, 2009 | 5 | * Copyright IBM Corp. 2008, 2010 |
6 | * | ||
7 | * This program is free software; you can redistribute it and/or modify | ||
8 | * it under the terms of the GNU General Public License as published by | ||
9 | * the Free Software Foundation; either version 2, or (at your option) | ||
10 | * any later version. | ||
11 | * | ||
12 | * This program is distributed in the hope that it will be useful, | ||
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
15 | * GNU General Public License for more details. | ||
16 | * | ||
17 | * You should have received a copy of the GNU General Public License | ||
18 | * along with this program; if not, write to the Free Software | ||
19 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | ||
20 | */ | 6 | */ |
21 | 7 | ||
22 | #ifndef ZFCP_DBF_H | 8 | #ifndef ZFCP_DBF_H |
@@ -136,73 +122,90 @@ struct zfcp_dbf_san { | |||
136 | char payload[ZFCP_DBF_SAN_MAX_PAYLOAD]; | 122 | char payload[ZFCP_DBF_SAN_MAX_PAYLOAD]; |
137 | } __packed; | 123 | } __packed; |
138 | 124 | ||
139 | struct zfcp_dbf_hba_record_response { | 125 | /** |
140 | u32 fsf_command; | 126 | * struct zfcp_dbf_hba_res - trace record for hba responses |
141 | u64 fsf_reqid; | 127 | * @req_issued: timestamp when request was issued |
142 | u32 fsf_seqno; | 128 | * @prot_status: protocol status |
143 | u64 fsf_issued; | 129 | * @prot_status_qual: protocol status qualifier |
144 | u32 fsf_prot_status; | 130 | * @fsf_status: fsf status |
131 | * @fsf_status_qual: fsf status qualifier | ||
132 | */ | ||
133 | struct zfcp_dbf_hba_res { | ||
134 | u64 req_issued; | ||
135 | u32 prot_status; | ||
136 | u8 prot_status_qual[FSF_PROT_STATUS_QUAL_SIZE]; | ||
145 | u32 fsf_status; | 137 | u32 fsf_status; |
146 | u8 fsf_prot_status_qual[FSF_PROT_STATUS_QUAL_SIZE]; | 138 | u8 fsf_status_qual[FSF_STATUS_QUALIFIER_SIZE]; |
147 | u8 fsf_status_qual[FSF_STATUS_QUALIFIER_SIZE]; | 139 | } __packed; |
148 | u32 fsf_req_status; | ||
149 | u8 sbal_first; | ||
150 | u8 sbal_last; | ||
151 | u8 sbal_response; | ||
152 | u8 pool; | ||
153 | u64 erp_action; | ||
154 | union { | ||
155 | struct { | ||
156 | u64 cmnd; | ||
157 | u32 data_dir; | ||
158 | } fcp; | ||
159 | struct { | ||
160 | u64 wwpn; | ||
161 | u32 d_id; | ||
162 | u32 port_handle; | ||
163 | } port; | ||
164 | struct { | ||
165 | u64 wwpn; | ||
166 | u64 fcp_lun; | ||
167 | u32 port_handle; | ||
168 | u32 lun_handle; | ||
169 | } unit; | ||
170 | struct { | ||
171 | u32 d_id; | ||
172 | } els; | ||
173 | } u; | ||
174 | } __attribute__ ((packed)); | ||
175 | 140 | ||
176 | struct zfcp_dbf_hba_record_status { | 141 | /** |
177 | u8 failed; | 142 | * struct zfcp_dbf_hba_uss - trace record for unsolicited status |
143 | * @status_type: type of unsolicited status | ||
144 | * @status_subtype: subtype of unsolicited status | ||
145 | * @d_id: destination ID | ||
146 | * @lun: logical unit number | ||
147 | * @queue_designator: queue designator | ||
148 | */ | ||
149 | struct zfcp_dbf_hba_uss { | ||
178 | u32 status_type; | 150 | u32 status_type; |
179 | u32 status_subtype; | 151 | u32 status_subtype; |
180 | struct fsf_queue_designator | 152 | u32 d_id; |
181 | queue_designator; | 153 | u64 lun; |
182 | u32 payload_size; | 154 | u64 queue_designator; |
183 | #define ZFCP_DBF_UNSOL_PAYLOAD 80 | 155 | } __packed; |
184 | #define ZFCP_DBF_UNSOL_PAYLOAD_SENSE_DATA_AVAIL 32 | ||
185 | #define ZFCP_DBF_UNSOL_PAYLOAD_BIT_ERROR_THRESHOLD 56 | ||
186 | #define ZFCP_DBF_UNSOL_PAYLOAD_FEATURE_UPDATE_ALERT 2 * sizeof(u32) | ||
187 | u8 payload[ZFCP_DBF_UNSOL_PAYLOAD]; | ||
188 | } __attribute__ ((packed)); | ||
189 | 156 | ||
190 | struct zfcp_dbf_hba_record_qdio { | 157 | /** |
191 | u32 qdio_error; | 158 | * enum zfcp_dbf_hba_id - HBA trace record identifier |
192 | u8 sbal_index; | 159 | * @ZFCP_DBF_HBA_RES: response trace record |
193 | u8 sbal_count; | 160 | * @ZFCP_DBF_HBA_USS: unsolicited status trace record |
194 | } __attribute__ ((packed)); | 161 | * @ZFCP_DBF_HBA_BIT: bit error trace record |
162 | */ | ||
163 | enum zfcp_dbf_hba_id { | ||
164 | ZFCP_DBF_HBA_RES = 1, | ||
165 | ZFCP_DBF_HBA_USS = 2, | ||
166 | ZFCP_DBF_HBA_BIT = 3, | ||
167 | }; | ||
195 | 168 | ||
196 | struct zfcp_dbf_hba_record { | 169 | /** |
197 | u8 tag[ZFCP_DBF_TAG_SIZE]; | 170 | * struct zfcp_dbf_hba - common trace record for HBA records |
198 | u8 tag2[ZFCP_DBF_TAG_SIZE]; | 171 | * @id: unique number of recovery record type |
172 | * @tag: identifier string specifying the location of initiation | ||
173 | * @fsf_req_id: request id for fsf requests | ||
174 | * @fsf_req_status: status of fsf request | ||
175 | * @fsf_cmd: fsf command | ||
176 | * @fsf_seq_no: fsf sequence number | ||
177 | * @pl_len: length of payload stored as zfcp_dbf_pay | ||
178 | * @u: record type specific data | ||
179 | */ | ||
180 | struct zfcp_dbf_hba { | ||
181 | u8 id; | ||
182 | char tag[ZFCP_DBF_TAG_LEN]; | ||
183 | u64 fsf_req_id; | ||
184 | u32 fsf_req_status; | ||
185 | u32 fsf_cmd; | ||
186 | u32 fsf_seq_no; | ||
187 | u16 pl_len; | ||
199 | union { | 188 | union { |
200 | struct zfcp_dbf_hba_record_response response; | 189 | struct zfcp_dbf_hba_res res; |
201 | struct zfcp_dbf_hba_record_status status; | 190 | struct zfcp_dbf_hba_uss uss; |
202 | struct zfcp_dbf_hba_record_qdio qdio; | 191 | struct fsf_bit_error_payload be; |
203 | struct fsf_bit_error_payload berr; | ||
204 | } u; | 192 | } u; |
205 | } __attribute__ ((packed)); | 193 | } __packed; |
194 | |||
195 | /** | ||
196 | * struct zfcp_dbf_pay - trace record for unformatted payload information | ||
197 | * @area: area this record is originated from | ||
198 | * @counter: ascending record number | ||
199 | * @fsf_req_id: request id of fsf request | ||
200 | * @data: unformatted data | ||
201 | */ | ||
202 | struct zfcp_dbf_pay { | ||
203 | char area[ZFCP_DBF_TAG_LEN]; | ||
204 | char counter; | ||
205 | u64 fsf_req_id; | ||
206 | #define ZFCP_DBF_PAY_MAX_REC 0x100 | ||
207 | char data[ZFCP_DBF_PAY_MAX_REC]; | ||
208 | } __packed; | ||
206 | 209 | ||
207 | struct zfcp_dbf_scsi_record { | 210 | struct zfcp_dbf_scsi_record { |
208 | u8 tag[ZFCP_DBF_TAG_SIZE]; | 211 | u8 tag[ZFCP_DBF_TAG_SIZE]; |
@@ -230,71 +233,57 @@ struct zfcp_dbf_scsi_record { | |||
230 | } __attribute__ ((packed)); | 233 | } __attribute__ ((packed)); |
231 | 234 | ||
232 | struct zfcp_dbf { | 235 | struct zfcp_dbf { |
236 | debug_info_t *pay; | ||
233 | debug_info_t *rec; | 237 | debug_info_t *rec; |
234 | debug_info_t *hba; | 238 | debug_info_t *hba; |
235 | debug_info_t *san; | 239 | debug_info_t *san; |
236 | debug_info_t *scsi; | 240 | debug_info_t *scsi; |
241 | spinlock_t pay_lock; | ||
237 | spinlock_t rec_lock; | 242 | spinlock_t rec_lock; |
238 | spinlock_t hba_lock; | 243 | spinlock_t hba_lock; |
239 | spinlock_t san_lock; | 244 | spinlock_t san_lock; |
240 | spinlock_t scsi_lock; | 245 | spinlock_t scsi_lock; |
241 | struct zfcp_dbf_rec rec_buf; | 246 | struct zfcp_dbf_rec rec_buf; |
242 | struct zfcp_dbf_hba_record hba_buf; | 247 | struct zfcp_dbf_hba hba_buf; |
243 | struct zfcp_dbf_san san_buf; | 248 | struct zfcp_dbf_san san_buf; |
244 | struct zfcp_dbf_scsi_record scsi_buf; | 249 | struct zfcp_dbf_scsi_record scsi_buf; |
250 | struct zfcp_dbf_pay pay_buf; | ||
245 | struct zfcp_adapter *adapter; | 251 | struct zfcp_adapter *adapter; |
246 | }; | 252 | }; |
247 | 253 | ||
248 | static inline | 254 | static inline |
249 | void zfcp_dbf_hba_fsf_resp(const char *tag2, int level, | 255 | void zfcp_dbf_hba_fsf_resp(char *tag, int level, struct zfcp_fsf_req *req) |
250 | struct zfcp_fsf_req *req, struct zfcp_dbf *dbf) | ||
251 | { | 256 | { |
252 | if (level <= dbf->hba->level) | 257 | if (level <= req->adapter->dbf->hba->level) |
253 | _zfcp_dbf_hba_fsf_response(tag2, level, req, dbf); | 258 | zfcp_dbf_hba_fsf_res(tag, req); |
254 | } | 259 | } |
255 | 260 | ||
256 | /** | 261 | /** |
257 | * zfcp_dbf_hba_fsf_response - trace event for request completion | 262 | * zfcp_dbf_hba_fsf_response - trace event for request completion |
258 | * @fsf_req: request that has been completed | 263 | * @fsf_req: request that has been completed |
259 | */ | 264 | */ |
260 | static inline void zfcp_dbf_hba_fsf_response(struct zfcp_fsf_req *req) | 265 | static inline |
266 | void zfcp_dbf_hba_fsf_response(struct zfcp_fsf_req *req) | ||
261 | { | 267 | { |
262 | struct zfcp_dbf *dbf = req->adapter->dbf; | ||
263 | struct fsf_qtcb *qtcb = req->qtcb; | 268 | struct fsf_qtcb *qtcb = req->qtcb; |
264 | 269 | ||
265 | if ((qtcb->prefix.prot_status != FSF_PROT_GOOD) && | 270 | if ((qtcb->prefix.prot_status != FSF_PROT_GOOD) && |
266 | (qtcb->prefix.prot_status != FSF_PROT_FSF_STATUS_PRESENTED)) { | 271 | (qtcb->prefix.prot_status != FSF_PROT_FSF_STATUS_PRESENTED)) { |
267 | zfcp_dbf_hba_fsf_resp("perr", 1, req, dbf); | 272 | zfcp_dbf_hba_fsf_resp("fs_perr", 1, req); |
268 | 273 | ||
269 | } else if (qtcb->header.fsf_status != FSF_GOOD) { | 274 | } else if (qtcb->header.fsf_status != FSF_GOOD) { |
270 | zfcp_dbf_hba_fsf_resp("ferr", 1, req, dbf); | 275 | zfcp_dbf_hba_fsf_resp("fs_ferr", 1, req); |
271 | 276 | ||
272 | } else if ((req->fsf_command == FSF_QTCB_OPEN_PORT_WITH_DID) || | 277 | } else if ((req->fsf_command == FSF_QTCB_OPEN_PORT_WITH_DID) || |
273 | (req->fsf_command == FSF_QTCB_OPEN_LUN)) { | 278 | (req->fsf_command == FSF_QTCB_OPEN_LUN)) { |
274 | zfcp_dbf_hba_fsf_resp("open", 4, req, dbf); | 279 | zfcp_dbf_hba_fsf_resp("fs_open", 4, req); |
275 | 280 | ||
276 | } else if (qtcb->header.log_length) { | 281 | } else if (qtcb->header.log_length) { |
277 | zfcp_dbf_hba_fsf_resp("qtcb", 5, req, dbf); | 282 | zfcp_dbf_hba_fsf_resp("fs_qtcb", 5, req); |
278 | 283 | ||
279 | } else { | 284 | } else { |
280 | zfcp_dbf_hba_fsf_resp("norm", 6, req, dbf); | 285 | zfcp_dbf_hba_fsf_resp("fs_norm", 6, req); |
281 | } | 286 | } |
282 | } | ||
283 | |||
284 | /** | ||
285 | * zfcp_dbf_hba_fsf_unsol - trace event for an unsolicited status buffer | ||
286 | * @tag: tag indicating which kind of unsolicited status has been received | ||
287 | * @dbf: reference to dbf structure | ||
288 | * @status_buffer: buffer containing payload of unsolicited status | ||
289 | */ | ||
290 | static inline | ||
291 | void zfcp_dbf_hba_fsf_unsol(const char *tag, struct zfcp_dbf *dbf, | ||
292 | struct fsf_status_read_buffer *buf) | ||
293 | { | ||
294 | int level = 2; | ||
295 | |||
296 | if (level <= dbf->hba->level) | ||
297 | _zfcp_dbf_hba_fsf_unsol(tag, level, dbf, buf); | ||
298 | } | 287 | } |
299 | 288 | ||
300 | static inline | 289 | static inline |