| .. | .. |
|---|
| 4 | 4 | * |
|---|
| 5 | 5 | * Debug traces for zfcp. |
|---|
| 6 | 6 | * |
|---|
| 7 | | - * Copyright IBM Corp. 2002, 2018 |
|---|
| 7 | + * Copyright IBM Corp. 2002, 2020 |
|---|
| 8 | 8 | */ |
|---|
| 9 | 9 | |
|---|
| 10 | 10 | #define KMSG_COMPONENT "zfcp" |
|---|
| .. | .. |
|---|
| 63 | 63 | |
|---|
| 64 | 64 | /** |
|---|
| 65 | 65 | * 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 |
|---|
| 67 | 68 | * @req: request for which a response was received |
|---|
| 68 | 69 | */ |
|---|
| 69 | 70 | void zfcp_dbf_hba_fsf_res(char *tag, int level, struct zfcp_fsf_req *req) |
|---|
| .. | .. |
|---|
| 81 | 82 | rec->id = ZFCP_DBF_HBA_RES; |
|---|
| 82 | 83 | rec->fsf_req_id = req->req_id; |
|---|
| 83 | 84 | 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; |
|---|
| 86 | 87 | rec->u.res.req_issued = req->issued; |
|---|
| 87 | 88 | rec->u.res.prot_status = q_pref->prot_status; |
|---|
| 88 | 89 | rec->u.res.fsf_status = q_head->fsf_status; |
|---|
| .. | .. |
|---|
| 97 | 98 | rec->pl_len = q_head->log_length; |
|---|
| 98 | 99 | zfcp_dbf_pl_write(dbf, (char *)q_pref + q_head->log_start, |
|---|
| 99 | 100 | 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; |
|---|
| 100 | 143 | |
|---|
| 101 | 144 | debug_event(dbf->hba, level, rec, sizeof(*rec)); |
|---|
| 102 | 145 | spin_unlock_irqrestore(&dbf->hba_lock, flags); |
|---|
| .. | .. |
|---|
| 125 | 168 | rec->id = ZFCP_DBF_HBA_USS; |
|---|
| 126 | 169 | rec->fsf_req_id = req->req_id; |
|---|
| 127 | 170 | rec->fsf_req_status = req->status; |
|---|
| 128 | | - rec->fsf_cmd = req->fsf_command; |
|---|
| 171 | + rec->fsf_cmd = FSF_QTCB_UNSOLICITED_STATUS; |
|---|
| 129 | 172 | |
|---|
| 130 | 173 | if (!srb) |
|---|
| 131 | 174 | goto log; |
|---|
| .. | .. |
|---|
| 151 | 194 | |
|---|
| 152 | 195 | /** |
|---|
| 153 | 196 | * 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 |
|---|
| 155 | 198 | * @req: request which caused the bit_error condition |
|---|
| 156 | 199 | */ |
|---|
| 157 | 200 | void zfcp_dbf_hba_bit_err(char *tag, struct zfcp_fsf_req *req) |
|---|
| .. | .. |
|---|
| 172 | 215 | rec->id = ZFCP_DBF_HBA_BIT; |
|---|
| 173 | 216 | rec->fsf_req_id = req->req_id; |
|---|
| 174 | 217 | rec->fsf_req_status = req->status; |
|---|
| 175 | | - rec->fsf_cmd = req->fsf_command; |
|---|
| 218 | + rec->fsf_cmd = FSF_QTCB_UNSOLICITED_STATUS; |
|---|
| 176 | 219 | memcpy(&rec->u.be, &sr_buf->payload.bit_error, |
|---|
| 177 | 220 | sizeof(struct fsf_bit_error_payload)); |
|---|
| 178 | 221 | |
|---|
| .. | .. |
|---|
| 222 | 265 | |
|---|
| 223 | 266 | /** |
|---|
| 224 | 267 | * zfcp_dbf_hba_basic - trace event for basic adapter events |
|---|
| 268 | + * @tag: identifier for event |
|---|
| 225 | 269 | * @adapter: pointer to struct zfcp_adapter |
|---|
| 226 | 270 | */ |
|---|
| 227 | 271 | void zfcp_dbf_hba_basic(char *tag, struct zfcp_adapter *adapter) |
|---|
| .. | .. |
|---|
| 355 | 399 | rec->u.run.fsf_req_id = erp->fsf_req_id; |
|---|
| 356 | 400 | rec->u.run.rec_status = erp->status; |
|---|
| 357 | 401 | rec->u.run.rec_step = erp->step; |
|---|
| 358 | | - rec->u.run.rec_action = erp->action; |
|---|
| 402 | + rec->u.run.rec_action = erp->type; |
|---|
| 359 | 403 | |
|---|
| 360 | 404 | if (erp->sdev) |
|---|
| 361 | 405 | rec->u.run.rec_count = |
|---|
| .. | .. |
|---|
| 476 | 520 | /** |
|---|
| 477 | 521 | * zfcp_dbf_san_req - trace event for issued SAN request |
|---|
| 478 | 522 | * @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 |
|---|
| 480 | 525 | * d_id: destination ID |
|---|
| 481 | 526 | */ |
|---|
| 482 | 527 | void zfcp_dbf_san_req(char *tag, struct zfcp_fsf_req *fsf, u32 d_id) |
|---|
| .. | .. |
|---|
| 558 | 603 | /** |
|---|
| 559 | 604 | * zfcp_dbf_san_res - trace event for received SAN request |
|---|
| 560 | 605 | * @tag: identifier for event |
|---|
| 561 | | - * @fsf_req: request containing issued CT data |
|---|
| 606 | + * @fsf: request containing received CT or ELS data |
|---|
| 562 | 607 | */ |
|---|
| 563 | 608 | void zfcp_dbf_san_res(char *tag, struct zfcp_fsf_req *fsf) |
|---|
| 564 | 609 | { |
|---|
| .. | .. |
|---|
| 578 | 623 | /** |
|---|
| 579 | 624 | * zfcp_dbf_san_in_els - trace event for incoming ELS |
|---|
| 580 | 625 | * @tag: identifier for event |
|---|
| 581 | | - * @fsf_req: request containing issued CT data |
|---|
| 626 | + * @fsf: request containing received ELS data |
|---|
| 582 | 627 | */ |
|---|
| 583 | 628 | void zfcp_dbf_san_in_els(char *tag, struct zfcp_fsf_req *fsf) |
|---|
| 584 | 629 | { |
|---|