Skip to content

Commit d27a7cb

Browse files
steffen-maiermartinkpetersen
authored andcommitted
zfcp: trace on request for open and close of WKA port
Since commit a54ca0f ("[SCSI] zfcp: Redesign of the debug tracing for HBA records.") HBA records no longer contain WWPN, D_ID, or LUN to reduce duplicate information which is already in REC records. In contrast to "regular" target ports, we don't use recovery to open WKA ports such as directory/nameserver, so we don't get REC records. Therefore, introduce pseudo REC running records without any actual recovery action but including D_ID of WKA port on open/close. Signed-off-by: Steffen Maier <[email protected]> Fixes: a54ca0f ("[SCSI] zfcp: Redesign of the debug tracing for HBA records.") Cc: <[email protected]> #2.6.38+ Reviewed-by: Benjamin Block <[email protected]> Reviewed-by: Hannes Reinecke <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
1 parent 0102a30 commit d27a7cb

File tree

3 files changed

+39
-2
lines changed

3 files changed

+39
-2
lines changed

drivers/s390/scsi/zfcp_dbf.c

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -321,6 +321,38 @@ void zfcp_dbf_rec_run(char *tag, struct zfcp_erp_action *erp)
321321
spin_unlock_irqrestore(&dbf->rec_lock, flags);
322322
}
323323

324+
/**
325+
* zfcp_dbf_rec_run_wka - trace wka port event with info like running recovery
326+
* @tag: identifier for event
327+
* @wka_port: well known address port
328+
* @req_id: request ID to correlate with potential HBA trace record
329+
*/
330+
void zfcp_dbf_rec_run_wka(char *tag, struct zfcp_fc_wka_port *wka_port,
331+
u64 req_id)
332+
{
333+
struct zfcp_dbf *dbf = wka_port->adapter->dbf;
334+
struct zfcp_dbf_rec *rec = &dbf->rec_buf;
335+
unsigned long flags;
336+
337+
spin_lock_irqsave(&dbf->rec_lock, flags);
338+
memset(rec, 0, sizeof(*rec));
339+
340+
rec->id = ZFCP_DBF_REC_RUN;
341+
memcpy(rec->tag, tag, ZFCP_DBF_TAG_LEN);
342+
rec->port_status = wka_port->status;
343+
rec->d_id = wka_port->d_id;
344+
rec->lun = ZFCP_DBF_INVALID_LUN;
345+
346+
rec->u.run.fsf_req_id = req_id;
347+
rec->u.run.rec_status = ~0;
348+
rec->u.run.rec_step = ~0;
349+
rec->u.run.rec_action = ~0;
350+
rec->u.run.rec_count = ~0;
351+
352+
debug_event(dbf->rec, 1, rec, sizeof(*rec));
353+
spin_unlock_irqrestore(&dbf->rec_lock, flags);
354+
}
355+
324356
static inline
325357
void zfcp_dbf_san(char *tag, struct zfcp_dbf *dbf, void *data, u8 id, u16 len,
326358
u64 req_id, u32 d_id)

drivers/s390/scsi/zfcp_ext.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ extern void zfcp_dbf_adapter_unregister(struct zfcp_adapter *);
3535
extern void zfcp_dbf_rec_trig(char *, struct zfcp_adapter *,
3636
struct zfcp_port *, struct scsi_device *, u8, u8);
3737
extern void zfcp_dbf_rec_run(char *, struct zfcp_erp_action *);
38+
extern void zfcp_dbf_rec_run_wka(char *, struct zfcp_fc_wka_port *, u64);
3839
extern void zfcp_dbf_hba_fsf_uss(char *, struct zfcp_fsf_req *);
3940
extern void zfcp_dbf_hba_fsf_res(char *, int, struct zfcp_fsf_req *);
4041
extern void zfcp_dbf_hba_bit_err(char *, struct zfcp_fsf_req *);

drivers/s390/scsi/zfcp_fsf.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1581,7 +1581,7 @@ static void zfcp_fsf_open_wka_port_handler(struct zfcp_fsf_req *req)
15811581
int zfcp_fsf_open_wka_port(struct zfcp_fc_wka_port *wka_port)
15821582
{
15831583
struct zfcp_qdio *qdio = wka_port->adapter->qdio;
1584-
struct zfcp_fsf_req *req;
1584+
struct zfcp_fsf_req *req = NULL;
15851585
int retval = -EIO;
15861586

15871587
spin_lock_irq(&qdio->req_q_lock);
@@ -1610,6 +1610,8 @@ int zfcp_fsf_open_wka_port(struct zfcp_fc_wka_port *wka_port)
16101610
zfcp_fsf_req_free(req);
16111611
out:
16121612
spin_unlock_irq(&qdio->req_q_lock);
1613+
if (req && !IS_ERR(req))
1614+
zfcp_dbf_rec_run_wka("fsowp_1", wka_port, req->req_id);
16131615
return retval;
16141616
}
16151617

@@ -1634,7 +1636,7 @@ static void zfcp_fsf_close_wka_port_handler(struct zfcp_fsf_req *req)
16341636
int zfcp_fsf_close_wka_port(struct zfcp_fc_wka_port *wka_port)
16351637
{
16361638
struct zfcp_qdio *qdio = wka_port->adapter->qdio;
1637-
struct zfcp_fsf_req *req;
1639+
struct zfcp_fsf_req *req = NULL;
16381640
int retval = -EIO;
16391641

16401642
spin_lock_irq(&qdio->req_q_lock);
@@ -1663,6 +1665,8 @@ int zfcp_fsf_close_wka_port(struct zfcp_fc_wka_port *wka_port)
16631665
zfcp_fsf_req_free(req);
16641666
out:
16651667
spin_unlock_irq(&qdio->req_q_lock);
1668+
if (req && !IS_ERR(req))
1669+
zfcp_dbf_rec_run_wka("fscwp_1", wka_port, req->req_id);
16661670
return retval;
16671671
}
16681672

0 commit comments

Comments
 (0)