aboutsummaryrefslogtreecommitdiffstats
path: root/include/scsi
diff options
context:
space:
mode:
authorJoe Eykholt <jeykholt@cisco.com>2009-07-29 20:04:12 -0400
committerJames Bottomley <James.Bottomley@suse.de>2009-08-22 18:52:03 -0400
commit7f74549ff630ad444b0b6bbcabf426f781910906 (patch)
tree37e0a61a3cb43cd55799bb3b5bbb98cba215eee3 /include/scsi
parentbeb29a6d421f6dbd41d68d0621c1b28ad1d4a9f4 (diff)
[SCSI] libfc: change debug messages to give host number.
libfc debug messages currently show 'lport: <fc-id>:' wher <fc-id> is the hex assigned port-id. When the lport is logged off, that will be zero, so its hard to distinguish which instance is involved. The FC-ID can change if the port is re-patched or changes VSANs. Two lports may even have the same FC-ID if connected to isolated SANs. Change the debug messages to print the SCSI host number "hostN:", which will not change for the life of the lport. Still show the FC_ID on lport messages. Also, add a macro to FC_RPORT_ID_DBG for rport debugging where there's no rdata structure involved. It takes the lport and port_id as parameters. Use this in fc_rport_recv_plogi_req() and fc_rport_recv_logo_req(). Signed-off-by: Joe Eykholt <jeykholt@cisco.com> Signed-off-by: Robert Love <robert.w.love@intel.com> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Diffstat (limited to 'include/scsi')
-rw-r--r--include/scsi/libfc.h36
1 files changed, 20 insertions, 16 deletions
diff --git a/include/scsi/libfc.h b/include/scsi/libfc.h
index ef04a2c52b8..efdb6ba310e 100644
--- a/include/scsi/libfc.h
+++ b/include/scsi/libfc.h
@@ -59,47 +59,51 @@ do { \
59 59
60#define FC_LPORT_DBG(lport, fmt, args...) \ 60#define FC_LPORT_DBG(lport, fmt, args...) \
61 FC_CHECK_LOGGING(FC_LPORT_LOGGING, \ 61 FC_CHECK_LOGGING(FC_LPORT_LOGGING, \
62 printk(KERN_INFO "lport: %6x: " fmt, \ 62 printk(KERN_INFO "host%u: lport %6x: " fmt, \
63 fc_host_port_id(lport->host), ##args)) 63 (lport)->host->host_no, \
64 fc_host_port_id((lport)->host), ##args))
64 65
65#define FC_DISC_DBG(disc, fmt, args...) \ 66#define FC_DISC_DBG(disc, fmt, args...) \
66 FC_CHECK_LOGGING(FC_DISC_LOGGING, \ 67 FC_CHECK_LOGGING(FC_DISC_LOGGING, \
67 printk(KERN_INFO "disc: %6x: " fmt, \ 68 printk(KERN_INFO "host%u: disc: " fmt, \
68 fc_host_port_id(disc->lport->host), \ 69 (disc)->lport->host->host_no, \
69 ##args)) 70 ##args))
70 71
72#define FC_RPORT_ID_DBG(lport, port_id, fmt, args...) \
73 FC_CHECK_LOGGING(FC_RPORT_LOGGING, \
74 printk(KERN_INFO "host%u: rport %6x: " fmt, \
75 (lport)->host->host_no, \
76 (port_id), ##args))
77
71#define FC_RPORT_DBG(rport, fmt, args...) \ 78#define FC_RPORT_DBG(rport, fmt, args...) \
72do { \ 79do { \
73 struct fc_rport_libfc_priv *rdata = rport->dd_data; \ 80 struct fc_rport_libfc_priv *rdata = rport->dd_data; \
74 struct fc_lport *lport = rdata->local_port; \ 81 struct fc_lport *lport = rdata->local_port; \
75 FC_CHECK_LOGGING(FC_RPORT_LOGGING, \ 82 FC_RPORT_ID_DBG(lport, rport->port_id, fmt, ##args); \
76 printk(KERN_INFO "rport: %6x: %6x: " fmt, \
77 fc_host_port_id(lport->host), \
78 rport->port_id, ##args)); \
79} while (0) 83} while (0)
80 84
81#define FC_FCP_DBG(pkt, fmt, args...) \ 85#define FC_FCP_DBG(pkt, fmt, args...) \
82 FC_CHECK_LOGGING(FC_FCP_LOGGING, \ 86 FC_CHECK_LOGGING(FC_FCP_LOGGING, \
83 printk(KERN_INFO "fcp: %6x: %6x: " fmt, \ 87 printk(KERN_INFO "host%u: fcp: %6x: " fmt, \
84 fc_host_port_id(pkt->lp->host), \ 88 (pkt)->lp->host->host_no, \
85 pkt->rport->port_id, ##args)) 89 pkt->rport->port_id, ##args))
86 90
87#define FC_EM_DBG(em, fmt, args...) \ 91#define FC_EM_DBG(em, fmt, args...) \
88 FC_CHECK_LOGGING(FC_EM_LOGGING, \ 92 FC_CHECK_LOGGING(FC_EM_LOGGING, \
89 printk(KERN_INFO "em: %6x: " fmt, \ 93 printk(KERN_INFO "host%u: em: " fmt, \
90 fc_host_port_id(em->lp->host), \ 94 (em)->lp->host->host_no, \
91 ##args)) 95 ##args))
92 96
93#define FC_EXCH_DBG(exch, fmt, args...) \ 97#define FC_EXCH_DBG(exch, fmt, args...) \
94 FC_CHECK_LOGGING(FC_EXCH_LOGGING, \ 98 FC_CHECK_LOGGING(FC_EXCH_LOGGING, \
95 printk(KERN_INFO "exch: %6x: %4x: " fmt, \ 99 printk(KERN_INFO "host%u: xid %4x: " fmt, \
96 fc_host_port_id(exch->lp->host), \ 100 (exch)->lp->host->host_no, \
97 exch->xid, ##args)) 101 exch->xid, ##args))
98 102
99#define FC_SCSI_DBG(lport, fmt, args...) \ 103#define FC_SCSI_DBG(lport, fmt, args...) \
100 FC_CHECK_LOGGING(FC_SCSI_LOGGING, \ 104 FC_CHECK_LOGGING(FC_SCSI_LOGGING, \
101 printk(KERN_INFO "scsi: %6x: " fmt, \ 105 printk(KERN_INFO "host%u: scsi: " fmt, \
102 fc_host_port_id(lport->host), ##args)) 106 (lport)->host->host_no, ##args))
103 107
104/* 108/*
105 * libfc error codes 109 * libfc error codes