hc
2024-01-03 2f7c68cb55ecb7331f2381deb497c27155f32faf
kernel/drivers/s390/scsi/zfcp_dbf.c
....@@ -4,7 +4,7 @@
44 *
55 * Debug traces for zfcp.
66 *
7
- * Copyright IBM Corp. 2002, 2018
7
+ * Copyright IBM Corp. 2002, 2020
88 */
99
1010 #define KMSG_COMPONENT "zfcp"
....@@ -63,7 +63,8 @@
6363
6464 /**
6565 * zfcp_dbf_hba_fsf_res - trace event for fsf responses
66
- * @tag: tag indicating which kind of unsolicited status has been received
66
+ * @tag: tag indicating which kind of FSF response has been received
67
+ * @level: trace level to be used for event
6768 * @req: request for which a response was received
6869 */
6970 void zfcp_dbf_hba_fsf_res(char *tag, int level, struct zfcp_fsf_req *req)
....@@ -81,8 +82,8 @@
8182 rec->id = ZFCP_DBF_HBA_RES;
8283 rec->fsf_req_id = req->req_id;
8384 rec->fsf_req_status = req->status;
84
- rec->fsf_cmd = req->fsf_command;
85
- rec->fsf_seq_no = req->seq_no;
85
+ rec->fsf_cmd = q_head->fsf_command;
86
+ rec->fsf_seq_no = q_pref->req_seq_no;
8687 rec->u.res.req_issued = req->issued;
8788 rec->u.res.prot_status = q_pref->prot_status;
8889 rec->u.res.fsf_status = q_head->fsf_status;
....@@ -97,6 +98,48 @@
9798 rec->pl_len = q_head->log_length;
9899 zfcp_dbf_pl_write(dbf, (char *)q_pref + q_head->log_start,
99100 rec->pl_len, "fsf_res", req->req_id);
101
+
102
+ debug_event(dbf->hba, level, rec, sizeof(*rec));
103
+ spin_unlock_irqrestore(&dbf->hba_lock, flags);
104
+}
105
+
106
+/**
107
+ * zfcp_dbf_hba_fsf_fces - trace event for fsf responses related to
108
+ * FC Endpoint Security (FCES)
109
+ * @tag: tag indicating which kind of FC Endpoint Security event has occurred
110
+ * @req: request for which a response was received
111
+ * @wwpn: remote port or ZFCP_DBF_INVALID_WWPN
112
+ * @fc_security_old: old FC Endpoint Security of FCP device or connection
113
+ * @fc_security_new: new FC Endpoint Security of FCP device or connection
114
+ */
115
+void zfcp_dbf_hba_fsf_fces(char *tag, const struct zfcp_fsf_req *req, u64 wwpn,
116
+ u32 fc_security_old, u32 fc_security_new)
117
+{
118
+ struct zfcp_dbf *dbf = req->adapter->dbf;
119
+ struct fsf_qtcb_prefix *q_pref = &req->qtcb->prefix;
120
+ struct fsf_qtcb_header *q_head = &req->qtcb->header;
121
+ struct zfcp_dbf_hba *rec = &dbf->hba_buf;
122
+ static int const level = 3;
123
+ unsigned long flags;
124
+
125
+ if (unlikely(!debug_level_enabled(dbf->hba, level)))
126
+ return;
127
+
128
+ spin_lock_irqsave(&dbf->hba_lock, flags);
129
+ memset(rec, 0, sizeof(*rec));
130
+
131
+ memcpy(rec->tag, tag, ZFCP_DBF_TAG_LEN);
132
+ rec->id = ZFCP_DBF_HBA_FCES;
133
+ rec->fsf_req_id = req->req_id;
134
+ rec->fsf_req_status = req->status;
135
+ rec->fsf_cmd = q_head->fsf_command;
136
+ rec->fsf_seq_no = q_pref->req_seq_no;
137
+ rec->u.fces.req_issued = req->issued;
138
+ rec->u.fces.fsf_status = q_head->fsf_status;
139
+ rec->u.fces.port_handle = q_head->port_handle;
140
+ rec->u.fces.wwpn = wwpn;
141
+ rec->u.fces.fc_security_old = fc_security_old;
142
+ rec->u.fces.fc_security_new = fc_security_new;
100143
101144 debug_event(dbf->hba, level, rec, sizeof(*rec));
102145 spin_unlock_irqrestore(&dbf->hba_lock, flags);
....@@ -125,7 +168,7 @@
125168 rec->id = ZFCP_DBF_HBA_USS;
126169 rec->fsf_req_id = req->req_id;
127170 rec->fsf_req_status = req->status;
128
- rec->fsf_cmd = req->fsf_command;
171
+ rec->fsf_cmd = FSF_QTCB_UNSOLICITED_STATUS;
129172
130173 if (!srb)
131174 goto log;
....@@ -151,7 +194,7 @@
151194
152195 /**
153196 * zfcp_dbf_hba_bit_err - trace event for bit error conditions
154
- * @tag: tag indicating which kind of unsolicited status has been received
197
+ * @tag: tag indicating which kind of bit error unsolicited status was received
155198 * @req: request which caused the bit_error condition
156199 */
157200 void zfcp_dbf_hba_bit_err(char *tag, struct zfcp_fsf_req *req)
....@@ -172,7 +215,7 @@
172215 rec->id = ZFCP_DBF_HBA_BIT;
173216 rec->fsf_req_id = req->req_id;
174217 rec->fsf_req_status = req->status;
175
- rec->fsf_cmd = req->fsf_command;
218
+ rec->fsf_cmd = FSF_QTCB_UNSOLICITED_STATUS;
176219 memcpy(&rec->u.be, &sr_buf->payload.bit_error,
177220 sizeof(struct fsf_bit_error_payload));
178221
....@@ -222,6 +265,7 @@
222265
223266 /**
224267 * zfcp_dbf_hba_basic - trace event for basic adapter events
268
+ * @tag: identifier for event
225269 * @adapter: pointer to struct zfcp_adapter
226270 */
227271 void zfcp_dbf_hba_basic(char *tag, struct zfcp_adapter *adapter)
....@@ -355,7 +399,7 @@
355399 rec->u.run.fsf_req_id = erp->fsf_req_id;
356400 rec->u.run.rec_status = erp->status;
357401 rec->u.run.rec_step = erp->step;
358
- rec->u.run.rec_action = erp->action;
402
+ rec->u.run.rec_action = erp->type;
359403
360404 if (erp->sdev)
361405 rec->u.run.rec_count =
....@@ -476,7 +520,8 @@
476520 /**
477521 * zfcp_dbf_san_req - trace event for issued SAN request
478522 * @tag: identifier for event
479
- * @fsf_req: request containing issued CT data
523
+ * @fsf: request containing issued CT or ELS data
524
+ * @d_id: N_Port_ID where SAN request is sent to
480525 * d_id: destination ID
481526 */
482527 void zfcp_dbf_san_req(char *tag, struct zfcp_fsf_req *fsf, u32 d_id)
....@@ -558,7 +603,7 @@
558603 /**
559604 * zfcp_dbf_san_res - trace event for received SAN request
560605 * @tag: identifier for event
561
- * @fsf_req: request containing issued CT data
606
+ * @fsf: request containing received CT or ELS data
562607 */
563608 void zfcp_dbf_san_res(char *tag, struct zfcp_fsf_req *fsf)
564609 {
....@@ -578,7 +623,7 @@
578623 /**
579624 * zfcp_dbf_san_in_els - trace event for incoming ELS
580625 * @tag: identifier for event
581
- * @fsf_req: request containing issued CT data
626
+ * @fsf: request containing received ELS data
582627 */
583628 void zfcp_dbf_san_in_els(char *tag, struct zfcp_fsf_req *fsf)
584629 {