Commit e8b62011 authored by James Smart's avatar James Smart Committed by James Bottomley

[SCSI] lpfc 8.2.2 : Rework the lpfc_printf_log() macro

Rework the lpfc_printf_log() macro so that logging is enabled on a
per-vport basis. Used to be on a physical-port basis, thus logging
with large numbers of vports became a mess.  Required redefinition of
the macro, and an update of every use.
Signed-off-by: default avatarJames Smart <James.Smart@emulex.com>
Signed-off-by: default avatarJames Bottomley <James.Bottomley@SteelEye.com>
parent 3de2a653
...@@ -349,6 +349,7 @@ struct lpfc_vport { ...@@ -349,6 +349,7 @@ struct lpfc_vport {
uint32_t cfg_use_adisc; uint32_t cfg_use_adisc;
uint32_t cfg_fdmi_on; uint32_t cfg_fdmi_on;
uint32_t cfg_discovery_threads; uint32_t cfg_discovery_threads;
uint32_t cfg_log_verbose;
uint32_t cfg_max_luns; uint32_t cfg_max_luns;
uint32_t dev_loss_tmo_changed; uint32_t dev_loss_tmo_changed;
...@@ -446,8 +447,6 @@ struct lpfc_hba { ...@@ -446,8 +447,6 @@ struct lpfc_hba {
uint64_t cfg_soft_wwpn; uint64_t cfg_soft_wwpn;
uint32_t cfg_hba_queue_depth; uint32_t cfg_hba_queue_depth;
/* Config paramters that should be in the vport */
uint32_t cfg_log_verbose;
lpfc_vpd_t vpd; /* vital product data */ lpfc_vpd_t vpd; /* vital product data */
......
...@@ -319,9 +319,8 @@ lpfc_do_offline(struct lpfc_hba *phba, uint32_t type) ...@@ -319,9 +319,8 @@ lpfc_do_offline(struct lpfc_hba *phba, uint32_t type)
if (cnt++ > 3000) { if (cnt++ > 3000) {
lpfc_printf_log(phba, lpfc_printf_log(phba,
KERN_WARNING, LOG_INIT, KERN_WARNING, LOG_INIT,
"%d:0466 Outstanding IO when " "0466 Outstanding IO when "
"bringing Adapter offline\n", "bringing Adapter offline\n");
phba->brd_no);
break; break;
} }
} }
...@@ -694,9 +693,8 @@ lpfc_##attr##_init(struct lpfc_hba *phba, int val) \ ...@@ -694,9 +693,8 @@ lpfc_##attr##_init(struct lpfc_hba *phba, int val) \
return 0;\ return 0;\
}\ }\
lpfc_printf_log(phba, KERN_ERR, LOG_INIT, \ lpfc_printf_log(phba, KERN_ERR, LOG_INIT, \
"%d:0449 lpfc_"#attr" attribute cannot be set to %d, "\ "0449 lpfc_"#attr" attribute cannot be set to %d, "\
"allowed range is ["#minval", "#maxval"]\n", \ "allowed range is ["#minval", "#maxval"]\n", val); \
phba->brd_no, val); \
phba->cfg_##attr = default;\ phba->cfg_##attr = default;\
return -EINVAL;\ return -EINVAL;\
} }
...@@ -710,9 +708,8 @@ lpfc_##attr##_set(struct lpfc_hba *phba, int val) \ ...@@ -710,9 +708,8 @@ lpfc_##attr##_set(struct lpfc_hba *phba, int val) \
return 0;\ return 0;\
}\ }\
lpfc_printf_log(phba, KERN_ERR, LOG_INIT, \ lpfc_printf_log(phba, KERN_ERR, LOG_INIT, \
"%d:0450 lpfc_"#attr" attribute cannot be set to %d, "\ "0450 lpfc_"#attr" attribute cannot be set to %d, "\
"allowed range is ["#minval", "#maxval"]\n", \ "allowed range is ["#minval", "#maxval"]\n", val); \
phba->brd_no, val); \
return -EINVAL;\ return -EINVAL;\
} }
...@@ -764,10 +761,9 @@ lpfc_##attr##_init(struct lpfc_vport *vport, int val) \ ...@@ -764,10 +761,9 @@ lpfc_##attr##_init(struct lpfc_vport *vport, int val) \
vport->cfg_##attr = val;\ vport->cfg_##attr = val;\
return 0;\ return 0;\
}\ }\
lpfc_printf_log(vport->phba, KERN_ERR, LOG_INIT, \ lpfc_printf_vlog(vport, KERN_ERR, LOG_INIT, \
"%d:0449 lpfc_"#attr" attribute cannot be set to %d, "\ "0449 lpfc_"#attr" attribute cannot be set to %d, "\
"allowed range is ["#minval", "#maxval"]\n", \ "allowed range is ["#minval", "#maxval"]\n", val); \
vport->phba->brd_no, val); \
vport->cfg_##attr = default;\ vport->cfg_##attr = default;\
return -EINVAL;\ return -EINVAL;\
} }
...@@ -780,10 +776,9 @@ lpfc_##attr##_set(struct lpfc_vport *vport, int val) \ ...@@ -780,10 +776,9 @@ lpfc_##attr##_set(struct lpfc_vport *vport, int val) \
vport->cfg_##attr = val;\ vport->cfg_##attr = val;\
return 0;\ return 0;\
}\ }\
lpfc_printf_log(vport->phba, KERN_ERR, LOG_INIT, \ lpfc_printf_vlog(vport, KERN_ERR, LOG_INIT, \
"%d:0450 lpfc_"#attr" attribute cannot be set to %d, "\ "0450 lpfc_"#attr" attribute cannot be set to %d, "\
"allowed range is ["#minval", "#maxval"]\n", \ "allowed range is ["#minval", "#maxval"]\n", val); \
vport->phba->brd_no, val); \
return -EINVAL;\ return -EINVAL;\
} }
...@@ -1023,17 +1018,15 @@ lpfc_soft_wwpn_store(struct class_device *cdev, const char *buf, size_t count) ...@@ -1023,17 +1018,15 @@ lpfc_soft_wwpn_store(struct class_device *cdev, const char *buf, size_t count)
stat1 = lpfc_do_offline(phba, LPFC_EVT_OFFLINE); stat1 = lpfc_do_offline(phba, LPFC_EVT_OFFLINE);
if (stat1) if (stat1)
lpfc_printf_log(phba, KERN_ERR, LOG_INIT, lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
"%d:0463 lpfc_soft_wwpn attribute set failed to reinit " "0463 lpfc_soft_wwpn attribute set failed to "
"adapter - %d\n", phba->brd_no, stat1); "reinit adapter - %d\n", stat1);
init_completion(&online_compl); init_completion(&online_compl);
lpfc_workq_post_event(phba, &stat2, &online_compl, LPFC_EVT_ONLINE); lpfc_workq_post_event(phba, &stat2, &online_compl, LPFC_EVT_ONLINE);
wait_for_completion(&online_compl); wait_for_completion(&online_compl);
if (stat2) if (stat2)
lpfc_printf_log(phba, KERN_ERR, LOG_INIT, lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
"%d:0464 lpfc_soft_wwpn attribute set failed to reinit " "0464 lpfc_soft_wwpn attribute set failed to "
"adapter - %d\n", phba->brd_no, stat2); "reinit adapter - %d\n", stat2);
return (stat1 || stat2) ? -EIO : count; return (stat1 || stat2) ? -EIO : count;
} }
static CLASS_DEVICE_ATTR(lpfc_soft_wwpn, S_IRUGO | S_IWUSR,\ static CLASS_DEVICE_ATTR(lpfc_soft_wwpn, S_IRUGO | S_IWUSR,\
...@@ -1145,11 +1138,10 @@ lpfc_nodev_tmo_init(struct lpfc_vport *vport, int val) ...@@ -1145,11 +1138,10 @@ lpfc_nodev_tmo_init(struct lpfc_vport *vport, int val)
if (vport->cfg_devloss_tmo != LPFC_DEF_DEVLOSS_TMO) { if (vport->cfg_devloss_tmo != LPFC_DEF_DEVLOSS_TMO) {
vport->cfg_nodev_tmo = vport->cfg_devloss_tmo; vport->cfg_nodev_tmo = vport->cfg_devloss_tmo;
if (val != LPFC_DEF_DEVLOSS_TMO) if (val != LPFC_DEF_DEVLOSS_TMO)
lpfc_printf_log(vport->phba, KERN_ERR, LOG_INIT, lpfc_printf_vlog(vport, KERN_ERR, LOG_INIT,
"%d (%d):0402 Ignoring nodev_tmo module" "0402 Ignoring nodev_tmo module "
" parameter because devloss_tmo is" "parameter because devloss_tmo is "
" set.\n", "set.\n");
vport->phba->brd_no, vport->vpi);
return 0; return 0;
} }
...@@ -1158,11 +1150,10 @@ lpfc_nodev_tmo_init(struct lpfc_vport *vport, int val) ...@@ -1158,11 +1150,10 @@ lpfc_nodev_tmo_init(struct lpfc_vport *vport, int val)
vport->cfg_devloss_tmo = val; vport->cfg_devloss_tmo = val;
return 0; return 0;
} }
lpfc_printf_log(vport->phba, KERN_ERR, LOG_INIT, lpfc_printf_vlog(vport, KERN_ERR, LOG_INIT,
"%d (%d):0400 lpfc_nodev_tmo attribute cannot be set to" "0400 lpfc_nodev_tmo attribute cannot be set to"
" %d, allowed range is [%d, %d]\n", " %d, allowed range is [%d, %d]\n",
vport->phba->brd_no, vport->vpi, val, val, LPFC_MIN_DEVLOSS_TMO, LPFC_MAX_DEVLOSS_TMO);
LPFC_MIN_DEVLOSS_TMO, LPFC_MAX_DEVLOSS_TMO);
vport->cfg_nodev_tmo = LPFC_DEF_DEVLOSS_TMO; vport->cfg_nodev_tmo = LPFC_DEF_DEVLOSS_TMO;
return -EINVAL; return -EINVAL;
} }
...@@ -1195,10 +1186,9 @@ lpfc_nodev_tmo_set(struct lpfc_vport *vport, int val) ...@@ -1195,10 +1186,9 @@ lpfc_nodev_tmo_set(struct lpfc_vport *vport, int val)
{ {
if (vport->dev_loss_tmo_changed || if (vport->dev_loss_tmo_changed ||
(lpfc_devloss_tmo != LPFC_DEF_DEVLOSS_TMO)) { (lpfc_devloss_tmo != LPFC_DEF_DEVLOSS_TMO)) {
lpfc_printf_log(vport->phba, KERN_ERR, LOG_INIT, lpfc_printf_vlog(vport, KERN_ERR, LOG_INIT,
"%d (%d):0401 Ignoring change to nodev_tmo " "0401 Ignoring change to nodev_tmo "
"because devloss_tmo is set.\n", "because devloss_tmo is set.\n");
vport->phba->brd_no, vport->vpi);
return 0; return 0;
} }
if (val >= LPFC_MIN_DEVLOSS_TMO && val <= LPFC_MAX_DEVLOSS_TMO) { if (val >= LPFC_MIN_DEVLOSS_TMO && val <= LPFC_MAX_DEVLOSS_TMO) {
...@@ -1207,11 +1197,10 @@ lpfc_nodev_tmo_set(struct lpfc_vport *vport, int val) ...@@ -1207,11 +1197,10 @@ lpfc_nodev_tmo_set(struct lpfc_vport *vport, int val)
lpfc_update_rport_devloss_tmo(vport); lpfc_update_rport_devloss_tmo(vport);
return 0; return 0;
} }
lpfc_printf_log(vport->phba, KERN_ERR, LOG_INIT, lpfc_printf_vlog(vport, KERN_ERR, LOG_INIT,
"%d (%d):0403 lpfc_nodev_tmo attribute cannot be set to" "0403 lpfc_nodev_tmo attribute cannot be set to"
"%d, allowed range is [%d, %d]\n", "%d, allowed range is [%d, %d]\n",
vport->phba->brd_no, vport->vpi, val, val, LPFC_MIN_DEVLOSS_TMO, LPFC_MAX_DEVLOSS_TMO);
LPFC_MIN_DEVLOSS_TMO, LPFC_MAX_DEVLOSS_TMO);
return -EINVAL; return -EINVAL;
} }
...@@ -1243,11 +1232,10 @@ lpfc_devloss_tmo_set(struct lpfc_vport *vport, int val) ...@@ -1243,11 +1232,10 @@ lpfc_devloss_tmo_set(struct lpfc_vport *vport, int val)
return 0; return 0;
} }
lpfc_printf_log(vport->phba, KERN_ERR, LOG_INIT, lpfc_printf_vlog(vport, KERN_ERR, LOG_INIT,
"%d:0404 lpfc_devloss_tmo attribute cannot be set to" "0404 lpfc_devloss_tmo attribute cannot be set to"
" %d, allowed range is [%d, %d]\n", " %d, allowed range is [%d, %d]\n",
vport->phba->brd_no, val, LPFC_MIN_DEVLOSS_TMO, val, LPFC_MIN_DEVLOSS_TMO, LPFC_MAX_DEVLOSS_TMO);
LPFC_MAX_DEVLOSS_TMO);
return -EINVAL; return -EINVAL;
} }
...@@ -1273,7 +1261,8 @@ static CLASS_DEVICE_ATTR(lpfc_devloss_tmo, S_IRUGO | S_IWUSR, ...@@ -1273,7 +1261,8 @@ static CLASS_DEVICE_ATTR(lpfc_devloss_tmo, S_IRUGO | S_IWUSR,
# LOG_LIBDFC 0x2000 LIBDFC events # LOG_LIBDFC 0x2000 LIBDFC events
# LOG_ALL_MSG 0xffff LOG all messages # LOG_ALL_MSG 0xffff LOG all messages
*/ */
LPFC_ATTR_HEX_RW(log_verbose, 0x0, 0x0, 0xffff, "Verbose logging bit-mask"); LPFC_VPORT_ATTR_HEX_RW(log_verbose, 0x0, 0x0, 0xffff,
"Verbose logging bit-mask");
/* /*
# lun_queue_depth: This parameter is used to limit the number of outstanding # lun_queue_depth: This parameter is used to limit the number of outstanding
...@@ -1326,10 +1315,10 @@ static int ...@@ -1326,10 +1315,10 @@ static int
lpfc_restrict_login_init(struct lpfc_vport *vport, int val) lpfc_restrict_login_init(struct lpfc_vport *vport, int val)
{ {
if (val < 0 || val > 1) { if (val < 0 || val > 1) {
lpfc_printf_log(vport->phba, KERN_ERR, LOG_INIT, lpfc_printf_vlog(vport, KERN_ERR, LOG_INIT,
"%d:0449 lpfc_restrict_login attribute cannot " "0449 lpfc_restrict_login attribute cannot "
"be set to %d, allowed range is [0, 1]\n", "be set to %d, allowed range is [0, 1]\n",
vport->phba->brd_no, val); val);
vport->cfg_restrict_login = 1; vport->cfg_restrict_login = 1;
return -EINVAL; return -EINVAL;
} }
...@@ -1345,18 +1334,17 @@ static int ...@@ -1345,18 +1334,17 @@ static int
lpfc_restrict_login_set(struct lpfc_vport *vport, int val) lpfc_restrict_login_set(struct lpfc_vport *vport, int val)
{ {
if (val < 0 || val > 1) { if (val < 0 || val > 1) {
lpfc_printf_log(vport->phba, KERN_ERR, LOG_INIT, lpfc_printf_vlog(vport, KERN_ERR, LOG_INIT,
"%d:0450 lpfc_restrict_login attribute cannot " "0450 lpfc_restrict_login attribute cannot "
"be set to %d, allowed range is [0, 1]\n", "be set to %d, allowed range is [0, 1]\n",
vport->phba->brd_no, val); val);
vport->cfg_restrict_login = 1; vport->cfg_restrict_login = 1;
return -EINVAL; return -EINVAL;
} }
if (vport->port_type == LPFC_PHYSICAL_PORT && val != 0) { if (vport->port_type == LPFC_PHYSICAL_PORT && val != 0) {
lpfc_printf_log(vport->phba, KERN_ERR, LOG_INIT, lpfc_printf_vlog(vport, KERN_ERR, LOG_INIT,
"%d:0468 lpfc_restrict_login must be 0 for " "0468 lpfc_restrict_login must be 0 for "
"Physical ports.\n", "Physical ports.\n");
vport->phba->brd_no);
vport->cfg_restrict_login = 0; vport->cfg_restrict_login = 0;
return 0; return 0;
} }
...@@ -2435,7 +2423,6 @@ struct fc_function_template lpfc_vport_transport_functions = { ...@@ -2435,7 +2423,6 @@ struct fc_function_template lpfc_vport_transport_functions = {
void void
lpfc_get_cfgparam(struct lpfc_hba *phba) lpfc_get_cfgparam(struct lpfc_hba *phba)
{ {
lpfc_log_verbose_init(phba, lpfc_log_verbose);
lpfc_cr_delay_init(phba, lpfc_cr_delay); lpfc_cr_delay_init(phba, lpfc_cr_delay);
lpfc_cr_count_init(phba, lpfc_cr_count); lpfc_cr_count_init(phba, lpfc_cr_count);
lpfc_multi_ring_support_init(phba, lpfc_multi_ring_support); lpfc_multi_ring_support_init(phba, lpfc_multi_ring_support);
...@@ -2469,6 +2456,7 @@ lpfc_get_cfgparam(struct lpfc_hba *phba) ...@@ -2469,6 +2456,7 @@ lpfc_get_cfgparam(struct lpfc_hba *phba)
void void
lpfc_get_vport_cfgparam(struct lpfc_vport *vport) lpfc_get_vport_cfgparam(struct lpfc_vport *vport)
{ {
lpfc_log_verbose_init(vport, lpfc_log_verbose);
lpfc_lun_queue_depth_init(vport, lpfc_lun_queue_depth); lpfc_lun_queue_depth_init(vport, lpfc_lun_queue_depth);
lpfc_devloss_tmo_init(vport, lpfc_devloss_tmo); lpfc_devloss_tmo_init(vport, lpfc_devloss_tmo);
lpfc_nodev_tmo_init(vport, lpfc_nodev_tmo); lpfc_nodev_tmo_init(vport, lpfc_nodev_tmo);
......
...@@ -341,11 +341,11 @@ lpfc_gen_req(struct lpfc_vport *vport, struct lpfc_dmabuf *bmp, ...@@ -341,11 +341,11 @@ lpfc_gen_req(struct lpfc_vport *vport, struct lpfc_dmabuf *bmp,
} }
/* Issue GEN REQ IOCB for NPORT <did> */ /* Issue GEN REQ IOCB for NPORT <did> */
lpfc_printf_log(phba, KERN_INFO, LOG_ELS, lpfc_printf_vlog(vport, KERN_INFO, LOG_ELS,
"%d (%d):0119 Issue GEN REQ IOCB to NPORT x%x " "0119 Issue GEN REQ IOCB to NPORT x%x "
"Data: x%x x%x\n", phba->brd_no, vport->vpi, "Data: x%x x%x\n",
ndlp->nlp_DID, icmd->ulpIoTag, ndlp->nlp_DID, icmd->ulpIoTag,
vport->port_state); vport->port_state);
geniocb->iocb_cmpl = cmpl; geniocb->iocb_cmpl = cmpl;
geniocb->drvrTimeout = icmd->ulpTimeout + LPFC_DRVR_TIMEOUT; geniocb->drvrTimeout = icmd->ulpTimeout + LPFC_DRVR_TIMEOUT;
geniocb->vport = vport; geniocb->vport = vport;
...@@ -464,14 +464,13 @@ lpfc_ns_rsp(struct lpfc_vport *vport, struct lpfc_dmabuf *mp, uint32_t Size) ...@@ -464,14 +464,13 @@ lpfc_ns_rsp(struct lpfc_vport *vport, struct lpfc_dmabuf *mp, uint32_t Size)
Did, ndlp->nlp_flag, Did, ndlp->nlp_flag,
vport->fc_flag); vport->fc_flag);
lpfc_printf_log(phba, KERN_INFO, lpfc_printf_vlog(vport,
KERN_INFO,
LOG_DISCOVERY, LOG_DISCOVERY,
"%d (%d):0238 Process " "0238 Process "
"x%x NameServer Rsp" "x%x NameServer Rsp"
"Data: x%x x%x x%x\n", "Data: x%x x%x x%x\n",
phba->brd_no, Did, ndlp->nlp_flag,
vport->vpi, Did,
ndlp->nlp_flag,
vport->fc_flag, vport->fc_flag,
vport->fc_rscn_id_cnt); vport->fc_rscn_id_cnt);
} else { } else {
...@@ -482,14 +481,13 @@ lpfc_ns_rsp(struct lpfc_vport *vport, struct lpfc_dmabuf *mp, uint32_t Size) ...@@ -482,14 +481,13 @@ lpfc_ns_rsp(struct lpfc_vport *vport, struct lpfc_dmabuf *mp, uint32_t Size)
Did, vport->fc_flag, Did, vport->fc_flag,
vport->fc_rscn_id_cnt); vport->fc_rscn_id_cnt);
lpfc_printf_log(phba, KERN_INFO, lpfc_printf_vlog(vport,
KERN_INFO,
LOG_DISCOVERY, LOG_DISCOVERY,
"%d (%d):0239 Skip x%x " "0239 Skip x%x "
"NameServer Rsp Data: " "NameServer Rsp Data: "
"x%x x%x\n", "x%x x%x\n",
phba->brd_no, Did, vport->fc_flag,
vport->vpi, Did,
vport->fc_flag,
vport->fc_rscn_id_cnt); vport->fc_rscn_id_cnt);
} }
...@@ -516,14 +514,13 @@ lpfc_ns_rsp(struct lpfc_vport *vport, struct lpfc_dmabuf *mp, uint32_t Size) ...@@ -516,14 +514,13 @@ lpfc_ns_rsp(struct lpfc_vport *vport, struct lpfc_dmabuf *mp, uint32_t Size)
Did, vport->fc_flag, Did, vport->fc_flag,
vport->fc_rscn_id_cnt); vport->fc_rscn_id_cnt);
lpfc_printf_log(phba, KERN_INFO, lpfc_printf_vlog(vport,
KERN_INFO,
LOG_DISCOVERY, LOG_DISCOVERY,
"%d (%d):0245 Skip x%x " "0245 Skip x%x "
"NameServer Rsp Data: " "NameServer Rsp Data: "
"x%x x%x\n", "x%x x%x\n",
phba->brd_no, Did, vport->fc_flag,
vport->vpi, Did,
vport->fc_flag,
vport->fc_rscn_id_cnt); vport->fc_rscn_id_cnt);
} }
} }
...@@ -570,9 +567,8 @@ lpfc_cmpl_ct_cmd_gid_ft(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb, ...@@ -570,9 +567,8 @@ lpfc_cmpl_ct_cmd_gid_ft(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb,
if (lpfc_els_chk_latt(vport) || lpfc_error_lost_link(irsp)) { if (lpfc_els_chk_latt(vport) || lpfc_error_lost_link(irsp)) {
lpfc_printf_log(phba, KERN_INFO, LOG_DISCOVERY, lpfc_printf_vlog(vport, KERN_INFO, LOG_DISCOVERY,
"%d (%d):0216 Link event during NS query\n", "0216 Link event during NS query\n");
phba->brd_no, vport->vpi);
lpfc_vport_set_state(vport, FC_VPORT_FAILED); lpfc_vport_set_state(vport, FC_VPORT_FAILED);
goto out; goto out;
} }
...@@ -590,20 +586,17 @@ lpfc_cmpl_ct_cmd_gid_ft(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb, ...@@ -590,20 +586,17 @@ lpfc_cmpl_ct_cmd_gid_ft(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb,
goto out; goto out;
} }
lpfc_vport_set_state(vport, FC_VPORT_FAILED); lpfc_vport_set_state(vport, FC_VPORT_FAILED);
lpfc_printf_log(phba, KERN_ERR, LOG_ELS, lpfc_printf_vlog(vport, KERN_ERR, LOG_ELS,
"%d (%d):0257 GID_FT Query error: 0x%x 0x%x\n", "0257 GID_FT Query error: 0x%x 0x%x\n",
phba->brd_no, vport->vpi, irsp->ulpStatus, irsp->ulpStatus, vport->fc_ns_retry);
vport->fc_ns_retry);
} else { } else {
/* Good status, continue checking */ /* Good status, continue checking */
CTrsp = (struct lpfc_sli_ct_request *) outp->virt; CTrsp = (struct lpfc_sli_ct_request *) outp->virt;
if (CTrsp->CommandResponse.bits.CmdRsp == if (CTrsp->CommandResponse.bits.CmdRsp ==
be16_to_cpu(SLI_CT_RESPONSE_FS_ACC)) { be16_to_cpu(SLI_CT_RESPONSE_FS_ACC)) {
lpfc_printf_log(phba, KERN_INFO, LOG_DISCOVERY, lpfc_printf_vlog(vport, KERN_INFO, LOG_DISCOVERY,
"%d (%d):0208 NameServer Rsp " "0208 NameServer Rsp Data: x%x\n",
"Data: x%x\n", vport->fc_flag);
phba->brd_no, vport->vpi,
vport->fc_flag);
lpfc_ns_rsp(vport, outp, lpfc_ns_rsp(vport, outp,
(uint32_t) (irsp->un.genreq64.bdl.bdeSize)); (uint32_t) (irsp->un.genreq64.bdl.bdeSize));
} else if (CTrsp->CommandResponse.bits.CmdRsp == } else if (CTrsp->CommandResponse.bits.CmdRsp ==
...@@ -611,10 +604,10 @@ lpfc_cmpl_ct_cmd_gid_ft(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb, ...@@ -611,10 +604,10 @@ lpfc_cmpl_ct_cmd_gid_ft(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb,
/* NameServer Rsp Error */ /* NameServer Rsp Error */
if ((CTrsp->ReasonCode == SLI_CT_UNABLE_TO_PERFORM_REQ) if ((CTrsp->ReasonCode == SLI_CT_UNABLE_TO_PERFORM_REQ)
&& (CTrsp->Explanation == SLI_CT_NO_FC4_TYPES)) { && (CTrsp->Explanation == SLI_CT_NO_FC4_TYPES)) {
lpfc_printf_log(phba, KERN_INFO, LOG_DISCOVERY, lpfc_printf_vlog(vport, KERN_INFO,
"%d (%d):0269 No NameServer Entries " LOG_DISCOVERY,
"0269 No NameServer Entries "
"Data: x%x x%x x%x x%x\n", "Data: x%x x%x x%x x%x\n",
phba->brd_no, vport->vpi,
CTrsp->CommandResponse.bits.CmdRsp, CTrsp->CommandResponse.bits.CmdRsp,
(uint32_t) CTrsp->ReasonCode, (uint32_t) CTrsp->ReasonCode,
(uint32_t) CTrsp->Explanation, (uint32_t) CTrsp->Explanation,
...@@ -625,12 +618,11 @@ lpfc_cmpl_ct_cmd_gid_ft(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb, ...@@ -625,12 +618,11 @@ lpfc_cmpl_ct_cmd_gid_ft(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb,
(uint32_t)CTrsp->CommandResponse.bits.CmdRsp, (uint32_t)CTrsp->CommandResponse.bits.CmdRsp,
(uint32_t) CTrsp->ReasonCode, (uint32_t) CTrsp->ReasonCode,
(uint32_t) CTrsp->Explanation); (uint32_t) CTrsp->Explanation);
} } else {
else { lpfc_printf_vlog(vport, KERN_INFO,
lpfc_printf_log(phba, KERN_INFO, LOG_DISCOVERY, LOG_DISCOVERY,
"%d (%d):0240 NameServer Rsp Error " "0240 NameServer Rsp Error "
"Data: x%x x%x x%x x%x\n", "Data: x%x x%x x%x x%x\n",
phba->brd_no, vport->vpi,
CTrsp->CommandResponse.bits.CmdRsp, CTrsp->CommandResponse.bits.CmdRsp,
(uint32_t) CTrsp->ReasonCode, (uint32_t) CTrsp->ReasonCode,
(uint32_t) CTrsp->Explanation, (uint32_t) CTrsp->Explanation,
...@@ -646,10 +638,9 @@ lpfc_cmpl_ct_cmd_gid_ft(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb, ...@@ -646,10 +638,9 @@ lpfc_cmpl_ct_cmd_gid_ft(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb,
} else { } else {
/* NameServer Rsp Error */ /* NameServer Rsp Error */
lpfc_printf_log(phba, KERN_ERR, LOG_DISCOVERY, lpfc_printf_vlog(vport, KERN_ERR, LOG_DISCOVERY,
"%d (%d):0241 NameServer Rsp Error " "0241 NameServer Rsp Error "
"Data: x%x x%x x%x x%x\n", "Data: x%x x%x x%x x%x\n",
phba->brd_no, vport->vpi,
CTrsp->CommandResponse.bits.CmdRsp, CTrsp->CommandResponse.bits.CmdRsp,
(uint32_t) CTrsp->ReasonCode, (uint32_t) CTrsp->ReasonCode,
(uint32_t) CTrsp->Explanation, (uint32_t) CTrsp->Explanation,
...@@ -717,40 +708,37 @@ lpfc_cmpl_ct_cmd_gff_id(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb, ...@@ -717,40 +708,37 @@ lpfc_cmpl_ct_cmd_gff_id(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb,
be16_to_cpu(SLI_CT_RESPONSE_FS_ACC)) { be16_to_cpu(SLI_CT_RESPONSE_FS_ACC)) {
if ((fbits & FC4_FEATURE_INIT) && if ((fbits & FC4_FEATURE_INIT) &&
!(fbits & FC4_FEATURE_TARGET)) { !(fbits & FC4_FEATURE_TARGET)) {
lpfc_printf_log(phba, KERN_INFO, LOG_DISCOVERY, lpfc_printf_vlog(vport, KERN_INFO,
"%d (%d):0270 Skip x%x GFF " LOG_DISCOVERY,
"NameServer Rsp Data: (init) " "0270 Skip x%x GFF "
"x%x x%x\n", phba->brd_no, "NameServer Rsp Data: (init) "
vport->vpi, did, fbits, "x%x x%x\n", did, fbits,
vport->fc_rscn_id_cnt); vport->fc_rscn_id_cnt);
goto out; goto out;
} }
} }
} }
else { else {
lpfc_printf_log(phba, KERN_ERR, LOG_DISCOVERY, lpfc_printf_vlog(vport, KERN_ERR, LOG_DISCOVERY,
"%d (%d):0267 NameServer GFF Rsp" "0267 NameServer GFF Rsp "
" x%x Error (%d %d) Data: x%x x%x\n", "x%x Error (%d %d) Data: x%x x%x\n",
phba->brd_no, vport->vpi, did, did, irsp->ulpStatus, irsp->un.ulpWord[4],
irsp->ulpStatus, irsp->un.ulpWord[4], vport->fc_flag, vport->fc_rscn_id_cnt)
vport->fc_flag, vport->fc_rscn_id_cnt)
} }
/* This is a target port, unregistered port, or the GFF_ID failed */ /* This is a target port, unregistered port, or the GFF_ID failed */
ndlp = lpfc_setup_disc_node(vport, did); ndlp = lpfc_setup_disc_node(vport, did);
if (ndlp) { if (ndlp) {
lpfc_printf_log(phba, KERN_INFO, LOG_DISCOVERY, lpfc_printf_vlog(vport, KERN_INFO, LOG_DISCOVERY,
"%d (%d):0242 Process x%x GFF " "0242 Process x%x GFF "
"NameServer Rsp Data: x%x x%x x%x\n", "NameServer Rsp Data: x%x x%x x%x\n",
phba->brd_no, vport->vpi, did, ndlp->nlp_flag, vport->fc_flag,
did, ndlp->nlp_flag, vport->fc_flag, vport->fc_rscn_id_cnt);
vport->fc_rscn_id_cnt);
} else { } else {
lpfc_printf_log(phba, KERN_INFO, LOG_DISCOVERY, lpfc_printf_vlog(vport, KERN_INFO, LOG_DISCOVERY,
"%d (%d):0243 Skip x%x GFF " "0243 Skip x%x GFF "
"NameServer Rsp Data: x%x x%x\n", "NameServer Rsp Data: x%x x%x\n", did,
phba->brd_no, vport->vpi, did, vport->fc_flag, vport->fc_rscn_id_cnt);
vport->fc_flag, vport->fc_rscn_id_cnt);
} }
out: out:
/* Link up / RSCN discovery */ /* Link up / RSCN discovery */
...@@ -806,22 +794,21 @@ lpfc_cmpl_ct_cmd_rft_id(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb, ...@@ -806,22 +794,21 @@ lpfc_cmpl_ct_cmd_rft_id(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb,
latt = lpfc_els_chk_latt(vport); latt = lpfc_els_chk_latt(vport);
/* RFT request completes status <ulpStatus> CmdRsp <CmdRsp> */ /* RFT request completes status <ulpStatus> CmdRsp <CmdRsp> */
lpfc_printf_log(phba, KERN_INFO, LOG_DISCOVERY, lpfc_printf_vlog(vport, KERN_INFO, LOG_DISCOVERY,
"%d (%d):0209 RFT request completes, latt %d, " "0209 RFT request completes, latt %d, "
"ulpStatus x%x CmdRsp x%x, Context x%x, Tag x%x\n", "ulpStatus x%x CmdRsp x%x, Context x%x, Tag x%x\n",
phba->brd_no, vport->vpi, latt, irsp->ulpStatus, latt, irsp->ulpStatus,
CTrsp->CommandResponse.bits.CmdRsp, CTrsp->CommandResponse.bits.CmdRsp,
cmdiocb->iocb.ulpContext, cmdiocb->iocb.ulpIoTag); cmdiocb->iocb.ulpContext, cmdiocb->iocb.ulpIoTag);
lpfc_debugfs_disc_trc(vport, LPFC_DISC_TRC_CT, lpfc_debugfs_disc_trc(vport, LPFC_DISC_TRC_CT,
"CT cmd cmpl: status:x%x/x%x cmd:x%x", "CT cmd cmpl: status:x%x/x%x cmd:x%x",
irsp->ulpStatus, irsp->un.ulpWord[4], cmdcode); irsp->ulpStatus, irsp->un.ulpWord[4], cmdcode);
if (irsp->ulpStatus) { if (irsp->ulpStatus) {
lpfc_printf_log(phba, KERN_ERR, LOG_DISCOVERY, lpfc_printf_vlog(vport, KERN_ERR, LOG_DISCOVERY,
"%d (%d):0268 NS cmd %x Error (%d %d)\n", "0268 NS cmd %x Error (%d %d)\n",
phba->brd_no, vport->vpi, cmdcode, cmdcode, irsp->ulpStatus, irsp->un.ulpWord[4]);
irsp->ulpStatus, irsp->un.ulpWord[4]);
if ((irsp->ulpStatus == IOSTAT_LOCAL_REJECT) && if ((irsp->ulpStatus == IOSTAT_LOCAL_REJECT) &&
((irsp->un.ulpWord[4] == IOERR_SLI_DOWN) || ((irsp->un.ulpWord[4] == IOERR_SLI_DOWN) ||
...@@ -833,9 +820,8 @@ lpfc_cmpl_ct_cmd_rft_id(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb, ...@@ -833,9 +820,8 @@ lpfc_cmpl_ct_cmd_rft_id(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb,
goto out; goto out;
retry++; retry++;
lpfc_printf_log(phba, KERN_INFO, LOG_DISCOVERY, lpfc_printf_vlog(vport, KERN_INFO, LOG_DISCOVERY,
"%d (%d):0216 Retrying NS cmd %x\n", "0216 Retrying NS cmd %x\n", cmdcode);
phba->brd_no, vport->vpi, cmdcode);
rc = lpfc_ns_cmd(vport, cmdcode, retry, 0); rc = lpfc_ns_cmd(vport, cmdcode, retry, 0);
if (rc == 0) if (rc == 0)
goto out; goto out;
...@@ -979,10 +965,9 @@ lpfc_ns_cmd(struct lpfc_vport *vport, int cmdcode, ...@@ -979,10 +965,9 @@ lpfc_ns_cmd(struct lpfc_vport *vport, int cmdcode,
} }
/* NameServer Req */ /* NameServer Req */
lpfc_printf_log(phba, KERN_INFO ,LOG_DISCOVERY, lpfc_printf_vlog(vport, KERN_INFO ,LOG_DISCOVERY,
"%d (%d):0236 NameServer Req Data: x%x x%x x%x\n", "0236 NameServer Req Data: x%x x%x x%x\n",
phba->brd_no, vport->vpi, cmdcode, vport->fc_flag, cmdcode, vport->fc_flag, vport->fc_rscn_id_cnt);
vport->fc_rscn_id_cnt);
bpl = (struct ulp_bde64 *) bmp->virt; bpl = (struct ulp_bde64 *) bmp->virt;
memset(bpl, 0, sizeof(struct ulp_bde64)); memset(bpl, 0, sizeof(struct ulp_bde64));
...@@ -1099,10 +1084,9 @@ lpfc_ns_cmd(struct lpfc_vport *vport, int cmdcode, ...@@ -1099,10 +1084,9 @@ lpfc_ns_cmd(struct lpfc_vport *vport, int cmdcode,
ns_cmd_free_mp: ns_cmd_free_mp:
kfree(mp); kfree(mp);
ns_cmd_exit: ns_cmd_exit:
lpfc_printf_log(phba, KERN_ERR, LOG_DISCOVERY, lpfc_printf_vlog(vport, KERN_ERR, LOG_DISCOVERY,
"%d (%d):0266 Issue NameServer Req x%x err %d Data: x%x x%x\n", "0266 Issue NameServer Req x%x err %d Data: x%x x%x\n",
phba->brd_no, vport->vpi, cmdcode, rc, vport->fc_flag, cmdcode, rc, vport->fc_flag, vport->fc_rscn_id_cnt);
vport->fc_rscn_id_cnt);
return 1; return 1;
} }
...@@ -1128,12 +1112,11 @@ lpfc_cmpl_ct_cmd_fdmi(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb, ...@@ -1128,12 +1112,11 @@ lpfc_cmpl_ct_cmd_fdmi(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb,
irsp->ulpStatus, irsp->un.ulpWord[4], latt); irsp->ulpStatus, irsp->un.ulpWord[4], latt);
if (latt || irsp->ulpStatus) { if (latt || irsp->ulpStatus) {
lpfc_printf_log(phba, KERN_INFO, LOG_DISCOVERY, lpfc_printf_vlog(vport, KERN_INFO, LOG_DISCOVERY,
"%d (%d):0229 FDMI cmd %04x failed, latt = %d " "0229 FDMI cmd %04x failed, latt = %d "
"ulpStatus: x%x, rid x%x\n", "ulpStatus: x%x, rid x%x\n",
phba->brd_no, vport->vpi, be16_to_cpu(fdmi_cmd), latt, irsp->ulpStatus,
be16_to_cpu(fdmi_cmd), latt, irsp->ulpStatus, irsp->un.ulpWord[4]);
irsp->un.ulpWord[4]);
lpfc_ct_free_iocb(phba, cmdiocb); lpfc_ct_free_iocb(phba, cmdiocb);
return; return;
} }
...@@ -1141,10 +1124,9 @@ lpfc_cmpl_ct_cmd_fdmi(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb, ...@@ -1141,10 +1124,9 @@ lpfc_cmpl_ct_cmd_fdmi(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb,
ndlp = lpfc_findnode_did(vport, FDMI_DID); ndlp = lpfc_findnode_did(vport, FDMI_DID);
if (fdmi_rsp == be16_to_cpu(SLI_CT_RESPONSE_FS_RJT)) { if (fdmi_rsp == be16_to_cpu(SLI_CT_RESPONSE_FS_RJT)) {
/* FDMI rsp failed */ /* FDMI rsp failed */
lpfc_printf_log(phba, KERN_INFO, LOG_DISCOVERY, lpfc_printf_vlog(vport, KERN_INFO, LOG_DISCOVERY,
"%d (%d):0220 FDMI rsp failed Data: x%x\n", "0220 FDMI rsp failed Data: x%x\n",
phba->brd_no, vport->vpi, be16_to_cpu(fdmi_cmd));
be16_to_cpu(fdmi_cmd));
} }
switch (be16_to_cpu(fdmi_cmd)) { switch (be16_to_cpu(fdmi_cmd)) {
...@@ -1207,11 +1189,9 @@ lpfc_fdmi_cmd(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp, int cmdcode) ...@@ -1207,11 +1189,9 @@ lpfc_fdmi_cmd(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp, int cmdcode)
INIT_LIST_HEAD(&bmp->list); INIT_LIST_HEAD(&bmp->list);
/* FDMI request */ /* FDMI request */
lpfc_printf_log(phba, KERN_INFO, LOG_DISCOVERY, lpfc_printf_vlog(vport, KERN_INFO, LOG_DISCOVERY,
"%d (%d):0218 FDMI Request Data: x%x x%x x%x\n", "0218 FDMI Request Data: x%x x%x x%x\n",
phba->brd_no, vport->vpi, vport->fc_flag, vport->fc_flag, vport->port_state, cmdcode);
vport->port_state, cmdcode);
CtReq = (struct lpfc_sli_ct_request *) mp->virt; CtReq = (struct lpfc_sli_ct_request *) mp->virt;
memset(CtReq, 0, sizeof(struct lpfc_sli_ct_request)); memset(CtReq, 0, sizeof(struct lpfc_sli_ct_request));
...@@ -1534,9 +1514,9 @@ lpfc_fdmi_cmd(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp, int cmdcode) ...@@ -1534,9 +1514,9 @@ lpfc_fdmi_cmd(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp, int cmdcode)
kfree(mp); kfree(mp);
fdmi_cmd_exit: fdmi_cmd_exit:
/* Issue FDMI request failed */ /* Issue FDMI request failed */
lpfc_printf_log(phba, KERN_INFO, LOG_DISCOVERY, lpfc_printf_vlog(vport, KERN_INFO, LOG_DISCOVERY,
"%d (%d):0244 Issue FDMI request failed Data: x%x\n", "0244 Issue FDMI request failed Data: x%x\n",
phba->brd_no, vport->vpi, cmdcode); cmdcode);
return 1; return 1;
} }
......
...@@ -642,13 +642,11 @@ lpfc_debugfs_initialize(struct lpfc_vport *vport) ...@@ -642,13 +642,11 @@ lpfc_debugfs_initialize(struct lpfc_vport *vport)
lpfc_debugfs_root = debugfs_create_dir("lpfc", NULL); lpfc_debugfs_root = debugfs_create_dir("lpfc", NULL);
atomic_set(&lpfc_debugfs_hba_count, 0); atomic_set(&lpfc_debugfs_hba_count, 0);
if (!lpfc_debugfs_root) { if (!lpfc_debugfs_root) {
lpfc_printf_log(phba, KERN_ERR, LOG_INIT, lpfc_printf_vlog(vport, KERN_ERR, LOG_INIT,
"%d:0409 Cannot create debugfs root (lpfc)", "0409 Cannot create debugfs root\n");
phba->brd_no);
goto debug_failed; goto debug_failed;
} }
} }
if (!lpfc_debugfs_start_time) if (!lpfc_debugfs_start_time)
lpfc_debugfs_start_time = jiffies; lpfc_debugfs_start_time = jiffies;
...@@ -658,9 +656,8 @@ lpfc_debugfs_initialize(struct lpfc_vport *vport) ...@@ -658,9 +656,8 @@ lpfc_debugfs_initialize(struct lpfc_vport *vport)
phba->hba_debugfs_root = phba->hba_debugfs_root =
debugfs_create_dir(name, lpfc_debugfs_root); debugfs_create_dir(name, lpfc_debugfs_root);
if (!phba->hba_debugfs_root) { if (!phba->hba_debugfs_root) {
lpfc_printf_log(phba, KERN_ERR, LOG_INIT, lpfc_printf_vlog(vport, KERN_ERR, LOG_INIT,
"%d:0409 Cannot create debugfs hba (lpfc%d)", "0409 Cannot create debugfs hba\n");
phba->brd_no, phba->brd_no);
goto debug_failed; goto debug_failed;
} }
atomic_inc(&lpfc_debugfs_hba_count); atomic_inc(&lpfc_debugfs_hba_count);
...@@ -673,9 +670,8 @@ lpfc_debugfs_initialize(struct lpfc_vport *vport) ...@@ -673,9 +670,8 @@ lpfc_debugfs_initialize(struct lpfc_vport *vport)
phba->hba_debugfs_root, phba->hba_debugfs_root,
phba, &lpfc_debugfs_op_dumpslim); phba, &lpfc_debugfs_op_dumpslim);
if (!phba->debug_dumpslim) { if (!phba->debug_dumpslim) {
lpfc_printf_log(phba, KERN_ERR, LOG_INIT, lpfc_printf_vlog(vport, KERN_ERR, LOG_INIT,
"%d:0409 Cannot create debugfs dumpslim (lpfc%d)", "0409 Cannot create debugfs dumpslim\n");
phba->brd_no, phba->brd_no);
goto debug_failed; goto debug_failed;
} }
...@@ -692,8 +688,8 @@ lpfc_debugfs_initialize(struct lpfc_vport *vport) ...@@ -692,8 +688,8 @@ lpfc_debugfs_initialize(struct lpfc_vport *vport)
} }
lpfc_debugfs_max_slow_ring_trc = (1 << i); lpfc_debugfs_max_slow_ring_trc = (1 << i);
printk(KERN_ERR printk(KERN_ERR
"lpfc_debugfs_max_slow_ring_trc change to %d\n", "lpfc_debugfs_max_disc_trc changed to "
lpfc_debugfs_max_slow_ring_trc); "%d\n", lpfc_debugfs_max_disc_trc);
} }
} }
...@@ -704,10 +700,9 @@ lpfc_debugfs_initialize(struct lpfc_vport *vport) ...@@ -704,10 +700,9 @@ lpfc_debugfs_initialize(struct lpfc_vport *vport)
phba->hba_debugfs_root, phba->hba_debugfs_root,
phba, &lpfc_debugfs_op_slow_ring_trc); phba, &lpfc_debugfs_op_slow_ring_trc);
if (!phba->debug_slow_ring_trc) { if (!phba->debug_slow_ring_trc) {
lpfc_printf_log(phba, KERN_ERR, LOG_INIT, lpfc_printf_vlog(vport, KERN_ERR, LOG_INIT,
"%d:0409 Cannot create debugfs " "0409 Cannot create debugfs "
"slow_ring_trace (lpfc%d)", "slow_ring_trace\n");
phba->brd_no, phba->brd_no);
goto debug_failed; goto debug_failed;
} }
if (!phba->slow_ring_trc) { if (!phba->slow_ring_trc) {
...@@ -716,10 +711,9 @@ lpfc_debugfs_initialize(struct lpfc_vport *vport) ...@@ -716,10 +711,9 @@ lpfc_debugfs_initialize(struct lpfc_vport *vport)
lpfc_debugfs_max_slow_ring_trc), lpfc_debugfs_max_slow_ring_trc),
GFP_KERNEL); GFP_KERNEL);
if (!phba->slow_ring_trc) { if (!phba->slow_ring_trc) {
lpfc_printf_log(phba, KERN_ERR, LOG_INIT, lpfc_printf_vlog(vport, KERN_ERR, LOG_INIT,
"%d:0409 Cannot create debugfs " "0409 Cannot create debugfs "
"slow_ring buffer (lpfc%d)", "slow_ring buffer\n");
phba->brd_no, phba->brd_no);
goto debug_failed; goto debug_failed;
} }
atomic_set(&phba->slow_ring_trc_cnt, 0); atomic_set(&phba->slow_ring_trc_cnt, 0);
...@@ -734,9 +728,8 @@ lpfc_debugfs_initialize(struct lpfc_vport *vport) ...@@ -734,9 +728,8 @@ lpfc_debugfs_initialize(struct lpfc_vport *vport)
vport->vport_debugfs_root = vport->vport_debugfs_root =
debugfs_create_dir(name, phba->hba_debugfs_root); debugfs_create_dir(name, phba->hba_debugfs_root);
if (!vport->vport_debugfs_root) { if (!vport->vport_debugfs_root) {
lpfc_printf_log(phba, KERN_ERR, LOG_INIT, lpfc_printf_vlog(vport, KERN_ERR, LOG_INIT,
"%d:0409 Cant create debugfs vport%d (lpfc%d)", "0409 Cant create debugfs");
phba->brd_no, vport->vpi, phba->brd_no);
goto debug_failed; goto debug_failed;
} }
atomic_inc(&phba->debugfs_vport_count); atomic_inc(&phba->debugfs_vport_count);
...@@ -754,8 +747,8 @@ lpfc_debugfs_initialize(struct lpfc_vport *vport) ...@@ -754,8 +747,8 @@ lpfc_debugfs_initialize(struct lpfc_vport *vport)
} }
lpfc_debugfs_max_disc_trc = (1 << i); lpfc_debugfs_max_disc_trc = (1 << i);
printk(KERN_ERR printk(KERN_ERR
"lpfc_debugfs_max_disc_trc changed to %d\n", "lpfc_debugfs_max_disc_trc changed to %d\n",
lpfc_debugfs_max_disc_trc); lpfc_debugfs_max_disc_trc);
} }
} }
...@@ -764,10 +757,9 @@ lpfc_debugfs_initialize(struct lpfc_vport *vport) ...@@ -764,10 +757,9 @@ lpfc_debugfs_initialize(struct lpfc_vport *vport)
GFP_KERNEL); GFP_KERNEL);
if (!vport->disc_trc) { if (!vport->disc_trc) {
lpfc_printf_log(phba, KERN_ERR, LOG_INIT, lpfc_printf_vlog(vport, KERN_ERR, LOG_INIT,
"%d:0409 Cannot create debugfs " "0409 Cannot create debugfs disc trace "
"vport%d disc trace buffer (lpfc%d)", "buffer\n");
phba->brd_no, vport->vpi, phba->brd_no);
goto debug_failed; goto debug_failed;
} }
atomic_set(&vport->disc_trc_cnt, 0); atomic_set(&vport->disc_trc_cnt, 0);
...@@ -780,10 +772,9 @@ lpfc_debugfs_initialize(struct lpfc_vport *vport) ...@@ -780,10 +772,9 @@ lpfc_debugfs_initialize(struct lpfc_vport *vport)
vport->vport_debugfs_root, vport->vport_debugfs_root,
vport, &lpfc_debugfs_op_disc_trc); vport, &lpfc_debugfs_op_disc_trc);
if (!vport->debug_disc_trc) { if (!vport->debug_disc_trc) {
lpfc_printf_log(phba, KERN_ERR, LOG_INIT, lpfc_printf_vlog(vport, KERN_ERR, LOG_INIT,
"%d:0409 Cannot create debugfs " "0409 Cannot create debugfs "
"vport%d discovery_trace (lpfc%d)", "discovery_trace\n");
phba->brd_no, vport->vpi, phba->brd_no);
goto debug_failed; goto debug_failed;
} }
snprintf(name, sizeof(name), "nodelist"); snprintf(name, sizeof(name), "nodelist");
...@@ -792,9 +783,8 @@ lpfc_debugfs_initialize(struct lpfc_vport *vport) ...@@ -792,9 +783,8 @@ lpfc_debugfs_initialize(struct lpfc_vport *vport)
vport->vport_debugfs_root, vport->vport_debugfs_root,
vport, &lpfc_debugfs_op_nodelist); vport, &lpfc_debugfs_op_nodelist);
if (!vport->debug_nodelist) { if (!vport->debug_nodelist) {
lpfc_printf_log(phba, KERN_ERR, LOG_INIT, lpfc_printf_vlog(vport, KERN_ERR, LOG_INIT,
"%d:0409 Cant create debugfs vport%d nodelist (lpfc%d)", "0409 Cant create debugfs nodelist");
phba->brd_no, vport->vpi, phba->brd_no);
goto debug_failed; goto debug_failed;
} }
debug_failed: debug_failed:
......
...@@ -63,10 +63,10 @@ lpfc_els_chk_latt(struct lpfc_vport *vport) ...@@ -63,10 +63,10 @@ lpfc_els_chk_latt(struct lpfc_vport *vport)
return 0; return 0;
/* Pending Link Event during Discovery */ /* Pending Link Event during Discovery */
lpfc_printf_log(phba, KERN_ERR, LOG_DISCOVERY, lpfc_printf_vlog(vport, KERN_ERR, LOG_DISCOVERY,
"%d (%d):0237 Pending Link Event during " "0237 Pending Link Event during "
"Discovery: State x%x\n", "Discovery: State x%x\n",
phba->brd_no, vport->vpi, phba->pport->port_state); phba->pport->port_state);
/* CLEAR_LA should re-enable link attention events and /* CLEAR_LA should re-enable link attention events and
* we should then imediately take a LATT event. The * we should then imediately take a LATT event. The
...@@ -208,23 +208,21 @@ lpfc_prep_els_iocb(struct lpfc_vport *vport, uint8_t expectRsp, ...@@ -208,23 +208,21 @@ lpfc_prep_els_iocb(struct lpfc_vport *vport, uint8_t expectRsp,
if (prsp) { if (prsp) {
list_add(&prsp->list, &pcmd->list); list_add(&prsp->list, &pcmd->list);
} }
if (expectRsp) { if (expectRsp) {
/* Xmit ELS command <elsCmd> to remote NPORT <did> */ /* Xmit ELS command <elsCmd> to remote NPORT <did> */
lpfc_printf_log(phba, KERN_INFO, LOG_ELS, lpfc_printf_vlog(vport, KERN_INFO, LOG_ELS,
"%d (%d):0116 Xmit ELS command x%x to remote " "0116 Xmit ELS command x%x to remote "
"NPORT x%x I/O tag: x%x, port state: x%x\n", "NPORT x%x I/O tag: x%x, port state: x%x\n",
phba->brd_no, vport->vpi, elscmd, did, elscmd, did, elsiocb->iotag,
elsiocb->iotag, vport->port_state); vport->port_state);
} else { } else {
/* Xmit ELS response <elsCmd> to remote NPORT <did> */ /* Xmit ELS response <elsCmd> to remote NPORT <did> */
lpfc_printf_log(phba, KERN_INFO, LOG_ELS, lpfc_printf_vlog(vport, KERN_INFO, LOG_ELS,
"%d (%d):0117 Xmit ELS response x%x to remote " "0117 Xmit ELS response x%x to remote "
"NPORT x%x I/O tag: x%x, size: x%x\n", "NPORT x%x I/O tag: x%x, size: x%x\n",
phba->brd_no, vport->vpi, elscmd, elscmd, ndlp->nlp_DID, elsiocb->iotag,
ndlp->nlp_DID, elsiocb->iotag, cmdSize); cmdSize);
} }
return elsiocb; return elsiocb;
} }
...@@ -285,9 +283,8 @@ lpfc_issue_fabric_reglogin(struct lpfc_vport *vport) ...@@ -285,9 +283,8 @@ lpfc_issue_fabric_reglogin(struct lpfc_vport *vport)
fail: fail:
lpfc_vport_set_state(vport, FC_VPORT_FAILED); lpfc_vport_set_state(vport, FC_VPORT_FAILED);
lpfc_printf_log(phba, KERN_ERR, LOG_ELS, lpfc_printf_vlog(vport, KERN_ERR, LOG_ELS,
"%d (%d):0249 Cannot issue Register Fabric login\n", "0249 Cannot issue Register Fabric login\n");
phba->brd_no, vport->vpi);
return -ENXIO; return -ENXIO;
} }
...@@ -340,20 +337,19 @@ lpfc_cmpl_els_flogi_fabric(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp, ...@@ -340,20 +337,19 @@ lpfc_cmpl_els_flogi_fabric(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp,
if (phba->sli3_options & LPFC_SLI3_NPIV_ENABLED) { if (phba->sli3_options & LPFC_SLI3_NPIV_ENABLED) {
if (sp->cmn.response_multiple_NPort) { if (sp->cmn.response_multiple_NPort) {
lpfc_printf_log(phba, KERN_WARNING, LOG_ELS | LOG_VPORT, lpfc_printf_vlog(vport, KERN_WARNING,
"%d:1816 FLOGI NPIV supported, " LOG_ELS | LOG_VPORT,
"response data 0x%x\n", "1816 FLOGI NPIV supported, "
phba->brd_no, "response data 0x%x\n",
sp->cmn.response_multiple_NPort); sp->cmn.response_multiple_NPort);
phba->link_flag |= LS_NPIV_FAB_SUPPORTED; phba->link_flag |= LS_NPIV_FAB_SUPPORTED;
} else { } else {
/* Because we asked f/w for NPIV it still expects us /* Because we asked f/w for NPIV it still expects us
to call reg_vnpid atleast for the physcial host */ to call reg_vnpid atleast for the physcial host */
lpfc_printf_log(phba, KERN_WARNING, LOG_ELS | LOG_VPORT, lpfc_printf_vlog(vport, KERN_WARNING,
"%d:1817 Fabric does not support NPIV " LOG_ELS | LOG_VPORT,
"- configuring single port mode.\n", "1817 Fabric does not support NPIV "
phba->brd_no); "- configuring single port mode.\n");
phba->link_flag &= ~LS_NPIV_FAB_SUPPORTED; phba->link_flag &= ~LS_NPIV_FAB_SUPPORTED;
} }
} }
...@@ -522,12 +518,11 @@ lpfc_cmpl_els_flogi(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb, ...@@ -522,12 +518,11 @@ lpfc_cmpl_els_flogi(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb,
} }
/* FLOGI failure */ /* FLOGI failure */
lpfc_printf_log(phba, KERN_INFO, LOG_ELS, lpfc_printf_vlog(vport, KERN_INFO, LOG_ELS,
"%d (%d):0100 FLOGI failure Data: x%x x%x " "0100 FLOGI failure Data: x%x x%x "
"x%x\n", "x%x\n",
phba->brd_no, vport->vpi, irsp->ulpStatus, irsp->un.ulpWord[4],
irsp->ulpStatus, irsp->un.ulpWord[4], irsp->ulpTimeout);
irsp->ulpTimeout);
goto flogifail; goto flogifail;
} }
...@@ -540,12 +535,11 @@ lpfc_cmpl_els_flogi(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb, ...@@ -540,12 +535,11 @@ lpfc_cmpl_els_flogi(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb,
sp = prsp->virt + sizeof(uint32_t); sp = prsp->virt + sizeof(uint32_t);
/* FLOGI completes successfully */ /* FLOGI completes successfully */
lpfc_printf_log(phba, KERN_INFO, LOG_ELS, lpfc_printf_vlog(vport, KERN_INFO, LOG_ELS,
"%d (%d):0101 FLOGI completes sucessfully " "0101 FLOGI completes sucessfully "
"Data: x%x x%x x%x x%x\n", "Data: x%x x%x x%x x%x\n",
phba->brd_no, vport->vpi, irsp->un.ulpWord[4], sp->cmn.e_d_tov,
irsp->un.ulpWord[4], sp->cmn.e_d_tov, sp->cmn.w2.r_a_tov, sp->cmn.edtovResolution);
sp->cmn.w2.r_a_tov, sp->cmn.edtovResolution);
if (vport->port_state == LPFC_FLOGI) { if (vport->port_state == LPFC_FLOGI) {
/* /*
...@@ -662,8 +656,8 @@ lpfc_els_abort_flogi(struct lpfc_hba *phba) ...@@ -662,8 +656,8 @@ lpfc_els_abort_flogi(struct lpfc_hba *phba)
/* Abort outstanding I/O on NPort <nlp_DID> */ /* Abort outstanding I/O on NPort <nlp_DID> */
lpfc_printf_log(phba, KERN_INFO, LOG_DISCOVERY, lpfc_printf_log(phba, KERN_INFO, LOG_DISCOVERY,
"%d:0201 Abort outstanding I/O on NPort x%x\n", "0201 Abort outstanding I/O on NPort x%x\n",
phba->brd_no, Fabric_DID); Fabric_DID);
pring = &phba->sli.ring[LPFC_ELS_RING]; pring = &phba->sli.ring[LPFC_ELS_RING];
...@@ -736,18 +730,16 @@ static void ...@@ -736,18 +730,16 @@ static void
lpfc_more_plogi(struct lpfc_vport *vport) lpfc_more_plogi(struct lpfc_vport *vport)
{ {
int sentplogi; int sentplogi;
struct lpfc_hba *phba = vport->phba;
if (vport->num_disc_nodes) if (vport->num_disc_nodes)
vport->num_disc_nodes--; vport->num_disc_nodes--;
/* Continue discovery with <num_disc_nodes> PLOGIs to go */ /* Continue discovery with <num_disc_nodes> PLOGIs to go */
lpfc_printf_log(phba, KERN_INFO, LOG_DISCOVERY, lpfc_printf_vlog(vport, KERN_INFO, LOG_DISCOVERY,
"%d (%d):0232 Continue discovery with %d PLOGIs to go " "0232 Continue discovery with %d PLOGIs to go "
"Data: x%x x%x x%x\n", "Data: x%x x%x x%x\n",
phba->brd_no, vport->vpi, vport->num_disc_nodes, vport->num_disc_nodes, vport->fc_plogi_cnt,
vport->fc_plogi_cnt, vport->fc_flag, vport->port_state); vport->fc_flag, vport->port_state);
/* Check to see if there are more PLOGIs to be sent */ /* Check to see if there are more PLOGIs to be sent */
if (vport->fc_flag & FC_NLP_MORE) if (vport->fc_flag & FC_NLP_MORE)
/* go thru NPR nodes and issue any remaining ELS PLOGIs */ /* go thru NPR nodes and issue any remaining ELS PLOGIs */
...@@ -833,11 +825,12 @@ lpfc_cmpl_els_plogi(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb, ...@@ -833,11 +825,12 @@ lpfc_cmpl_els_plogi(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb,
ndlp = lpfc_findnode_did(vport, irsp->un.elsreq64.remoteID); ndlp = lpfc_findnode_did(vport, irsp->un.elsreq64.remoteID);
if (!ndlp) { if (!ndlp) {
lpfc_printf_log(phba, KERN_ERR, LOG_ELS, lpfc_printf_vlog(vport, KERN_ERR, LOG_ELS,
"%d (%d):0136 PLOGI completes to NPort x%x " "0136 PLOGI completes to NPort x%x "
"with no ndlp. Data: x%x x%x x%x\n", "with no ndlp. Data: x%x x%x x%x\n",
phba->brd_no, vport->vpi, irsp->un.elsreq64.remoteID, irsp->un.elsreq64.remoteID,
irsp->ulpStatus, irsp->un.ulpWord[4], irsp->ulpIoTag); irsp->ulpStatus, irsp->un.ulpWord[4],
irsp->ulpIoTag);
goto out; goto out;
} }
...@@ -851,13 +844,11 @@ lpfc_cmpl_els_plogi(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb, ...@@ -851,13 +844,11 @@ lpfc_cmpl_els_plogi(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb,
rc = 0; rc = 0;
/* PLOGI completes to NPort <nlp_DID> */ /* PLOGI completes to NPort <nlp_DID> */
lpfc_printf_log(phba, KERN_INFO, LOG_ELS, lpfc_printf_vlog(vport, KERN_INFO, LOG_ELS,
"%d (%d):0102 PLOGI completes to NPort x%x " "0102 PLOGI completes to NPort x%x "
"Data: x%x x%x x%x x%x x%x\n", "Data: x%x x%x x%x x%x x%x\n",
phba->brd_no, vport->vpi, ndlp->nlp_DID, ndlp->nlp_DID, irsp->ulpStatus, irsp->un.ulpWord[4],
irsp->ulpStatus, irsp->un.ulpWord[4], irsp->ulpTimeout, disc, vport->num_disc_nodes);
irsp->ulpTimeout, disc, vport->num_disc_nodes);
/* Check to see if link went down during discovery */ /* Check to see if link went down during discovery */
if (lpfc_els_chk_latt(vport)) { if (lpfc_els_chk_latt(vport)) {
spin_lock_irq(shost->host_lock); spin_lock_irq(shost->host_lock);
...@@ -881,17 +872,14 @@ lpfc_cmpl_els_plogi(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb, ...@@ -881,17 +872,14 @@ lpfc_cmpl_els_plogi(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb,
} }
goto out; goto out;
} }
/* PLOGI failed */ /* PLOGI failed */
if (ndlp->nlp_DID == NameServer_DID) { if (ndlp->nlp_DID == NameServer_DID) {
lpfc_vport_set_state(vport, FC_VPORT_FAILED); lpfc_vport_set_state(vport, FC_VPORT_FAILED);
lpfc_printf_log(phba, KERN_ERR, LOG_ELS, lpfc_printf_vlog(vport, KERN_ERR, LOG_ELS,
"%d (%d):0250 Nameserver login error: " "0250 Nameserver login error: "
"0x%x / 0x%x\n", "0x%x / 0x%x\n",
phba->brd_no, vport->vpi, irsp->ulpStatus, irsp->un.ulpWord[4]);
irsp->ulpStatus, irsp->un.ulpWord[4]);
} }
/* Do not call DSM for lpfc_els_abort'ed ELS cmds */ /* Do not call DSM for lpfc_els_abort'ed ELS cmds */
if (lpfc_error_lost_link(irsp)) { if (lpfc_error_lost_link(irsp)) {
rc = NLP_STE_FREED_NODE; rc = NLP_STE_FREED_NODE;
...@@ -1017,14 +1005,12 @@ lpfc_cmpl_els_prli(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb, ...@@ -1017,14 +1005,12 @@ lpfc_cmpl_els_prli(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb,
"PRLI cmpl: status:x%x/x%x did:x%x", "PRLI cmpl: status:x%x/x%x did:x%x",
irsp->ulpStatus, irsp->un.ulpWord[4], irsp->ulpStatus, irsp->un.ulpWord[4],
ndlp->nlp_DID); ndlp->nlp_DID);
/* PRLI completes to NPort <nlp_DID> */ /* PRLI completes to NPort <nlp_DID> */
lpfc_printf_log(phba, KERN_INFO, LOG_ELS, lpfc_printf_vlog(vport, KERN_INFO, LOG_ELS,
"%d (%d):0103 PRLI completes to NPort x%x " "0103 PRLI completes to NPort x%x "
"Data: x%x x%x x%x x%x\n", "Data: x%x x%x x%x x%x\n",
phba->brd_no, vport->vpi, ndlp->nlp_DID, ndlp->nlp_DID, irsp->ulpStatus, irsp->un.ulpWord[4],
irsp->ulpStatus, irsp->un.ulpWord[4], irsp->ulpTimeout, irsp->ulpTimeout, vport->num_disc_nodes);
vport->num_disc_nodes);
vport->fc_prli_sent--; vport->fc_prli_sent--;
/* Check to see if link went down during discovery */ /* Check to see if link went down during discovery */
...@@ -1129,18 +1115,15 @@ static void ...@@ -1129,18 +1115,15 @@ static void
lpfc_more_adisc(struct lpfc_vport *vport) lpfc_more_adisc(struct lpfc_vport *vport)
{ {
int sentadisc; int sentadisc;
struct lpfc_hba *phba = vport->phba;
if (vport->num_disc_nodes) if (vport->num_disc_nodes)
vport->num_disc_nodes--; vport->num_disc_nodes--;
/* Continue discovery with <num_disc_nodes> ADISCs to go */ /* Continue discovery with <num_disc_nodes> ADISCs to go */
lpfc_printf_log(phba, KERN_INFO, LOG_DISCOVERY, lpfc_printf_vlog(vport, KERN_INFO, LOG_DISCOVERY,
"%d (%d):0210 Continue discovery with %d ADISCs to go " "0210 Continue discovery with %d ADISCs to go "
"Data: x%x x%x x%x\n", "Data: x%x x%x x%x\n",
phba->brd_no, vport->vpi, vport->num_disc_nodes, vport->num_disc_nodes, vport->fc_adisc_cnt,
vport->fc_adisc_cnt, vport->fc_flag, vport->port_state); vport->fc_flag, vport->port_state);
/* Check to see if there are more ADISCs to be sent */ /* Check to see if there are more ADISCs to be sent */
if (vport->fc_flag & FC_NLP_MORE) { if (vport->fc_flag & FC_NLP_MORE) {
lpfc_set_disctmo(vport); lpfc_set_disctmo(vport);
...@@ -1206,15 +1189,12 @@ lpfc_cmpl_els_adisc(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb, ...@@ -1206,15 +1189,12 @@ lpfc_cmpl_els_adisc(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb,
disc = (ndlp->nlp_flag & NLP_NPR_2B_DISC); disc = (ndlp->nlp_flag & NLP_NPR_2B_DISC);
ndlp->nlp_flag &= ~(NLP_ADISC_SND | NLP_NPR_2B_DISC); ndlp->nlp_flag &= ~(NLP_ADISC_SND | NLP_NPR_2B_DISC);
spin_unlock_irq(shost->host_lock); spin_unlock_irq(shost->host_lock);
/* ADISC completes to NPort <nlp_DID> */ /* ADISC completes to NPort <nlp_DID> */
lpfc_printf_log(phba, KERN_INFO, LOG_ELS, lpfc_printf_vlog(vport, KERN_INFO, LOG_ELS,
"%d (%d):0104 ADISC completes to NPort x%x " "0104 ADISC completes to NPort x%x "
"Data: x%x x%x x%x x%x x%x\n", "Data: x%x x%x x%x x%x x%x\n",
phba->brd_no, vport->vpi, ndlp->nlp_DID, ndlp->nlp_DID, irsp->ulpStatus, irsp->un.ulpWord[4],
irsp->ulpStatus, irsp->un.ulpWord[4], irsp->ulpTimeout, irsp->ulpTimeout, disc, vport->num_disc_nodes);
disc, vport->num_disc_nodes);
/* Check to see if link went down during discovery */ /* Check to see if link went down during discovery */
if (lpfc_els_chk_latt(vport)) { if (lpfc_els_chk_latt(vport)) {
spin_lock_irq(shost->host_lock); spin_lock_irq(shost->host_lock);
...@@ -1374,15 +1354,12 @@ lpfc_cmpl_els_logo(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb, ...@@ -1374,15 +1354,12 @@ lpfc_cmpl_els_logo(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb,
"LOGO cmpl: status:x%x/x%x did:x%x", "LOGO cmpl: status:x%x/x%x did:x%x",
irsp->ulpStatus, irsp->un.ulpWord[4], irsp->ulpStatus, irsp->un.ulpWord[4],
ndlp->nlp_DID); ndlp->nlp_DID);
/* LOGO completes to NPort <nlp_DID> */ /* LOGO completes to NPort <nlp_DID> */
lpfc_printf_log(phba, KERN_INFO, LOG_ELS, lpfc_printf_vlog(vport, KERN_INFO, LOG_ELS,
"%d (%d):0105 LOGO completes to NPort x%x " "0105 LOGO completes to NPort x%x "
"Data: x%x x%x x%x x%x\n", "Data: x%x x%x x%x x%x\n",
phba->brd_no, vport->vpi, ndlp->nlp_DID, ndlp->nlp_DID, irsp->ulpStatus, irsp->un.ulpWord[4],
irsp->ulpStatus, irsp->un.ulpWord[4], irsp->ulpTimeout, irsp->ulpTimeout, vport->num_disc_nodes);
vport->num_disc_nodes);
/* Check to see if link went down during discovery */ /* Check to see if link went down during discovery */
if (lpfc_els_chk_latt(vport)) if (lpfc_els_chk_latt(vport))
goto out; goto out;
...@@ -1488,15 +1465,11 @@ lpfc_cmpl_els_cmd(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb, ...@@ -1488,15 +1465,11 @@ lpfc_cmpl_els_cmd(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb,
"ELS cmd cmpl: status:x%x/x%x did:x%x", "ELS cmd cmpl: status:x%x/x%x did:x%x",
irsp->ulpStatus, irsp->un.ulpWord[4], irsp->ulpStatus, irsp->un.ulpWord[4],
irsp->un.elsreq64.remoteID); irsp->un.elsreq64.remoteID);
/* ELS cmd tag <ulpIoTag> completes */ /* ELS cmd tag <ulpIoTag> completes */
lpfc_printf_log(phba, KERN_INFO, LOG_ELS, lpfc_printf_vlog(vport, KERN_INFO, LOG_ELS,
"%d (%d):0106 ELS cmd tag x%x completes Data: x%x x%x " "0106 ELS cmd tag x%x completes Data: x%x x%x x%x\n",
"x%x\n", irsp->ulpIoTag, irsp->ulpStatus,
phba->brd_no, vport->vpi, irsp->un.ulpWord[4], irsp->ulpTimeout);
irsp->ulpIoTag, irsp->ulpStatus,
irsp->un.ulpWord[4], irsp->ulpTimeout);
/* Check to see if link went down during discovery */ /* Check to see if link went down during discovery */
lpfc_els_chk_latt(vport); lpfc_els_chk_latt(vport);
lpfc_els_free_iocb(phba, cmdiocb); lpfc_els_free_iocb(phba, cmdiocb);
...@@ -1831,9 +1804,9 @@ lpfc_els_retry(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb, ...@@ -1831,9 +1804,9 @@ lpfc_els_retry(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb,
case IOERR_ILLEGAL_COMMAND: case IOERR_ILLEGAL_COMMAND:
if ((phba->sli3_options & LPFC_SLI3_VPORT_TEARDOWN) && if ((phba->sli3_options & LPFC_SLI3_VPORT_TEARDOWN) &&
(cmd == ELS_CMD_FDISC)) { (cmd == ELS_CMD_FDISC)) {
lpfc_printf_log(phba, KERN_ERR, LOG_ELS, lpfc_printf_vlog(vport, KERN_ERR, LOG_ELS,
"%d (%d):0124 FDISC failed (3/6) retrying...\n", "0124 FDISC failed (3/6) "
phba->brd_no, vport->vpi); "retrying...\n");
lpfc_mbx_unreg_vpi(vport); lpfc_mbx_unreg_vpi(vport);
retry = 1; retry = 1;
/* Always retry for this case */ /* Always retry for this case */
...@@ -1898,10 +1871,10 @@ lpfc_els_retry(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb, ...@@ -1898,10 +1871,10 @@ lpfc_els_retry(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb,
if ((phba->sli3_options & LPFC_SLI3_NPIV_ENABLED) && if ((phba->sli3_options & LPFC_SLI3_NPIV_ENABLED) &&
(cmd == ELS_CMD_FDISC) && (cmd == ELS_CMD_FDISC) &&
(stat.un.b.lsRjtRsnCodeExp == LSEXP_OUT_OF_RESOURCE)){ (stat.un.b.lsRjtRsnCodeExp == LSEXP_OUT_OF_RESOURCE)){
lpfc_printf_log(phba, KERN_ERR, LOG_ELS, lpfc_printf_vlog(vport, KERN_ERR, LOG_ELS,
"%d (%d):0125 FDISC Failed (x%x)." "0125 FDISC Failed (x%x). "
" Fabric out of resources\n", "Fabric out of resources\n",
phba->brd_no, vport->vpi, stat.un.lsRjtError); stat.un.lsRjtError);
lpfc_vport_set_state(vport, lpfc_vport_set_state(vport,
FC_VPORT_NO_FABRIC_RSCS); FC_VPORT_NO_FABRIC_RSCS);
} }
...@@ -1926,10 +1899,10 @@ lpfc_els_retry(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb, ...@@ -1926,10 +1899,10 @@ lpfc_els_retry(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb,
((stat.un.b.lsRjtRsnCodeExp == LSEXP_INVALID_PNAME) || ((stat.un.b.lsRjtRsnCodeExp == LSEXP_INVALID_PNAME) ||
(stat.un.b.lsRjtRsnCodeExp == LSEXP_INVALID_NPORT_ID)) (stat.un.b.lsRjtRsnCodeExp == LSEXP_INVALID_NPORT_ID))
) { ) {
lpfc_printf_log(phba, KERN_ERR, LOG_ELS, lpfc_printf_vlog(vport, KERN_ERR, LOG_ELS,
"%d (%d):0123 FDISC Failed (x%x)." "0123 FDISC Failed (x%x). "
" Fabric Detected Bad WWN\n", "Fabric Detected Bad WWN\n",
phba->brd_no, vport->vpi, stat.un.lsRjtError); stat.un.lsRjtError);
lpfc_vport_set_state(vport, lpfc_vport_set_state(vport,
FC_VPORT_FABRIC_REJ_WWN); FC_VPORT_FABRIC_REJ_WWN);
} }
...@@ -1959,11 +1932,10 @@ lpfc_els_retry(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb, ...@@ -1959,11 +1932,10 @@ lpfc_els_retry(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb,
if (retry) { if (retry) {
/* Retry ELS command <elsCmd> to remote NPORT <did> */ /* Retry ELS command <elsCmd> to remote NPORT <did> */
lpfc_printf_log(phba, KERN_INFO, LOG_ELS, lpfc_printf_vlog(vport, KERN_INFO, LOG_ELS,
"%d (%d):0107 Retry ELS command x%x to remote " "0107 Retry ELS command x%x to remote "
"NPORT x%x Data: x%x x%x\n", "NPORT x%x Data: x%x x%x\n",
phba->brd_no, vport->vpi, cmd, did, cmdiocb->retry, delay);
cmd, did, cmdiocb->retry, delay);
if (((cmd == ELS_CMD_PLOGI) || (cmd == ELS_CMD_ADISC)) && if (((cmd == ELS_CMD_PLOGI) || (cmd == ELS_CMD_ADISC)) &&
((irsp->ulpStatus != IOSTAT_LOCAL_REJECT) || ((irsp->ulpStatus != IOSTAT_LOCAL_REJECT) ||
...@@ -2031,7 +2003,6 @@ lpfc_els_retry(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb, ...@@ -2031,7 +2003,6 @@ lpfc_els_retry(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb,
return 1; return 1;
} }
} }
/* No retry ELS command <elsCmd> to remote NPORT <did> */ /* No retry ELS command <elsCmd> to remote NPORT <did> */
lpfc_printf_vlog(vport, KERN_ERR, LOG_ELS, lpfc_printf_vlog(vport, KERN_ERR, LOG_ELS,
"0108 No retry ELS command x%x to remote " "0108 No retry ELS command x%x to remote "
...@@ -2086,14 +2057,12 @@ lpfc_cmpl_els_logo_acc(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb, ...@@ -2086,14 +2057,12 @@ lpfc_cmpl_els_logo_acc(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb,
lpfc_debugfs_disc_trc(vport, LPFC_DISC_TRC_ELS_RSP, lpfc_debugfs_disc_trc(vport, LPFC_DISC_TRC_ELS_RSP,
"ACC LOGO cmpl: status:x%x/x%x did:x%x", "ACC LOGO cmpl: status:x%x/x%x did:x%x",
irsp->ulpStatus, irsp->un.ulpWord[4], ndlp->nlp_DID); irsp->ulpStatus, irsp->un.ulpWord[4], ndlp->nlp_DID);
/* ACC to LOGO completes to NPort <nlp_DID> */ /* ACC to LOGO completes to NPort <nlp_DID> */
lpfc_printf_log(phba, KERN_INFO, LOG_ELS, lpfc_printf_vlog(vport, KERN_INFO, LOG_ELS,
"%d (%d):0109 ACC to LOGO completes to NPort x%x " "0109 ACC to LOGO completes to NPort x%x "
"Data: x%x x%x x%x\n", "Data: x%x x%x x%x\n",
phba->brd_no, vport->vpi, ndlp->nlp_DID, ndlp->nlp_DID, ndlp->nlp_flag, ndlp->nlp_state,
ndlp->nlp_flag, ndlp->nlp_state, ndlp->nlp_rpi); ndlp->nlp_rpi);
switch (ndlp->nlp_state) { switch (ndlp->nlp_state) {
case NLP_STE_UNUSED_NODE: /* node is just allocated */ case NLP_STE_UNUSED_NODE: /* node is just allocated */
lpfc_drop_node(vport, ndlp); lpfc_drop_node(vport, ndlp);
...@@ -2155,17 +2124,14 @@ lpfc_cmpl_els_rsp(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb, ...@@ -2155,17 +2124,14 @@ lpfc_cmpl_els_rsp(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb,
"ACC cmpl: status:x%x/x%x did:x%x", "ACC cmpl: status:x%x/x%x did:x%x",
irsp->ulpStatus, irsp->un.ulpWord[4], irsp->ulpStatus, irsp->un.ulpWord[4],
irsp->un.rcvels.remoteID); irsp->un.rcvels.remoteID);
/* ELS response tag <ulpIoTag> completes */ /* ELS response tag <ulpIoTag> completes */
lpfc_printf_log(phba, KERN_INFO, LOG_ELS, lpfc_printf_vlog(vport, KERN_INFO, LOG_ELS,
"%d (%d):0110 ELS response tag x%x completes " "0110 ELS response tag x%x completes "
"Data: x%x x%x x%x x%x x%x x%x x%x\n", "Data: x%x x%x x%x x%x x%x x%x x%x\n",
phba->brd_no, vport->vpi, cmdiocb->iocb.ulpIoTag, rspiocb->iocb.ulpStatus,
cmdiocb->iocb.ulpIoTag, rspiocb->iocb.ulpStatus, rspiocb->iocb.un.ulpWord[4], rspiocb->iocb.ulpTimeout,
rspiocb->iocb.un.ulpWord[4], rspiocb->iocb.ulpTimeout, ndlp->nlp_DID, ndlp->nlp_flag, ndlp->nlp_state,
ndlp->nlp_DID, ndlp->nlp_flag, ndlp->nlp_state, ndlp->nlp_rpi);
ndlp->nlp_rpi);
if (mbox) { if (mbox) {
if ((rspiocb->iocb.ulpStatus == 0) if ((rspiocb->iocb.ulpStatus == 0)
&& (ndlp->nlp_flag & NLP_ACC_REGLOGIN)) { && (ndlp->nlp_flag & NLP_ACC_REGLOGIN)) {
...@@ -2309,15 +2275,13 @@ lpfc_els_rsp_acc(struct lpfc_vport *vport, uint32_t flag, ...@@ -2309,15 +2275,13 @@ lpfc_els_rsp_acc(struct lpfc_vport *vport, uint32_t flag,
lpfc_nlp_put(ndlp); lpfc_nlp_put(ndlp);
elsiocb->context1 = NULL; elsiocb->context1 = NULL;
} }
/* Xmit ELS ACC response tag <ulpIoTag> */ /* Xmit ELS ACC response tag <ulpIoTag> */
lpfc_printf_log(phba, KERN_INFO, LOG_ELS, lpfc_printf_vlog(vport, KERN_INFO, LOG_ELS,
"%d (%d):0128 Xmit ELS ACC response tag x%x, XRI: x%x, " "0128 Xmit ELS ACC response tag x%x, XRI: x%x, "
"DID: x%x, nlp_flag: x%x nlp_state: x%x RPI: x%x\n", "DID: x%x, nlp_flag: x%x nlp_state: x%x RPI: x%x\n",
phba->brd_no, vport->vpi, elsiocb->iotag, elsiocb->iotag, elsiocb->iocb.ulpContext,
elsiocb->iocb.ulpContext, ndlp->nlp_DID, ndlp->nlp_DID, ndlp->nlp_flag, ndlp->nlp_state,
ndlp->nlp_flag, ndlp->nlp_state, ndlp->nlp_rpi); ndlp->nlp_rpi);
if (ndlp->nlp_flag & NLP_LOGO_ACC) { if (ndlp->nlp_flag & NLP_LOGO_ACC) {
spin_lock_irq(shost->host_lock); spin_lock_irq(shost->host_lock);
ndlp->nlp_flag &= ~NLP_LOGO_ACC; ndlp->nlp_flag &= ~NLP_LOGO_ACC;
...@@ -2375,14 +2339,13 @@ lpfc_els_rsp_reject(struct lpfc_vport *vport, uint32_t rejectError, ...@@ -2375,14 +2339,13 @@ lpfc_els_rsp_reject(struct lpfc_vport *vport, uint32_t rejectError,
} }
/* Xmit ELS RJT <err> response tag <ulpIoTag> */ /* Xmit ELS RJT <err> response tag <ulpIoTag> */
lpfc_printf_log(phba, KERN_INFO, LOG_ELS, lpfc_printf_vlog(vport, KERN_INFO, LOG_ELS,
"%d (%d):0129 Xmit ELS RJT x%x response tag x%x " "0129 Xmit ELS RJT x%x response tag x%x "
"xri x%x, did x%x, nlp_flag x%x, nlp_state x%x, " "xri x%x, did x%x, nlp_flag x%x, nlp_state x%x, "
"rpi x%x\n", "rpi x%x\n",
phba->brd_no, vport->vpi, rejectError, elsiocb->iotag, rejectError, elsiocb->iotag,
elsiocb->iocb.ulpContext, ndlp->nlp_DID, elsiocb->iocb.ulpContext, ndlp->nlp_DID,
ndlp->nlp_flag, ndlp->nlp_state, ndlp->nlp_rpi); ndlp->nlp_flag, ndlp->nlp_state, ndlp->nlp_rpi);
lpfc_debugfs_disc_trc(vport, LPFC_DISC_TRC_ELS_RSP, lpfc_debugfs_disc_trc(vport, LPFC_DISC_TRC_ELS_RSP,
"Issue LS_RJT: did:x%x flg:x%x err:x%x", "Issue LS_RJT: did:x%x flg:x%x err:x%x",
ndlp->nlp_DID, ndlp->nlp_flag, rejectError); ndlp->nlp_DID, ndlp->nlp_flag, rejectError);
...@@ -2422,13 +2385,12 @@ lpfc_els_rsp_adisc_acc(struct lpfc_vport *vport, struct lpfc_iocbq *oldiocb, ...@@ -2422,13 +2385,12 @@ lpfc_els_rsp_adisc_acc(struct lpfc_vport *vport, struct lpfc_iocbq *oldiocb,
icmd->ulpContext = oldcmd->ulpContext; /* Xri */ icmd->ulpContext = oldcmd->ulpContext; /* Xri */
/* Xmit ADISC ACC response tag <ulpIoTag> */ /* Xmit ADISC ACC response tag <ulpIoTag> */
lpfc_printf_log(phba, KERN_INFO, LOG_ELS, lpfc_printf_vlog(vport, KERN_INFO, LOG_ELS,
"%d (%d):0130 Xmit ADISC ACC response iotag x%x xri: " "0130 Xmit ADISC ACC response iotag x%x xri: "
"x%x, did x%x, nlp_flag x%x, nlp_state x%x rpi x%x\n", "x%x, did x%x, nlp_flag x%x, nlp_state x%x rpi x%x\n",
phba->brd_no, vport->vpi, elsiocb->iotag, elsiocb->iotag, elsiocb->iocb.ulpContext,
elsiocb->iocb.ulpContext, ndlp->nlp_DID, ndlp->nlp_DID, ndlp->nlp_flag, ndlp->nlp_state,
ndlp->nlp_flag, ndlp->nlp_state, ndlp->nlp_rpi); ndlp->nlp_rpi);
pcmd = (uint8_t *) (((struct lpfc_dmabuf *) elsiocb->context2)->virt); pcmd = (uint8_t *) (((struct lpfc_dmabuf *) elsiocb->context2)->virt);
*((uint32_t *) (pcmd)) = ELS_CMD_ACC; *((uint32_t *) (pcmd)) = ELS_CMD_ACC;
...@@ -2482,15 +2444,13 @@ lpfc_els_rsp_prli_acc(struct lpfc_vport *vport, struct lpfc_iocbq *oldiocb, ...@@ -2482,15 +2444,13 @@ lpfc_els_rsp_prli_acc(struct lpfc_vport *vport, struct lpfc_iocbq *oldiocb,
icmd = &elsiocb->iocb; icmd = &elsiocb->iocb;
oldcmd = &oldiocb->iocb; oldcmd = &oldiocb->iocb;
icmd->ulpContext = oldcmd->ulpContext; /* Xri */ icmd->ulpContext = oldcmd->ulpContext; /* Xri */
/* Xmit PRLI ACC response tag <ulpIoTag> */ /* Xmit PRLI ACC response tag <ulpIoTag> */
lpfc_printf_log(phba, KERN_INFO, LOG_ELS, lpfc_printf_vlog(vport, KERN_INFO, LOG_ELS,
"%d (%d):0131 Xmit PRLI ACC response tag x%x xri x%x, " "0131 Xmit PRLI ACC response tag x%x xri x%x, "
"did x%x, nlp_flag x%x, nlp_state x%x, rpi x%x\n", "did x%x, nlp_flag x%x, nlp_state x%x, rpi x%x\n",
phba->brd_no, vport->vpi, elsiocb->iotag, elsiocb->iotag, elsiocb->iocb.ulpContext,
elsiocb->iocb.ulpContext, ndlp->nlp_DID, ndlp->nlp_DID, ndlp->nlp_flag, ndlp->nlp_state,
ndlp->nlp_flag, ndlp->nlp_state, ndlp->nlp_rpi); ndlp->nlp_rpi);
pcmd = (uint8_t *) (((struct lpfc_dmabuf *) elsiocb->context2)->virt); pcmd = (uint8_t *) (((struct lpfc_dmabuf *) elsiocb->context2)->virt);
*((uint32_t *) (pcmd)) = (ELS_CMD_ACC | (ELS_CMD_PRLI & ~ELS_RSP_MASK)); *((uint32_t *) (pcmd)) = (ELS_CMD_ACC | (ELS_CMD_PRLI & ~ELS_RSP_MASK));
...@@ -2564,16 +2524,11 @@ lpfc_els_rsp_rnid_acc(struct lpfc_vport *vport, uint8_t format, ...@@ -2564,16 +2524,11 @@ lpfc_els_rsp_rnid_acc(struct lpfc_vport *vport, uint8_t format,
icmd = &elsiocb->iocb; icmd = &elsiocb->iocb;
oldcmd = &oldiocb->iocb; oldcmd = &oldiocb->iocb;
icmd->ulpContext = oldcmd->ulpContext; /* Xri */ icmd->ulpContext = oldcmd->ulpContext; /* Xri */
/* Xmit RNID ACC response tag <ulpIoTag> */ /* Xmit RNID ACC response tag <ulpIoTag> */
lpfc_printf_log(phba, KERN_INFO, LOG_ELS, lpfc_printf_vlog(vport, KERN_INFO, LOG_ELS,
"%d (%d):0132 Xmit RNID ACC response tag x%x " "0132 Xmit RNID ACC response tag x%x xri x%x\n",
"xri x%x\n", elsiocb->iotag, elsiocb->iocb.ulpContext);
phba->brd_no, vport->vpi, elsiocb->iotag,
elsiocb->iocb.ulpContext);
pcmd = (uint8_t *) (((struct lpfc_dmabuf *) elsiocb->context2)->virt); pcmd = (uint8_t *) (((struct lpfc_dmabuf *) elsiocb->context2)->virt);
*((uint32_t *) (pcmd)) = ELS_CMD_ACC; *((uint32_t *) (pcmd)) = ELS_CMD_ACC;
pcmd += sizeof(uint32_t); pcmd += sizeof(uint32_t);
...@@ -2716,7 +2671,6 @@ lpfc_rscn_payload_check(struct lpfc_vport *vport, uint32_t did) ...@@ -2716,7 +2671,6 @@ lpfc_rscn_payload_check(struct lpfc_vport *vport, uint32_t did)
D_ID rscn_did; D_ID rscn_did;
uint32_t *lp; uint32_t *lp;
uint32_t payload_len, i; uint32_t payload_len, i;
struct lpfc_hba *phba = vport->phba;
ns_did.un.word = did; ns_did.un.word = did;
...@@ -2751,12 +2705,10 @@ lpfc_rscn_payload_check(struct lpfc_vport *vport, uint32_t did) ...@@ -2751,12 +2705,10 @@ lpfc_rscn_payload_check(struct lpfc_vport *vport, uint32_t did)
break; break;
default: default:
/* Unknown Identifier in RSCN node */ /* Unknown Identifier in RSCN node */
lpfc_printf_log(phba, KERN_ERR, LOG_DISCOVERY, lpfc_printf_vlog(vport, KERN_ERR, LOG_DISCOVERY,
"%d (%d):0217 Unknown " "0217 Unknown Identifier in "
"Identifier in RSCN payload " "RSCN payload Data: x%x\n",
"Data: x%x\n", rscn_did.un.word);
phba->brd_no, vport->vpi,
rscn_did.un.word);
case 3: /* Whole Fabric effected */ case 3: /* Whole Fabric effected */
return did; return did;
} }
...@@ -2813,13 +2765,10 @@ lpfc_els_rcv_rscn(struct lpfc_vport *vport, struct lpfc_iocbq *cmdiocb, ...@@ -2813,13 +2765,10 @@ lpfc_els_rcv_rscn(struct lpfc_vport *vport, struct lpfc_iocbq *cmdiocb,
payload_len = be32_to_cpu(*lp++ & ~ELS_CMD_MASK); payload_len = be32_to_cpu(*lp++ & ~ELS_CMD_MASK);
payload_len -= sizeof(uint32_t); /* take off word 0 */ payload_len -= sizeof(uint32_t); /* take off word 0 */
/* RSCN received */ /* RSCN received */
lpfc_printf_log(phba, KERN_INFO, LOG_DISCOVERY, lpfc_printf_vlog(vport, KERN_INFO, LOG_DISCOVERY,
"%d (%d):0214 RSCN received Data: x%x x%x x%x x%x\n", "0214 RSCN received Data: x%x x%x x%x x%x\n",
phba->brd_no, vport->vpi, vport->fc_flag, payload_len, vport->fc_flag, payload_len, *lp, rscn_cnt);
*lp, rscn_cnt);
for (i = 0; i < payload_len/sizeof(uint32_t); i++) for (i = 0; i < payload_len/sizeof(uint32_t); i++)
fc_host_post_event(shost, fc_get_event_number(), fc_host_post_event(shost, fc_get_event_number(),
FCH_EVT_RSCN, lp[i]); FCH_EVT_RSCN, lp[i]);
...@@ -2854,11 +2803,11 @@ lpfc_els_rcv_rscn(struct lpfc_vport *vport, struct lpfc_iocbq *cmdiocb, ...@@ -2854,11 +2803,11 @@ lpfc_els_rcv_rscn(struct lpfc_vport *vport, struct lpfc_iocbq *cmdiocb,
} }
if (rscn_id == hba_id) { if (rscn_id == hba_id) {
/* ALL NPortIDs in RSCN are on HBA */ /* ALL NPortIDs in RSCN are on HBA */
lpfc_printf_log(phba, KERN_INFO, LOG_DISCOVERY, lpfc_printf_vlog(vport, KERN_INFO, LOG_DISCOVERY,
"%d (%d):0214 Ignore RSCN Data: x%x x%x x%x x%x\n", "0214 Ignore RSCN "
phba->brd_no, vport->vpi, vport->fc_flag, payload_len, "Data: x%x x%x x%x x%x\n",
*lp, rscn_cnt); vport->fc_flag, payload_len,
*lp, rscn_cnt);
lpfc_debugfs_disc_trc(vport, LPFC_DISC_TRC_ELS_UNSOL, lpfc_debugfs_disc_trc(vport, LPFC_DISC_TRC_ELS_UNSOL,
"RCV RSCN vport: did:x%x/ste:x%x flg:x%x", "RCV RSCN vport: did:x%x/ste:x%x flg:x%x",
ndlp->nlp_DID, vport->port_state, ndlp->nlp_DID, vport->port_state,
...@@ -2904,23 +2853,21 @@ lpfc_els_rcv_rscn(struct lpfc_vport *vport, struct lpfc_iocbq *cmdiocb, ...@@ -2904,23 +2853,21 @@ lpfc_els_rcv_rscn(struct lpfc_vport *vport, struct lpfc_iocbq *cmdiocb,
} }
/* Deferred RSCN */ /* Deferred RSCN */
lpfc_printf_log(phba, KERN_INFO, LOG_DISCOVERY, lpfc_printf_vlog(vport, KERN_INFO, LOG_DISCOVERY,
"%d (%d):0235 Deferred RSCN " "0235 Deferred RSCN "
"Data: x%x x%x x%x\n", "Data: x%x x%x x%x\n",
phba->brd_no, vport->vpi, vport->fc_rscn_id_cnt, vport->fc_flag,
vport->fc_rscn_id_cnt, vport->fc_flag, vport->port_state);
vport->port_state);
} else { } else {
spin_lock_irq(shost->host_lock); spin_lock_irq(shost->host_lock);
vport->fc_flag |= FC_RSCN_DISCOVERY; vport->fc_flag |= FC_RSCN_DISCOVERY;
spin_unlock_irq(shost->host_lock); spin_unlock_irq(shost->host_lock);
/* ReDiscovery RSCN */ /* ReDiscovery RSCN */
lpfc_printf_log(phba, KERN_INFO, LOG_DISCOVERY, lpfc_printf_vlog(vport, KERN_INFO, LOG_DISCOVERY,
"%d (%d):0234 ReDiscovery RSCN " "0234 ReDiscovery RSCN "
"Data: x%x x%x x%x\n", "Data: x%x x%x x%x\n",
phba->brd_no, vport->vpi, vport->fc_rscn_id_cnt, vport->fc_flag,
vport->fc_rscn_id_cnt, vport->fc_flag, vport->port_state);
vport->port_state);
} }
/* Send back ACC */ /* Send back ACC */
lpfc_els_rsp_acc(vport, ELS_CMD_ACC, cmdiocb, ndlp, NULL, lpfc_els_rsp_acc(vport, ELS_CMD_ACC, cmdiocb, ndlp, NULL,
...@@ -2973,11 +2920,10 @@ lpfc_els_handle_rscn(struct lpfc_vport *vport) ...@@ -2973,11 +2920,10 @@ lpfc_els_handle_rscn(struct lpfc_vport *vport)
lpfc_set_disctmo(vport); lpfc_set_disctmo(vport);
/* RSCN processed */ /* RSCN processed */
lpfc_printf_log(phba, KERN_INFO, LOG_DISCOVERY, lpfc_printf_vlog(vport, KERN_INFO, LOG_DISCOVERY,
"%d (%d):0215 RSCN processed Data: x%x x%x x%x x%x\n", "0215 RSCN processed Data: x%x x%x x%x x%x\n",
phba->brd_no, vport->vpi, vport->fc_flag, 0, vport->fc_rscn_id_cnt,
vport->fc_flag, 0, vport->fc_rscn_id_cnt, vport->port_state);
vport->port_state);
/* To process RSCN, first compare RSCN data with NameServer */ /* To process RSCN, first compare RSCN data with NameServer */
vport->fc_ns_retry = 0; vport->fc_ns_retry = 0;
...@@ -3045,10 +2991,10 @@ lpfc_els_rcv_flogi(struct lpfc_vport *vport, struct lpfc_iocbq *cmdiocb, ...@@ -3045,10 +2991,10 @@ lpfc_els_rcv_flogi(struct lpfc_vport *vport, struct lpfc_iocbq *cmdiocb,
/* An FLOGI ELS command <elsCmd> was received from DID <did> in /* An FLOGI ELS command <elsCmd> was received from DID <did> in
Loop Mode */ Loop Mode */
lpfc_printf_log(phba, KERN_ERR, LOG_ELS, lpfc_printf_vlog(vport, KERN_ERR, LOG_ELS,
"%d (%d):0113 An FLOGI ELS command x%x was " "0113 An FLOGI ELS command x%x was "
"received from DID x%x in Loop Mode\n", "received from DID x%x in Loop Mode\n",
phba->brd_no, vport->vpi, cmd, did); cmd, did);
return 1; return 1;
} }
...@@ -3219,16 +3165,13 @@ lpfc_els_rsp_rps_acc(struct lpfc_hba *phba, LPFC_MBOXQ_t *pmb) ...@@ -3219,16 +3165,13 @@ lpfc_els_rsp_rps_acc(struct lpfc_hba *phba, LPFC_MBOXQ_t *pmb)
rps_rsp->primSeqErrCnt = be32_to_cpu(mb->un.varRdLnk.primSeqErrCnt); rps_rsp->primSeqErrCnt = be32_to_cpu(mb->un.varRdLnk.primSeqErrCnt);
rps_rsp->invalidXmitWord = be32_to_cpu(mb->un.varRdLnk.invalidXmitWord); rps_rsp->invalidXmitWord = be32_to_cpu(mb->un.varRdLnk.invalidXmitWord);
rps_rsp->crcCnt = be32_to_cpu(mb->un.varRdLnk.crcCnt); rps_rsp->crcCnt = be32_to_cpu(mb->un.varRdLnk.crcCnt);
/* Xmit ELS RPS ACC response tag <ulpIoTag> */ /* Xmit ELS RPS ACC response tag <ulpIoTag> */
lpfc_printf_log(phba, KERN_INFO, LOG_ELS, lpfc_printf_vlog(ndlp->vport, KERN_INFO, LOG_ELS,
"%d (%d):0118 Xmit ELS RPS ACC response tag x%x " "0118 Xmit ELS RPS ACC response tag x%x xri x%x, "
"xri x%x, did x%x, nlp_flag x%x, nlp_state x%x, " "did x%x, nlp_flag x%x, nlp_state x%x, rpi x%x\n",
"rpi x%x\n", elsiocb->iotag, elsiocb->iocb.ulpContext,
phba->brd_no, ndlp->vport->vpi, elsiocb->iotag, ndlp->nlp_DID, ndlp->nlp_flag, ndlp->nlp_state,
elsiocb->iocb.ulpContext, ndlp->nlp_DID, ndlp->nlp_rpi);
ndlp->nlp_flag, ndlp->nlp_state, ndlp->nlp_rpi);
elsiocb->iocb_cmpl = lpfc_cmpl_els_rsp; elsiocb->iocb_cmpl = lpfc_cmpl_els_rsp;
phba->fc_stat.elsXmitACC++; phba->fc_stat.elsXmitACC++;
if (lpfc_sli_issue_iocb(phba, pring, elsiocb, 0) == IOCB_ERROR) if (lpfc_sli_issue_iocb(phba, pring, elsiocb, 0) == IOCB_ERROR)
...@@ -3330,21 +3273,16 @@ lpfc_els_rsp_rpl_acc(struct lpfc_vport *vport, uint16_t cmdsize, ...@@ -3330,21 +3273,16 @@ lpfc_els_rsp_rpl_acc(struct lpfc_vport *vport, uint16_t cmdsize,
rpl_rsp.port_num_blk.portID = be32_to_cpu(vport->fc_myDID); rpl_rsp.port_num_blk.portID = be32_to_cpu(vport->fc_myDID);
memcpy(&rpl_rsp.port_num_blk.portName, &vport->fc_portname, memcpy(&rpl_rsp.port_num_blk.portName, &vport->fc_portname,
sizeof(struct lpfc_name)); sizeof(struct lpfc_name));
memcpy(pcmd, &rpl_rsp, cmdsize - sizeof(uint32_t)); memcpy(pcmd, &rpl_rsp, cmdsize - sizeof(uint32_t));
/* Xmit ELS RPL ACC response tag <ulpIoTag> */ /* Xmit ELS RPL ACC response tag <ulpIoTag> */
lpfc_printf_log(phba, KERN_INFO, LOG_ELS, lpfc_printf_vlog(vport, KERN_INFO, LOG_ELS,
"%d (%d):0120 Xmit ELS RPL ACC response tag x%x " "0120 Xmit ELS RPL ACC response tag x%x "
"xri x%x, did x%x, nlp_flag x%x, nlp_state x%x, " "xri x%x, did x%x, nlp_flag x%x, nlp_state x%x, "
"rpi x%x\n", "rpi x%x\n",
phba->brd_no, vport->vpi, elsiocb->iotag, elsiocb->iotag, elsiocb->iocb.ulpContext,
elsiocb->iocb.ulpContext, ndlp->nlp_DID, ndlp->nlp_DID, ndlp->nlp_flag, ndlp->nlp_state,
ndlp->nlp_flag, ndlp->nlp_state, ndlp->nlp_rpi); ndlp->nlp_rpi);
elsiocb->iocb_cmpl = lpfc_cmpl_els_rsp; elsiocb->iocb_cmpl = lpfc_cmpl_els_rsp;
phba->fc_stat.elsXmitACC++; phba->fc_stat.elsXmitACC++;
if (lpfc_sli_issue_iocb(phba, pring, elsiocb, 0) == IOCB_ERROR) { if (lpfc_sli_issue_iocb(phba, pring, elsiocb, 0) == IOCB_ERROR) {
lpfc_els_free_iocb(phba, elsiocb); lpfc_els_free_iocb(phba, elsiocb);
...@@ -3397,7 +3335,6 @@ static int ...@@ -3397,7 +3335,6 @@ static int
lpfc_els_rcv_farp(struct lpfc_vport *vport, struct lpfc_iocbq *cmdiocb, lpfc_els_rcv_farp(struct lpfc_vport *vport, struct lpfc_iocbq *cmdiocb,
struct lpfc_nodelist *ndlp) struct lpfc_nodelist *ndlp)
{ {
struct lpfc_hba *phba = vport->phba;
struct lpfc_dmabuf *pcmd; struct lpfc_dmabuf *pcmd;
uint32_t *lp; uint32_t *lp;
IOCB_t *icmd; IOCB_t *icmd;
...@@ -3411,12 +3348,9 @@ lpfc_els_rcv_farp(struct lpfc_vport *vport, struct lpfc_iocbq *cmdiocb, ...@@ -3411,12 +3348,9 @@ lpfc_els_rcv_farp(struct lpfc_vport *vport, struct lpfc_iocbq *cmdiocb,
cmd = *lp++; cmd = *lp++;
fp = (FARP *) lp; fp = (FARP *) lp;
/* FARP-REQ received from DID <did> */ /* FARP-REQ received from DID <did> */
lpfc_printf_log(phba, KERN_INFO, LOG_ELS, lpfc_printf_vlog(vport, KERN_INFO, LOG_ELS,
"%d (%d):0601 FARP-REQ received from DID x%x\n", "0601 FARP-REQ received from DID x%x\n", did);
phba->brd_no, vport->vpi, did);
/* We will only support match on WWPN or WWNN */ /* We will only support match on WWPN or WWNN */
if (fp->Mflags & ~(FARP_MATCH_NODE | FARP_MATCH_PORT)) { if (fp->Mflags & ~(FARP_MATCH_NODE | FARP_MATCH_PORT)) {
return 0; return 0;
...@@ -3464,7 +3398,6 @@ lpfc_els_rcv_farpr(struct lpfc_vport *vport, struct lpfc_iocbq *cmdiocb, ...@@ -3464,7 +3398,6 @@ lpfc_els_rcv_farpr(struct lpfc_vport *vport, struct lpfc_iocbq *cmdiocb,
uint32_t *lp; uint32_t *lp;
IOCB_t *icmd; IOCB_t *icmd;
uint32_t cmd, did; uint32_t cmd, did;
struct lpfc_hba *phba = vport->phba;
icmd = &cmdiocb->iocb; icmd = &cmdiocb->iocb;
did = icmd->un.elsreq64.remoteID; did = icmd->un.elsreq64.remoteID;
...@@ -3473,9 +3406,8 @@ lpfc_els_rcv_farpr(struct lpfc_vport *vport, struct lpfc_iocbq *cmdiocb, ...@@ -3473,9 +3406,8 @@ lpfc_els_rcv_farpr(struct lpfc_vport *vport, struct lpfc_iocbq *cmdiocb,
cmd = *lp++; cmd = *lp++;
/* FARP-RSP received from DID <did> */ /* FARP-RSP received from DID <did> */
lpfc_printf_log(phba, KERN_INFO, LOG_ELS, lpfc_printf_vlog(vport, KERN_INFO, LOG_ELS,
"%d (%d):0600 FARP-RSP received from DID x%x\n", "0600 FARP-RSP received from DID x%x\n", did);
phba->brd_no, vport->vpi, did);
/* ACCEPT the Farp resp request */ /* ACCEPT the Farp resp request */
lpfc_els_rsp_acc(vport, ELS_CMD_ACC, cmdiocb, ndlp, NULL, 0); lpfc_els_rsp_acc(vport, ELS_CMD_ACC, cmdiocb, ndlp, NULL, 0);
...@@ -3495,10 +3427,8 @@ lpfc_els_rcv_fan(struct lpfc_vport *vport, struct lpfc_iocbq *cmdiocb, ...@@ -3495,10 +3427,8 @@ lpfc_els_rcv_fan(struct lpfc_vport *vport, struct lpfc_iocbq *cmdiocb,
struct lpfc_hba *phba = vport->phba; struct lpfc_hba *phba = vport->phba;
/* FAN received */ /* FAN received */
lpfc_printf_log(phba, KERN_INFO, LOG_ELS, lpfc_printf_vlog(vport, KERN_INFO, LOG_ELS,
"%d (%d):0265 FAN received\n", "0265 FAN received\n");
phba->brd_no, vport->vpi);
icmd = &cmdiocb->iocb; icmd = &cmdiocb->iocb;
did = icmd->un.elsreq64.remoteID; did = icmd->un.elsreq64.remoteID;
pcmd = (struct lpfc_dmabuf *)cmdiocb->context2; pcmd = (struct lpfc_dmabuf *)cmdiocb->context2;
...@@ -3657,13 +3587,10 @@ lpfc_els_timeout_handler(struct lpfc_vport *vport) ...@@ -3657,13 +3587,10 @@ lpfc_els_timeout_handler(struct lpfc_vport *vport)
if (ndlp) if (ndlp)
remote_ID = ndlp->nlp_DID; remote_ID = ndlp->nlp_DID;
} }
lpfc_printf_vlog(vport, KERN_ERR, LOG_ELS,
lpfc_printf_log(phba, KERN_ERR, LOG_ELS, "0127 ELS timeout Data: x%x x%x x%x "
"%d (%d):0127 ELS timeout Data: x%x x%x x%x " "x%x\n", els_command,
"x%x\n", remote_ID, cmd->ulpCommand, cmd->ulpIoTag);
phba->brd_no, vport->vpi, els_command,
remote_ID, cmd->ulpCommand, cmd->ulpIoTag);
lpfc_sli_issue_abort_iotag(phba, pring, piocb); lpfc_sli_issue_abort_iotag(phba, pring, piocb);
} }
spin_unlock_irq(&phba->hbalock); spin_unlock_irq(&phba->hbalock);
...@@ -3838,11 +3765,9 @@ lpfc_els_unsol_buffer(struct lpfc_hba *phba, struct lpfc_sli_ring *pring, ...@@ -3838,11 +3765,9 @@ lpfc_els_unsol_buffer(struct lpfc_hba *phba, struct lpfc_sli_ring *pring,
cmd &= ELS_CMD_MASK; cmd &= ELS_CMD_MASK;
} }
/* ELS command <elsCmd> received from NPORT <did> */ /* ELS command <elsCmd> received from NPORT <did> */
lpfc_printf_log(phba, KERN_INFO, LOG_ELS, lpfc_printf_vlog(vport, KERN_INFO, LOG_ELS,
"%d (%d):0112 ELS command x%x received from NPORT x%x " "0112 ELS command x%x received from NPORT x%x "
"Data: x%x\n", phba->brd_no, vport->vpi, cmd, did, "Data: x%x\n", cmd, did, vport->port_state);
vport->port_state);
switch (cmd) { switch (cmd) {
case ELS_CMD_PLOGI: case ELS_CMD_PLOGI:
lpfc_debugfs_disc_trc(vport, LPFC_DISC_TRC_ELS_UNSOL, lpfc_debugfs_disc_trc(vport, LPFC_DISC_TRC_ELS_UNSOL,
...@@ -4011,10 +3936,9 @@ lpfc_els_unsol_buffer(struct lpfc_hba *phba, struct lpfc_sli_ring *pring, ...@@ -4011,10 +3936,9 @@ lpfc_els_unsol_buffer(struct lpfc_hba *phba, struct lpfc_sli_ring *pring,
rjt_err = LSRJT_INVALID_CMD; rjt_err = LSRJT_INVALID_CMD;
/* Unknown ELS command <elsCmd> received from NPORT <did> */ /* Unknown ELS command <elsCmd> received from NPORT <did> */
lpfc_printf_log(phba, KERN_ERR, LOG_ELS, lpfc_printf_vlog(vport, KERN_ERR, LOG_ELS,
"%d (%d):0115 Unknown ELS command x%x " "0115 Unknown ELS command x%x "
"received from NPORT x%x\n", "received from NPORT x%x\n", cmd, did);
phba->brd_no, vport->vpi, cmd, did);
if (newnode) if (newnode)
lpfc_drop_node(vport, ndlp); lpfc_drop_node(vport, ndlp);
break; break;
...@@ -4035,11 +3959,10 @@ lpfc_els_unsol_buffer(struct lpfc_hba *phba, struct lpfc_sli_ring *pring, ...@@ -4035,11 +3959,10 @@ lpfc_els_unsol_buffer(struct lpfc_hba *phba, struct lpfc_sli_ring *pring,
dropit: dropit:
lpfc_printf_log(phba, KERN_ERR, LOG_ELS, lpfc_printf_log(phba, KERN_ERR, LOG_ELS,
"%d (%d):0111 Dropping received ELS cmd " "(%d):0111 Dropping received ELS cmd "
"Data: x%x x%x x%x\n", "Data: x%x x%x x%x\n",
phba->brd_no, vport ? vport->vpi : 0xffff, vport ? vport->vpi : 0xffff, icmd->ulpStatus,
icmd->ulpStatus, icmd->un.ulpWord[4], icmd->un.ulpWord[4], icmd->ulpTimeout);
icmd->ulpTimeout);
phba->fc_stat.elsRcvDrop++; phba->fc_stat.elsRcvDrop++;
} }
...@@ -4151,9 +4074,8 @@ lpfc_do_scr_ns_plogi(struct lpfc_hba *phba, struct lpfc_vport *vport) ...@@ -4151,9 +4074,8 @@ lpfc_do_scr_ns_plogi(struct lpfc_hba *phba, struct lpfc_vport *vport)
return; return;
} }
lpfc_vport_set_state(vport, FC_VPORT_FAILED); lpfc_vport_set_state(vport, FC_VPORT_FAILED);
lpfc_printf_log(phba, KERN_ERR, LOG_ELS, lpfc_printf_vlog(vport, KERN_ERR, LOG_ELS,
"%d (%d):0251 NameServer login: no memory\n", "0251 NameServer login: no memory\n");
phba->brd_no, vport->vpi);
return; return;
} }
lpfc_nlp_init(vport, ndlp, NameServer_DID); lpfc_nlp_init(vport, ndlp, NameServer_DID);
...@@ -4164,9 +4086,8 @@ lpfc_do_scr_ns_plogi(struct lpfc_hba *phba, struct lpfc_vport *vport) ...@@ -4164,9 +4086,8 @@ lpfc_do_scr_ns_plogi(struct lpfc_hba *phba, struct lpfc_vport *vport)
if (lpfc_issue_els_plogi(vport, ndlp->nlp_DID, 0)) { if (lpfc_issue_els_plogi(vport, ndlp->nlp_DID, 0)) {
lpfc_vport_set_state(vport, FC_VPORT_FAILED); lpfc_vport_set_state(vport, FC_VPORT_FAILED);
lpfc_printf_log(phba, KERN_ERR, LOG_ELS, lpfc_printf_vlog(vport, KERN_ERR, LOG_ELS,
"%d (%d):0252 Cannot issue NameServer login\n", "0252 Cannot issue NameServer login\n");
phba->brd_no, vport->vpi);
return; return;
} }
...@@ -4197,9 +4118,9 @@ lpfc_cmpl_reg_new_vport(struct lpfc_hba *phba, LPFC_MBOXQ_t *pmb) ...@@ -4197,9 +4118,9 @@ lpfc_cmpl_reg_new_vport(struct lpfc_hba *phba, LPFC_MBOXQ_t *pmb)
lpfc_nlp_put(ndlp); lpfc_nlp_put(ndlp);
if (mb->mbxStatus) { if (mb->mbxStatus) {
lpfc_printf_log(phba, KERN_ERR, LOG_MBOX, lpfc_printf_vlog(vport, KERN_ERR, LOG_MBOX,
"%d (%d):0915 Register VPI failed: 0x%x\n", "0915 Register VPI failed: 0x%x\n",
phba->brd_no, vport->vpi, mb->mbxStatus); mb->mbxStatus);
switch (mb->mbxStatus) { switch (mb->mbxStatus) {
case 0x11: /* unsupported feature */ case 0x11: /* unsupported feature */
...@@ -4248,17 +4169,14 @@ lpfc_register_new_vport(struct lpfc_hba *phba, struct lpfc_vport *vport, ...@@ -4248,17 +4169,14 @@ lpfc_register_new_vport(struct lpfc_hba *phba, struct lpfc_vport *vport,
vport->fc_flag &= ~FC_VPORT_NEEDS_REG_VPI; vport->fc_flag &= ~FC_VPORT_NEEDS_REG_VPI;
lpfc_vport_set_state(vport, FC_VPORT_FAILED); lpfc_vport_set_state(vport, FC_VPORT_FAILED);
lpfc_printf_vlog(vport, KERN_ERR, LOG_MBOX,
lpfc_printf_log(phba, KERN_ERR, LOG_MBOX, "0253 Register VPI: Can't send mbox\n");
"%d (%d):0253 Register VPI: Cannot send mbox\n",
phba->brd_no, vport->vpi);
} }
} else { } else {
lpfc_vport_set_state(vport, FC_VPORT_FAILED); lpfc_vport_set_state(vport, FC_VPORT_FAILED);
lpfc_printf_log(phba, KERN_ERR, LOG_MBOX, lpfc_printf_vlog(vport, KERN_ERR, LOG_MBOX,
"%d (%d):0254 Register VPI: no memory\n", "0254 Register VPI: no memory\n");
phba->brd_no, vport->vpi);
vport->fc_flag &= ~FC_VPORT_NEEDS_REG_VPI; vport->fc_flag &= ~FC_VPORT_NEEDS_REG_VPI;
lpfc_nlp_put(ndlp); lpfc_nlp_put(ndlp);
...@@ -4277,11 +4195,10 @@ lpfc_cmpl_els_fdisc(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb, ...@@ -4277,11 +4195,10 @@ lpfc_cmpl_els_fdisc(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb,
IOCB_t *irsp = &rspiocb->iocb; IOCB_t *irsp = &rspiocb->iocb;
struct lpfc_iocbq *piocb; struct lpfc_iocbq *piocb;
lpfc_printf_log(phba, KERN_INFO, LOG_ELS, lpfc_printf_vlog(vport, KERN_INFO, LOG_ELS,
"%d (%d):0123 FDISC completes. x%x/x%x prevDID: x%x\n", "0123 FDISC completes. x%x/x%x prevDID: x%x\n",
phba->brd_no, vport->vpi, irsp->ulpStatus, irsp->un.ulpWord[4],
irsp->ulpStatus, irsp->un.ulpWord[4], vport->fc_prevDID); vport->fc_prevDID);
/* Since all FDISCs are being single threaded, we /* Since all FDISCs are being single threaded, we
* must reset the discovery timer for ALL vports * must reset the discovery timer for ALL vports
* waiting to send FDISC when one completes. * waiting to send FDISC when one completes.
...@@ -4298,13 +4215,10 @@ lpfc_cmpl_els_fdisc(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb, ...@@ -4298,13 +4215,10 @@ lpfc_cmpl_els_fdisc(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb,
/* Check for retry */ /* Check for retry */
if (lpfc_els_retry(phba, cmdiocb, rspiocb)) if (lpfc_els_retry(phba, cmdiocb, rspiocb))
goto out; goto out;
/* FDISC failed */ /* FDISC failed */
lpfc_printf_log(phba, KERN_ERR, LOG_ELS, lpfc_printf_vlog(vport, KERN_ERR, LOG_ELS,
"%d (%d):0124 FDISC failed. (%d/%d)\n", "0124 FDISC failed. (%d/%d)\n",
phba->brd_no, vport->vpi, irsp->ulpStatus, irsp->un.ulpWord[4]);
irsp->ulpStatus, irsp->un.ulpWord[4]);
if (vport->fc_vport->vport_state == FC_VPORT_INITIALIZING) if (vport->fc_vport->vport_state == FC_VPORT_INITIALIZING)
lpfc_vport_set_state(vport, FC_VPORT_FAILED); lpfc_vport_set_state(vport, FC_VPORT_FAILED);
...@@ -4370,10 +4284,8 @@ lpfc_issue_els_fdisc(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp, ...@@ -4370,10 +4284,8 @@ lpfc_issue_els_fdisc(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp,
ELS_CMD_FDISC); ELS_CMD_FDISC);
if (!elsiocb) { if (!elsiocb) {
lpfc_vport_set_state(vport, FC_VPORT_FAILED); lpfc_vport_set_state(vport, FC_VPORT_FAILED);
lpfc_printf_vlog(vport, KERN_ERR, LOG_ELS,
lpfc_printf_log(phba, KERN_ERR, LOG_ELS, "0255 Issue FDISC: no IOCB\n");
"%d (%d):0255 Issue FDISC: no IOCB\n",
phba->brd_no, vport->vpi);
return 1; return 1;
} }
...@@ -4419,11 +4331,8 @@ lpfc_issue_els_fdisc(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp, ...@@ -4419,11 +4331,8 @@ lpfc_issue_els_fdisc(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp,
if (rc == IOCB_ERROR) { if (rc == IOCB_ERROR) {
lpfc_els_free_iocb(phba, elsiocb); lpfc_els_free_iocb(phba, elsiocb);
lpfc_vport_set_state(vport, FC_VPORT_FAILED); lpfc_vport_set_state(vport, FC_VPORT_FAILED);
lpfc_printf_vlog(vport, KERN_ERR, LOG_ELS,
lpfc_printf_log(phba, KERN_ERR, LOG_ELS, "0256 Issue FDISC: Cannot send IOCB\n");
"%d (%d):0256 Issue FDISC: Cannot send IOCB\n",
phba->brd_no, vport->vpi);
return 1; return 1;
} }
lpfc_vport_set_state(vport, FC_VPORT_INITIALIZING); lpfc_vport_set_state(vport, FC_VPORT_INITIALIZING);
......
...@@ -201,25 +201,23 @@ lpfc_dev_loss_tmo_handler(struct lpfc_nodelist *ndlp) ...@@ -201,25 +201,23 @@ lpfc_dev_loss_tmo_handler(struct lpfc_nodelist *ndlp)
warn_on = 0; warn_on = 0;
if (warn_on) { if (warn_on) {
lpfc_printf_log(phba, KERN_ERR, LOG_DISCOVERY, lpfc_printf_vlog(vport, KERN_ERR, LOG_DISCOVERY,
"%d (%d):0203 Devloss timeout on " "0203 Devloss timeout on "
"WWPN %x:%x:%x:%x:%x:%x:%x:%x " "WWPN %x:%x:%x:%x:%x:%x:%x:%x "
"NPort x%x Data: x%x x%x x%x\n", "NPort x%x Data: x%x x%x x%x\n",
phba->brd_no, vport->vpi, *name, *(name+1), *(name+2), *(name+3),
*name, *(name+1), *(name+2), *(name+3), *(name+4), *(name+5), *(name+6), *(name+7),
*(name+4), *(name+5), *(name+6), *(name+7), ndlp->nlp_DID, ndlp->nlp_flag,
ndlp->nlp_DID, ndlp->nlp_flag, ndlp->nlp_state, ndlp->nlp_rpi);
ndlp->nlp_state, ndlp->nlp_rpi);
} else { } else {
lpfc_printf_log(phba, KERN_INFO, LOG_DISCOVERY, lpfc_printf_vlog(vport, KERN_INFO, LOG_DISCOVERY,
"%d (%d):0204 Devloss timeout on " "0204 Devloss timeout on "
"WWPN %x:%x:%x:%x:%x:%x:%x:%x " "WWPN %x:%x:%x:%x:%x:%x:%x:%x "
"NPort x%x Data: x%x x%x x%x\n", "NPort x%x Data: x%x x%x x%x\n",
phba->brd_no, vport->vpi, *name, *(name+1), *(name+2), *(name+3),
*name, *(name+1), *(name+2), *(name+3), *(name+4), *(name+5), *(name+6), *(name+7),
*(name+4), *(name+5), *(name+6), *(name+7), ndlp->nlp_DID, ndlp->nlp_flag,
ndlp->nlp_DID, ndlp->nlp_flag, ndlp->nlp_state, ndlp->nlp_rpi);
ndlp->nlp_state, ndlp->nlp_rpi);
} }
if (!(vport->load_flag & FC_UNLOADING) && if (!(vport->load_flag & FC_UNLOADING) &&
...@@ -750,12 +748,10 @@ lpfc_mbx_cmpl_clear_la(struct lpfc_hba *phba, LPFC_MBOXQ_t *pmb) ...@@ -750,12 +748,10 @@ lpfc_mbx_cmpl_clear_la(struct lpfc_hba *phba, LPFC_MBOXQ_t *pmb)
/* Check for error */ /* Check for error */
if ((mb->mbxStatus) && (mb->mbxStatus != 0x1601)) { if ((mb->mbxStatus) && (mb->mbxStatus != 0x1601)) {
/* CLEAR_LA mbox error <mbxStatus> state <hba_state> */ /* CLEAR_LA mbox error <mbxStatus> state <hba_state> */
lpfc_printf_log(phba, KERN_ERR, LOG_MBOX, lpfc_printf_vlog(vport, KERN_ERR, LOG_MBOX,
"%d (%d):0320 CLEAR_LA mbxStatus error x%x hba " "0320 CLEAR_LA mbxStatus error x%x hba "
"state x%x\n", "state x%x\n",
phba->brd_no, vport->vpi, mb->mbxStatus, mb->mbxStatus, vport->port_state);
vport->port_state);
phba->link_state = LPFC_HBA_ERROR; phba->link_state = LPFC_HBA_ERROR;
goto out; goto out;
} }
...@@ -787,10 +783,8 @@ lpfc_mbx_cmpl_clear_la(struct lpfc_hba *phba, LPFC_MBOXQ_t *pmb) ...@@ -787,10 +783,8 @@ lpfc_mbx_cmpl_clear_la(struct lpfc_hba *phba, LPFC_MBOXQ_t *pmb)
out: out:
/* Device Discovery completes */ /* Device Discovery completes */
lpfc_printf_log(phba, KERN_INFO, LOG_DISCOVERY, lpfc_printf_vlog(vport, KERN_INFO, LOG_DISCOVERY,
"%d (%d):0225 Device Discovery completes\n", "0225 Device Discovery completes\n");
phba->brd_no, vport->vpi);
mempool_free(pmb, phba->mbox_mem_pool); mempool_free(pmb, phba->mbox_mem_pool);
spin_lock_irq(shost->host_lock); spin_lock_irq(shost->host_lock);
...@@ -847,19 +841,17 @@ lpfc_mbx_cmpl_local_config_link(struct lpfc_hba *phba, LPFC_MBOXQ_t *pmb) ...@@ -847,19 +841,17 @@ lpfc_mbx_cmpl_local_config_link(struct lpfc_hba *phba, LPFC_MBOXQ_t *pmb)
return; return;
out: out:
lpfc_printf_log(phba, KERN_ERR, LOG_MBOX, lpfc_printf_vlog(vport, KERN_ERR, LOG_MBOX,
"%d (%d):0306 CONFIG_LINK mbxStatus error x%x " "0306 CONFIG_LINK mbxStatus error x%x "
"HBA state x%x\n", "HBA state x%x\n",
phba->brd_no, vport->vpi, pmb->mb.mbxStatus, pmb->mb.mbxStatus, vport->port_state);
vport->port_state);
mempool_free(pmb, phba->mbox_mem_pool); mempool_free(pmb, phba->mbox_mem_pool);
lpfc_linkdown(phba); lpfc_linkdown(phba);
lpfc_printf_log(phba, KERN_ERR, LOG_DISCOVERY, lpfc_printf_vlog(vport, KERN_ERR, LOG_DISCOVERY,
"%d (%d):0200 CONFIG_LINK bad hba state x%x\n", "0200 CONFIG_LINK bad hba state x%x\n",
phba->brd_no, vport->vpi, vport->port_state); vport->port_state);
lpfc_issue_clear_la(phba, vport); lpfc_issue_clear_la(phba, vport);
return; return;
...@@ -876,12 +868,10 @@ lpfc_mbx_cmpl_read_sparam(struct lpfc_hba *phba, LPFC_MBOXQ_t *pmb) ...@@ -876,12 +868,10 @@ lpfc_mbx_cmpl_read_sparam(struct lpfc_hba *phba, LPFC_MBOXQ_t *pmb)
/* Check for error */ /* Check for error */
if (mb->mbxStatus) { if (mb->mbxStatus) {
/* READ_SPARAM mbox error <mbxStatus> state <hba_state> */ /* READ_SPARAM mbox error <mbxStatus> state <hba_state> */
lpfc_printf_log(phba, KERN_ERR, LOG_MBOX, lpfc_printf_vlog(vport, KERN_ERR, LOG_MBOX,
"%d (%d):0319 READ_SPARAM mbxStatus error x%x " "0319 READ_SPARAM mbxStatus error x%x "
"hba state x%x>\n", "hba state x%x>\n",
phba->brd_no, vport->vpi, mb->mbxStatus, mb->mbxStatus, vport->port_state);
vport->port_state);
lpfc_linkdown(phba); lpfc_linkdown(phba);
goto out; goto out;
} }
...@@ -964,7 +954,7 @@ lpfc_mbx_process_link_up(struct lpfc_hba *phba, READ_LA_VAR *la) ...@@ -964,7 +954,7 @@ lpfc_mbx_process_link_up(struct lpfc_hba *phba, READ_LA_VAR *la)
if (i == 0) { if (i == 0) {
phba->alpa_map[0] = 0; phba->alpa_map[0] = 0;
} else { } else {
if (phba->cfg_log_verbose & LOG_LINK_EVENT) { if (vport->cfg_log_verbose & LOG_LINK_EVENT) {
int numalpa, j, k; int numalpa, j, k;
union { union {
uint8_t pamap[16]; uint8_t pamap[16];
...@@ -990,10 +980,9 @@ lpfc_mbx_process_link_up(struct lpfc_hba *phba, READ_LA_VAR *la) ...@@ -990,10 +980,9 @@ lpfc_mbx_process_link_up(struct lpfc_hba *phba, READ_LA_VAR *la)
lpfc_printf_log(phba, lpfc_printf_log(phba,
KERN_WARNING, KERN_WARNING,
LOG_LINK_EVENT, LOG_LINK_EVENT,
"%d:1304 Link Up Event " "1304 Link Up Event "
"ALPA map Data: x%x " "ALPA map Data: x%x "
"x%x x%x x%x\n", "x%x x%x x%x\n",
phba->brd_no,
un.pa.wd1, un.pa.wd2, un.pa.wd1, un.pa.wd2,
un.pa.wd3, un.pa.wd4); un.pa.wd3, un.pa.wd4);
} }
...@@ -1041,11 +1030,9 @@ lpfc_mbx_process_link_up(struct lpfc_hba *phba, READ_LA_VAR *la) ...@@ -1041,11 +1030,9 @@ lpfc_mbx_process_link_up(struct lpfc_hba *phba, READ_LA_VAR *la)
} }
out: out:
lpfc_vport_set_state(vport, FC_VPORT_FAILED); lpfc_vport_set_state(vport, FC_VPORT_FAILED);
lpfc_printf_log(phba, KERN_ERR, LOG_MBOX, lpfc_printf_vlog(vport, KERN_ERR, LOG_MBOX,
"%d (%d):0263 Discovery Mailbox error: state: 0x%x : %p %p\n", "0263 Discovery Mailbox error: state: 0x%x : %p %p\n",
phba->brd_no, vport->vpi, vport->port_state, sparam_mbox, cfglink_mbox);
vport->port_state, sparam_mbox, cfglink_mbox);
lpfc_issue_clear_la(phba, vport); lpfc_issue_clear_la(phba, vport);
return; return;
} }
...@@ -1086,8 +1073,8 @@ lpfc_mbx_cmpl_read_la(struct lpfc_hba *phba, LPFC_MBOXQ_t *pmb) ...@@ -1086,8 +1073,8 @@ lpfc_mbx_cmpl_read_la(struct lpfc_hba *phba, LPFC_MBOXQ_t *pmb)
/* Check for error */ /* Check for error */
if (mb->mbxStatus) { if (mb->mbxStatus) {
lpfc_printf_log(phba, KERN_INFO, LOG_LINK_EVENT, lpfc_printf_log(phba, KERN_INFO, LOG_LINK_EVENT,
"%d:1307 READ_LA mbox error x%x state x%x\n", "1307 READ_LA mbox error x%x state x%x\n",
phba->brd_no, mb->mbxStatus, vport->port_state); mb->mbxStatus, vport->port_state);
lpfc_mbx_issue_link_down(phba); lpfc_mbx_issue_link_down(phba);
phba->link_state = LPFC_HBA_ERROR; phba->link_state = LPFC_HBA_ERROR;
goto lpfc_mbx_cmpl_read_la_free_mbuf; goto lpfc_mbx_cmpl_read_la_free_mbuf;
...@@ -1118,26 +1105,26 @@ lpfc_mbx_cmpl_read_la(struct lpfc_hba *phba, LPFC_MBOXQ_t *pmb) ...@@ -1118,26 +1105,26 @@ lpfc_mbx_cmpl_read_la(struct lpfc_hba *phba, LPFC_MBOXQ_t *pmb)
phba->fc_stat.LinkUp++; phba->fc_stat.LinkUp++;
if (phba->link_flag & LS_LOOPBACK_MODE) { if (phba->link_flag & LS_LOOPBACK_MODE) {
lpfc_printf_log(phba, KERN_INFO, LOG_LINK_EVENT, lpfc_printf_log(phba, KERN_INFO, LOG_LINK_EVENT,
"%d:1306 Link Up Event in loop back mode " "1306 Link Up Event in loop back mode "
"x%x received Data: x%x x%x x%x x%x\n", "x%x received Data: x%x x%x x%x x%x\n",
phba->brd_no, la->eventTag, phba->fc_eventTag, la->eventTag, phba->fc_eventTag,
la->granted_AL_PA, la->UlnkSpeed, la->granted_AL_PA, la->UlnkSpeed,
phba->alpa_map[0]); phba->alpa_map[0]);
} else { } else {
lpfc_printf_log(phba, KERN_ERR, LOG_LINK_EVENT, lpfc_printf_log(phba, KERN_ERR, LOG_LINK_EVENT,
"%d:1303 Link Up Event x%x received " "1303 Link Up Event x%x received "
"Data: x%x x%x x%x x%x\n", "Data: x%x x%x x%x x%x\n",
phba->brd_no, la->eventTag, phba->fc_eventTag, la->eventTag, phba->fc_eventTag,
la->granted_AL_PA, la->UlnkSpeed, la->granted_AL_PA, la->UlnkSpeed,
phba->alpa_map[0]); phba->alpa_map[0]);
} }
lpfc_mbx_process_link_up(phba, la); lpfc_mbx_process_link_up(phba, la);
} else { } else {
phba->fc_stat.LinkDown++; phba->fc_stat.LinkDown++;
lpfc_printf_log(phba, KERN_ERR, LOG_LINK_EVENT, lpfc_printf_log(phba, KERN_ERR, LOG_LINK_EVENT,
"%d:1305 Link Down Event x%x received " "1305 Link Down Event x%x received "
"Data: x%x x%x x%x\n", "Data: x%x x%x x%x\n",
phba->brd_no, la->eventTag, phba->fc_eventTag, la->eventTag, phba->fc_eventTag,
phba->pport->port_state, vport->fc_flag); phba->pport->port_state, vport->fc_flag);
lpfc_mbx_issue_link_down(phba); lpfc_mbx_issue_link_down(phba);
} }
...@@ -1185,10 +1172,9 @@ lpfc_mbx_cmpl_unreg_vpi(struct lpfc_hba *phba, LPFC_MBOXQ_t *pmb) ...@@ -1185,10 +1172,9 @@ lpfc_mbx_cmpl_unreg_vpi(struct lpfc_hba *phba, LPFC_MBOXQ_t *pmb)
case 0x0011: case 0x0011:
case 0x0020: case 0x0020:
case 0x9700: case 0x9700:
lpfc_printf_log(phba, KERN_INFO, LOG_NODE, lpfc_printf_vlog(vport, KERN_INFO, LOG_NODE,
"%d (%d):0911 cmpl_unreg_vpi, " "0911 cmpl_unreg_vpi, mb status = 0x%x\n",
"mb status = 0x%x\n", mb->mbxStatus);
phba->brd_no, vport->vpi, mb->mbxStatus);
break; break;
} }
vport->unreg_vpi_cmpl = VPORT_OK; vport->unreg_vpi_cmpl = VPORT_OK;
...@@ -1217,9 +1203,8 @@ lpfc_mbx_unreg_vpi(struct lpfc_vport *vport) ...@@ -1217,9 +1203,8 @@ lpfc_mbx_unreg_vpi(struct lpfc_vport *vport)
mbox->mbox_cmpl = lpfc_mbx_cmpl_unreg_vpi; mbox->mbox_cmpl = lpfc_mbx_cmpl_unreg_vpi;
rc = lpfc_sli_issue_mbox(phba, mbox, (MBX_NOWAIT | MBX_STOP_IOCB)); rc = lpfc_sli_issue_mbox(phba, mbox, (MBX_NOWAIT | MBX_STOP_IOCB));
if (rc == MBX_NOT_FINISHED) { if (rc == MBX_NOT_FINISHED) {
lpfc_printf_log(phba, KERN_ERR, LOG_MBOX | LOG_VPORT, lpfc_printf_vlog(vport, KERN_ERR, LOG_MBOX | LOG_VPORT,
"%d (%d):1800 Could not issue unreg_vpi\n", "1800 Could not issue unreg_vpi\n");
phba->brd_no, vport->vpi);
mempool_free(mbox, phba->mbox_mem_pool); mempool_free(mbox, phba->mbox_mem_pool);
vport->unreg_vpi_cmpl = VPORT_ERROR; vport->unreg_vpi_cmpl = VPORT_ERROR;
} }
...@@ -1236,9 +1221,9 @@ lpfc_mbx_cmpl_reg_vpi(struct lpfc_hba *phba, LPFC_MBOXQ_t *pmb) ...@@ -1236,9 +1221,9 @@ lpfc_mbx_cmpl_reg_vpi(struct lpfc_hba *phba, LPFC_MBOXQ_t *pmb)
case 0x0011: case 0x0011:
case 0x9601: case 0x9601:
case 0x9602: case 0x9602:
lpfc_printf_log(phba, KERN_INFO, LOG_NODE, lpfc_printf_vlog(vport, KERN_INFO, LOG_NODE,
"%d (%d):0912 cmpl_reg_vpi, mb status = 0x%x\n", "0912 cmpl_reg_vpi, mb status = 0x%x\n",
phba->brd_no, vport->vpi, mb->mbxStatus); mb->mbxStatus);
lpfc_vport_set_state(vport, FC_VPORT_FAILED); lpfc_vport_set_state(vport, FC_VPORT_FAILED);
spin_lock_irq(shost->host_lock); spin_lock_irq(shost->host_lock);
vport->fc_flag &= ~(FC_FABRIC | FC_PUBLIC_LOOP); vport->fc_flag &= ~(FC_FABRIC | FC_PUBLIC_LOOP);
...@@ -1300,10 +1285,9 @@ lpfc_mbx_cmpl_fabric_reg_login(struct lpfc_hba *phba, LPFC_MBOXQ_t *pmb) ...@@ -1300,10 +1285,9 @@ lpfc_mbx_cmpl_fabric_reg_login(struct lpfc_hba *phba, LPFC_MBOXQ_t *pmb)
} }
lpfc_vport_set_state(vport, FC_VPORT_FAILED); lpfc_vport_set_state(vport, FC_VPORT_FAILED);
lpfc_printf_log(phba, KERN_ERR, LOG_MBOX, lpfc_printf_vlog(vport, KERN_ERR, LOG_MBOX,
"%d (%d):0258 Register Fabric login error: 0x%x\n", "0258 Register Fabric login error: 0x%x\n",
phba->brd_no, vport->vpi, mb->mbxStatus); mb->mbxStatus);
return; return;
} }
...@@ -1327,11 +1311,10 @@ lpfc_mbx_cmpl_fabric_reg_login(struct lpfc_hba *phba, LPFC_MBOXQ_t *pmb) ...@@ -1327,11 +1311,10 @@ lpfc_mbx_cmpl_fabric_reg_login(struct lpfc_hba *phba, LPFC_MBOXQ_t *pmb)
LPFC_SLI3_NPIV_ENABLED) { LPFC_SLI3_NPIV_ENABLED) {
lpfc_vport_set_state(vports[i], lpfc_vport_set_state(vports[i],
FC_VPORT_NO_FABRIC_SUPP); FC_VPORT_NO_FABRIC_SUPP);
lpfc_printf_log(phba, KERN_ERR, LOG_ELS, lpfc_printf_vlog(vport, KERN_ERR,
"%d (%d):0259 No NPIV " LOG_ELS,
"Fabric support\n", "0259 No NPIV "
phba->brd_no, "Fabric support\n");
vports[i]->vpi);
} }
} }
lpfc_destroy_vport_work_array(vports); lpfc_destroy_vport_work_array(vports);
...@@ -1378,9 +1361,9 @@ lpfc_mbx_cmpl_ns_reg_login(struct lpfc_hba *phba, LPFC_MBOXQ_t *pmb) ...@@ -1378,9 +1361,9 @@ lpfc_mbx_cmpl_ns_reg_login(struct lpfc_hba *phba, LPFC_MBOXQ_t *pmb)
return; return;
} }
lpfc_vport_set_state(vport, FC_VPORT_FAILED); lpfc_vport_set_state(vport, FC_VPORT_FAILED);
lpfc_printf_log(phba, KERN_ERR, LOG_ELS, lpfc_printf_vlog(vport, KERN_ERR, LOG_ELS,
"%d (%d):0260 Register NameServer error: 0x%x\n", "0260 Register NameServer error: 0x%x\n",
phba->brd_no, vport->vpi, mb->mbxStatus); mb->mbxStatus);
return; return;
} }
...@@ -1605,12 +1588,11 @@ lpfc_nlp_set_state(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp, ...@@ -1605,12 +1588,11 @@ lpfc_nlp_set_state(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp,
int old_state = ndlp->nlp_state; int old_state = ndlp->nlp_state;
char name1[16], name2[16]; char name1[16], name2[16];
lpfc_printf_log(vport->phba, KERN_INFO, LOG_NODE, lpfc_printf_vlog(vport, KERN_INFO, LOG_NODE,
"%d (%d):0904 NPort state transition x%06x, %s -> %s\n", "0904 NPort state transition x%06x, %s -> %s\n",
vport->phba->brd_no, vport->vpi, ndlp->nlp_DID,
ndlp->nlp_DID, lpfc_nlp_state_name(name1, sizeof(name1), old_state),
lpfc_nlp_state_name(name1, sizeof(name1), old_state), lpfc_nlp_state_name(name2, sizeof(name2), state));
lpfc_nlp_state_name(name2, sizeof(name2), state));
lpfc_debugfs_disc_trc(vport, LPFC_DISC_TRC_NODE, lpfc_debugfs_disc_trc(vport, LPFC_DISC_TRC_NODE,
"node statechg did:x%x old:%d ste:%d", "node statechg did:x%x old:%d ste:%d",
...@@ -1702,12 +1684,12 @@ lpfc_set_disctmo(struct lpfc_vport *vport) ...@@ -1702,12 +1684,12 @@ lpfc_set_disctmo(struct lpfc_vport *vport)
spin_unlock_irq(shost->host_lock); spin_unlock_irq(shost->host_lock);
/* Start Discovery Timer state <hba_state> */ /* Start Discovery Timer state <hba_state> */
lpfc_printf_log(phba, KERN_INFO, LOG_DISCOVERY, lpfc_printf_vlog(vport, KERN_INFO, LOG_DISCOVERY,
"%d (%d):0247 Start Discovery Timer state x%x " "0247 Start Discovery Timer state x%x "
"Data: x%x x%lx x%x x%x\n", "Data: x%x x%lx x%x x%x\n",
phba->brd_no, vport->vpi, vport->port_state, tmo, vport->port_state, tmo,
(unsigned long)&vport->fc_disctmo, vport->fc_plogi_cnt, (unsigned long)&vport->fc_disctmo, vport->fc_plogi_cnt,
vport->fc_adisc_cnt); vport->fc_adisc_cnt);
return; return;
} }
...@@ -1719,7 +1701,6 @@ int ...@@ -1719,7 +1701,6 @@ int
lpfc_can_disctmo(struct lpfc_vport *vport) lpfc_can_disctmo(struct lpfc_vport *vport)
{ {
struct Scsi_Host *shost = lpfc_shost_from_vport(vport); struct Scsi_Host *shost = lpfc_shost_from_vport(vport);
struct lpfc_hba *phba = vport->phba;
unsigned long iflags; unsigned long iflags;
lpfc_debugfs_disc_trc(vport, LPFC_DISC_TRC_ELS_CMD, lpfc_debugfs_disc_trc(vport, LPFC_DISC_TRC_ELS_CMD,
...@@ -1738,13 +1719,11 @@ lpfc_can_disctmo(struct lpfc_vport *vport) ...@@ -1738,13 +1719,11 @@ lpfc_can_disctmo(struct lpfc_vport *vport)
} }
/* Cancel Discovery Timer state <hba_state> */ /* Cancel Discovery Timer state <hba_state> */
lpfc_printf_log(phba, KERN_INFO, LOG_DISCOVERY, lpfc_printf_vlog(vport, KERN_INFO, LOG_DISCOVERY,
"%d (%d):0248 Cancel Discovery Timer state x%x " "0248 Cancel Discovery Timer state x%x "
"Data: x%x x%x x%x\n", "Data: x%x x%x x%x\n",
phba->brd_no, vport->vpi, vport->port_state, vport->port_state, vport->fc_flag,
vport->fc_flag, vport->fc_plogi_cnt, vport->fc_plogi_cnt, vport->fc_adisc_cnt);
vport->fc_adisc_cnt);
return 0; return 0;
} }
...@@ -1927,10 +1906,9 @@ lpfc_unreg_default_rpis(struct lpfc_vport *vport) ...@@ -1927,10 +1906,9 @@ lpfc_unreg_default_rpis(struct lpfc_vport *vport)
rc = lpfc_sli_issue_mbox(phba, mbox, rc = lpfc_sli_issue_mbox(phba, mbox,
(MBX_NOWAIT | MBX_STOP_IOCB)); (MBX_NOWAIT | MBX_STOP_IOCB));
if (rc == MBX_NOT_FINISHED) { if (rc == MBX_NOT_FINISHED) {
lpfc_printf_log(phba, KERN_ERR, LOG_MBOX | LOG_VPORT, lpfc_printf_vlog(vport, KERN_ERR, LOG_MBOX | LOG_VPORT,
"%d (%d):1815 Could not issue " "1815 Could not issue "
"unreg_did (default rpis)\n", "unreg_did (default rpis)\n");
phba->brd_no, vport->vpi);
mempool_free(mbox, phba->mbox_mem_pool); mempool_free(mbox, phba->mbox_mem_pool);
} }
} }
...@@ -1949,12 +1927,11 @@ lpfc_cleanup_node(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp) ...@@ -1949,12 +1927,11 @@ lpfc_cleanup_node(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp)
struct lpfc_dmabuf *mp; struct lpfc_dmabuf *mp;
/* Cleanup node for NPort <nlp_DID> */ /* Cleanup node for NPort <nlp_DID> */
lpfc_printf_log(phba, KERN_INFO, LOG_NODE, lpfc_printf_vlog(vport, KERN_INFO, LOG_NODE,
"%d (%d):0900 Cleanup node for NPort x%x " "0900 Cleanup node for NPort x%x "
"Data: x%x x%x x%x\n", "Data: x%x x%x x%x\n",
phba->brd_no, vport->vpi, ndlp->nlp_DID, ndlp->nlp_flag, ndlp->nlp_DID, ndlp->nlp_flag,
ndlp->nlp_state, ndlp->nlp_rpi); ndlp->nlp_state, ndlp->nlp_rpi);
lpfc_dequeue_node(vport, ndlp); lpfc_dequeue_node(vport, ndlp);
/* cleanup any ndlp on mbox q waiting for reglogin cmpl */ /* cleanup any ndlp on mbox q waiting for reglogin cmpl */
...@@ -2086,7 +2063,6 @@ lpfc_matchdid(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp, ...@@ -2086,7 +2063,6 @@ lpfc_matchdid(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp,
static struct lpfc_nodelist * static struct lpfc_nodelist *
__lpfc_findnode_did(struct lpfc_vport *vport, uint32_t did) __lpfc_findnode_did(struct lpfc_vport *vport, uint32_t did)
{ {
struct lpfc_hba *phba = vport->phba;
struct lpfc_nodelist *ndlp; struct lpfc_nodelist *ndlp;
uint32_t data1; uint32_t data1;
...@@ -2096,20 +2072,18 @@ __lpfc_findnode_did(struct lpfc_vport *vport, uint32_t did) ...@@ -2096,20 +2072,18 @@ __lpfc_findnode_did(struct lpfc_vport *vport, uint32_t did)
((uint32_t) ndlp->nlp_xri << 16) | ((uint32_t) ndlp->nlp_xri << 16) |
((uint32_t) ndlp->nlp_type << 8) | ((uint32_t) ndlp->nlp_type << 8) |
((uint32_t) ndlp->nlp_rpi & 0xff)); ((uint32_t) ndlp->nlp_rpi & 0xff));
lpfc_printf_log(phba, KERN_INFO, LOG_NODE, lpfc_printf_vlog(vport, KERN_INFO, LOG_NODE,
"%d (%d):0929 FIND node DID " "0929 FIND node DID "
" Data: x%p x%x x%x x%x\n", "Data: x%p x%x x%x x%x\n",
phba->brd_no, vport->vpi, ndlp, ndlp->nlp_DID,
ndlp, ndlp->nlp_DID, ndlp->nlp_flag, data1);
ndlp->nlp_flag, data1);
return ndlp; return ndlp;
} }
} }
/* FIND node did <did> NOT FOUND */ /* FIND node did <did> NOT FOUND */
lpfc_printf_log(phba, KERN_INFO, LOG_NODE, lpfc_printf_vlog(vport, KERN_INFO, LOG_NODE,
"%d (%d):0932 FIND node did x%x NOT FOUND.\n", "0932 FIND node did x%x NOT FOUND.\n", did);
phba->brd_no, vport->vpi, did);
return NULL; return NULL;
} }
...@@ -2301,12 +2275,11 @@ lpfc_disc_start(struct lpfc_vport *vport) ...@@ -2301,12 +2275,11 @@ lpfc_disc_start(struct lpfc_vport *vport)
vport->num_disc_nodes = 0; vport->num_disc_nodes = 0;
/* Start Discovery state <hba_state> */ /* Start Discovery state <hba_state> */
lpfc_printf_log(phba, KERN_INFO, LOG_DISCOVERY, lpfc_printf_vlog(vport, KERN_INFO, LOG_DISCOVERY,
"%d (%d):0202 Start Discovery hba state x%x " "0202 Start Discovery hba state x%x "
"Data: x%x x%x x%x\n", "Data: x%x x%x x%x\n",
phba->brd_no, vport->vpi, vport->port_state, vport->port_state, vport->fc_flag, vport->fc_plogi_cnt,
vport->fc_flag, vport->fc_plogi_cnt, vport->fc_adisc_cnt);
vport->fc_adisc_cnt);
/* First do ADISCs - if any */ /* First do ADISCs - if any */
num_sent = lpfc_els_disc_adisc(vport); num_sent = lpfc_els_disc_adisc(vport);
...@@ -2524,10 +2497,8 @@ lpfc_disc_timeout_handler(struct lpfc_vport *vport) ...@@ -2524,10 +2497,8 @@ lpfc_disc_timeout_handler(struct lpfc_vport *vport)
* FAN * FAN
*/ */
/* FAN timeout */ /* FAN timeout */
lpfc_printf_log(phba, KERN_WARNING, LOG_DISCOVERY, lpfc_printf_vlog(vport, KERN_WARNING, LOG_DISCOVERY,
"%d (%d):0221 FAN timeout\n", "0221 FAN timeout\n");
phba->brd_no, vport->vpi);
/* Start discovery by sending FLOGI, clean up old rpis */ /* Start discovery by sending FLOGI, clean up old rpis */
list_for_each_entry_safe(ndlp, next_ndlp, &vport->fc_nodes, list_for_each_entry_safe(ndlp, next_ndlp, &vport->fc_nodes,
nlp_listp) { nlp_listp) {
...@@ -2554,10 +2525,9 @@ lpfc_disc_timeout_handler(struct lpfc_vport *vport) ...@@ -2554,10 +2525,9 @@ lpfc_disc_timeout_handler(struct lpfc_vport *vport)
case LPFC_FLOGI: case LPFC_FLOGI:
/* port_state is identically LPFC_FLOGI while waiting for FLOGI cmpl */ /* port_state is identically LPFC_FLOGI while waiting for FLOGI cmpl */
/* Initial FLOGI timeout */ /* Initial FLOGI timeout */
lpfc_printf_log(phba, KERN_ERR, LOG_DISCOVERY, lpfc_printf_vlog(vport, KERN_ERR, LOG_DISCOVERY,
"%d (%d):0222 Initial %s timeout\n", "0222 Initial %s timeout\n",
phba->brd_no, vport->vpi, vport->vpi ? "FLOGI" : "FDISC");
vport->vpi ? "FLOGI" : "FDISC");
/* Assume no Fabric and go on with discovery. /* Assume no Fabric and go on with discovery.
* Check for outstanding ELS FLOGI to abort. * Check for outstanding ELS FLOGI to abort.
...@@ -2573,11 +2543,9 @@ lpfc_disc_timeout_handler(struct lpfc_vport *vport) ...@@ -2573,11 +2543,9 @@ lpfc_disc_timeout_handler(struct lpfc_vport *vport)
case LPFC_FABRIC_CFG_LINK: case LPFC_FABRIC_CFG_LINK:
/* hba_state is identically LPFC_FABRIC_CFG_LINK while waiting for /* hba_state is identically LPFC_FABRIC_CFG_LINK while waiting for
NameServer login */ NameServer login */
lpfc_printf_log(phba, KERN_ERR, LOG_DISCOVERY, lpfc_printf_vlog(vport, KERN_ERR, LOG_DISCOVERY,
"%d (%d):0223 Timeout while waiting for " "0223 Timeout while waiting for "
"NameServer login\n", "NameServer login\n");
phba->brd_no, vport->vpi);
/* Next look for NameServer ndlp */ /* Next look for NameServer ndlp */
ndlp = lpfc_findnode_did(vport, NameServer_DID); ndlp = lpfc_findnode_did(vport, NameServer_DID);
if (ndlp) if (ndlp)
...@@ -2588,11 +2556,10 @@ lpfc_disc_timeout_handler(struct lpfc_vport *vport) ...@@ -2588,11 +2556,10 @@ lpfc_disc_timeout_handler(struct lpfc_vport *vport)
case LPFC_NS_QRY: case LPFC_NS_QRY:
/* Check for wait for NameServer Rsp timeout */ /* Check for wait for NameServer Rsp timeout */
lpfc_printf_log(phba, KERN_ERR, LOG_DISCOVERY, lpfc_printf_vlog(vport, KERN_ERR, LOG_DISCOVERY,
"%d (%d):0224 NameServer Query timeout " "0224 NameServer Query timeout "
"Data: x%x x%x\n", "Data: x%x x%x\n",
phba->brd_no, vport->vpi, vport->fc_ns_retry, LPFC_MAX_NS_RETRY);
vport->fc_ns_retry, LPFC_MAX_NS_RETRY);
if (vport->fc_ns_retry < LPFC_MAX_NS_RETRY) { if (vport->fc_ns_retry < LPFC_MAX_NS_RETRY) {
/* Try it one more time */ /* Try it one more time */
...@@ -2619,10 +2586,9 @@ lpfc_disc_timeout_handler(struct lpfc_vport *vport) ...@@ -2619,10 +2586,9 @@ lpfc_disc_timeout_handler(struct lpfc_vport *vport)
/* Setup and issue mailbox INITIALIZE LINK command */ /* Setup and issue mailbox INITIALIZE LINK command */
initlinkmbox = mempool_alloc(phba->mbox_mem_pool, GFP_KERNEL); initlinkmbox = mempool_alloc(phba->mbox_mem_pool, GFP_KERNEL);
if (!initlinkmbox) { if (!initlinkmbox) {
lpfc_printf_log(phba, KERN_ERR, LOG_DISCOVERY, lpfc_printf_vlog(vport, KERN_ERR, LOG_DISCOVERY,
"%d (%d):0206 Device Discovery " "0206 Device Discovery "
"completion error\n", "completion error\n");
phba->brd_no, vport->vpi);
phba->link_state = LPFC_HBA_ERROR; phba->link_state = LPFC_HBA_ERROR;
break; break;
} }
...@@ -2643,9 +2609,8 @@ lpfc_disc_timeout_handler(struct lpfc_vport *vport) ...@@ -2643,9 +2609,8 @@ lpfc_disc_timeout_handler(struct lpfc_vport *vport)
case LPFC_DISC_AUTH: case LPFC_DISC_AUTH:
/* Node Authentication timeout */ /* Node Authentication timeout */
lpfc_printf_log(phba, KERN_ERR, LOG_DISCOVERY, lpfc_printf_vlog(vport, KERN_ERR, LOG_DISCOVERY,
"%d (%d):0227 Node Authentication timeout\n", "0227 Node Authentication timeout\n");
phba->brd_no, vport->vpi);
lpfc_disc_flush_list(vport); lpfc_disc_flush_list(vport);
/* /*
...@@ -2662,11 +2627,10 @@ lpfc_disc_timeout_handler(struct lpfc_vport *vport) ...@@ -2662,11 +2627,10 @@ lpfc_disc_timeout_handler(struct lpfc_vport *vport)
case LPFC_VPORT_READY: case LPFC_VPORT_READY:
if (vport->fc_flag & FC_RSCN_MODE) { if (vport->fc_flag & FC_RSCN_MODE) {
lpfc_printf_log(phba, KERN_ERR, LOG_DISCOVERY, lpfc_printf_vlog(vport, KERN_ERR, LOG_DISCOVERY,
"%d (%d):0231 RSCN timeout Data: x%x " "0231 RSCN timeout Data: x%x "
"x%x\n", "x%x\n",
phba->brd_no, vport->vpi, vport->fc_ns_retry, LPFC_MAX_NS_RETRY);
vport->fc_ns_retry, LPFC_MAX_NS_RETRY);
/* Cleanup any outstanding ELS commands */ /* Cleanup any outstanding ELS commands */
lpfc_els_flush_cmd(vport); lpfc_els_flush_cmd(vport);
...@@ -2677,20 +2641,17 @@ lpfc_disc_timeout_handler(struct lpfc_vport *vport) ...@@ -2677,20 +2641,17 @@ lpfc_disc_timeout_handler(struct lpfc_vport *vport)
break; break;
default: default:
lpfc_printf_log(phba, KERN_ERR, LOG_DISCOVERY, lpfc_printf_vlog(vport, KERN_ERR, LOG_DISCOVERY,
"%d (%d):0229 Unexpected discovery timeout, " "0229 Unexpected discovery timeout, "
"vport State x%x\n", "vport State x%x\n", vport->port_state);
phba->brd_no, vport->vpi, vport->port_state);
break; break;
} }
switch (phba->link_state) { switch (phba->link_state) {
case LPFC_CLEAR_LA: case LPFC_CLEAR_LA:
/* CLEAR LA timeout */ /* CLEAR LA timeout */
lpfc_printf_log(phba, KERN_ERR, LOG_DISCOVERY, lpfc_printf_vlog(vport, KERN_ERR, LOG_DISCOVERY,
"%d (%d):0228 CLEAR LA timeout\n", "0228 CLEAR LA timeout\n");
phba->brd_no, vport->vpi);
clrlaerr = 1; clrlaerr = 1;
break; break;
...@@ -2701,10 +2662,9 @@ lpfc_disc_timeout_handler(struct lpfc_vport *vport) ...@@ -2701,10 +2662,9 @@ lpfc_disc_timeout_handler(struct lpfc_vport *vport)
case LPFC_LINK_DOWN: case LPFC_LINK_DOWN:
case LPFC_LINK_UP: case LPFC_LINK_UP:
case LPFC_HBA_ERROR: case LPFC_HBA_ERROR:
lpfc_printf_log(phba, KERN_ERR, LOG_DISCOVERY, lpfc_printf_vlog(vport, KERN_ERR, LOG_DISCOVERY,
"%d (%d):0230 Unexpected timeout, hba link " "0230 Unexpected timeout, hba link "
"state x%x\n", "state x%x\n", phba->link_state);
phba->brd_no, vport->vpi, phba->link_state);
clrlaerr = 1; clrlaerr = 1;
break; break;
......
...@@ -107,10 +107,9 @@ lpfc_config_port_prep(struct lpfc_hba *phba) ...@@ -107,10 +107,9 @@ lpfc_config_port_prep(struct lpfc_hba *phba)
if (rc != MBX_SUCCESS) { if (rc != MBX_SUCCESS) {
lpfc_printf_log(phba, KERN_ERR, LOG_MBOX, lpfc_printf_log(phba, KERN_ERR, LOG_MBOX,
"%d:0324 Config Port initialization " "0324 Config Port initialization "
"error, mbxCmd x%x READ_NVPARM, " "error, mbxCmd x%x READ_NVPARM, "
"mbxStatus x%x\n", "mbxStatus x%x\n",
phba->brd_no,
mb->mbxCommand, mb->mbxStatus); mb->mbxCommand, mb->mbxStatus);
mempool_free(pmb, phba->mbox_mem_pool); mempool_free(pmb, phba->mbox_mem_pool);
return -ERESTART; return -ERESTART;
...@@ -128,9 +127,8 @@ lpfc_config_port_prep(struct lpfc_hba *phba) ...@@ -128,9 +127,8 @@ lpfc_config_port_prep(struct lpfc_hba *phba)
rc = lpfc_sli_issue_mbox(phba, pmb, MBX_POLL); rc = lpfc_sli_issue_mbox(phba, pmb, MBX_POLL);
if (rc != MBX_SUCCESS) { if (rc != MBX_SUCCESS) {
lpfc_printf_log(phba, KERN_ERR, LOG_INIT, lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
"%d:0439 Adapter failed to init, mbxCmd x%x " "0439 Adapter failed to init, mbxCmd x%x "
"READ_REV, mbxStatus x%x\n", "READ_REV, mbxStatus x%x\n",
phba->brd_no,
mb->mbxCommand, mb->mbxStatus); mb->mbxCommand, mb->mbxStatus);
mempool_free( pmb, phba->mbox_mem_pool); mempool_free( pmb, phba->mbox_mem_pool);
return -ERESTART; return -ERESTART;
...@@ -144,9 +142,8 @@ lpfc_config_port_prep(struct lpfc_hba *phba) ...@@ -144,9 +142,8 @@ lpfc_config_port_prep(struct lpfc_hba *phba)
if (mb->un.varRdRev.rr == 0) { if (mb->un.varRdRev.rr == 0) {
vp->rev.rBit = 0; vp->rev.rBit = 0;
lpfc_printf_log(phba, KERN_ERR, LOG_INIT, lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
"%d:0440 Adapter failed to init, READ_REV has " "0440 Adapter failed to init, READ_REV has "
"missing revision information.\n", "missing revision information.\n");
phba->brd_no);
mempool_free(pmb, phba->mbox_mem_pool); mempool_free(pmb, phba->mbox_mem_pool);
return -ERESTART; return -ERESTART;
} }
...@@ -197,9 +194,8 @@ lpfc_config_port_prep(struct lpfc_hba *phba) ...@@ -197,9 +194,8 @@ lpfc_config_port_prep(struct lpfc_hba *phba)
if (rc != MBX_SUCCESS) { if (rc != MBX_SUCCESS) {
lpfc_printf_log(phba, KERN_INFO, LOG_INIT, lpfc_printf_log(phba, KERN_INFO, LOG_INIT,
"%d:0441 VPD not present on adapter, " "0441 VPD not present on adapter, "
"mbxCmd x%x DUMP VPD, mbxStatus x%x\n", "mbxCmd x%x DUMP VPD, mbxStatus x%x\n",
phba->brd_no,
mb->mbxCommand, mb->mbxStatus); mb->mbxCommand, mb->mbxStatus);
mb->un.varDmp.word_cnt = 0; mb->un.varDmp.word_cnt = 0;
} }
...@@ -253,9 +249,8 @@ lpfc_config_port_post(struct lpfc_hba *phba) ...@@ -253,9 +249,8 @@ lpfc_config_port_post(struct lpfc_hba *phba)
pmb->vport = vport; pmb->vport = vport;
if (lpfc_sli_issue_mbox(phba, pmb, MBX_POLL) != MBX_SUCCESS) { if (lpfc_sli_issue_mbox(phba, pmb, MBX_POLL) != MBX_SUCCESS) {
lpfc_printf_log(phba, KERN_ERR, LOG_INIT, lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
"%d:0448 Adapter failed init, mbxCmd x%x " "0448 Adapter failed init, mbxCmd x%x "
"READ_SPARM mbxStatus x%x\n", "READ_SPARM mbxStatus x%x\n",
phba->brd_no,
mb->mbxCommand, mb->mbxStatus); mb->mbxCommand, mb->mbxStatus);
phba->link_state = LPFC_HBA_ERROR; phba->link_state = LPFC_HBA_ERROR;
mp = (struct lpfc_dmabuf *) pmb->context1; mp = (struct lpfc_dmabuf *) pmb->context1;
...@@ -312,9 +307,8 @@ lpfc_config_port_post(struct lpfc_hba *phba) ...@@ -312,9 +307,8 @@ lpfc_config_port_post(struct lpfc_hba *phba)
pmb->vport = vport; pmb->vport = vport;
if (lpfc_sli_issue_mbox(phba, pmb, MBX_POLL) != MBX_SUCCESS) { if (lpfc_sli_issue_mbox(phba, pmb, MBX_POLL) != MBX_SUCCESS) {
lpfc_printf_log(phba, KERN_ERR, LOG_INIT, lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
"%d:0453 Adapter failed to init, mbxCmd x%x " "0453 Adapter failed to init, mbxCmd x%x "
"READ_CONFIG, mbxStatus x%x\n", "READ_CONFIG, mbxStatus x%x\n",
phba->brd_no,
mb->mbxCommand, mb->mbxStatus); mb->mbxCommand, mb->mbxStatus);
phba->link_state = LPFC_HBA_ERROR; phba->link_state = LPFC_HBA_ERROR;
mempool_free( pmb, phba->mbox_mem_pool); mempool_free( pmb, phba->mbox_mem_pool);
...@@ -344,9 +338,8 @@ lpfc_config_port_post(struct lpfc_hba *phba) ...@@ -344,9 +338,8 @@ lpfc_config_port_post(struct lpfc_hba *phba)
&& !(phba->lmt & LMT_10Gb))) { && !(phba->lmt & LMT_10Gb))) {
/* Reset link speed to auto */ /* Reset link speed to auto */
lpfc_printf_log(phba, KERN_WARNING, LOG_LINK_EVENT, lpfc_printf_log(phba, KERN_WARNING, LOG_LINK_EVENT,
"%d:1302 Invalid speed for this board: " "1302 Invalid speed for this board: "
"Reset link speed to auto: x%x\n", "Reset link speed to auto: x%x\n",
phba->brd_no,
phba->cfg_link_speed); phba->cfg_link_speed);
phba->cfg_link_speed = LINK_SPEED_AUTO; phba->cfg_link_speed = LINK_SPEED_AUTO;
} }
...@@ -402,9 +395,8 @@ lpfc_config_port_post(struct lpfc_hba *phba) ...@@ -402,9 +395,8 @@ lpfc_config_port_post(struct lpfc_hba *phba)
lpfc_set_loopback_flag(phba); lpfc_set_loopback_flag(phba);
if (rc != MBX_SUCCESS) { if (rc != MBX_SUCCESS) {
lpfc_printf_log(phba, KERN_ERR, LOG_INIT, lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
"%d:0454 Adapter failed to init, mbxCmd x%x " "0454 Adapter failed to init, mbxCmd x%x "
"INIT_LINK, mbxStatus x%x\n", "INIT_LINK, mbxStatus x%x\n",
phba->brd_no,
mb->mbxCommand, mb->mbxStatus); mb->mbxCommand, mb->mbxStatus);
/* Clear all interrupt enable conditions */ /* Clear all interrupt enable conditions */
...@@ -588,8 +580,8 @@ lpfc_hb_timeout_handler(struct lpfc_hba *phba) ...@@ -588,8 +580,8 @@ lpfc_hb_timeout_handler(struct lpfc_hba *phba)
* need to take the HBA offline. * need to take the HBA offline.
*/ */
lpfc_printf_log(phba, KERN_ERR, LOG_INIT, lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
"%d:0459 Adapter heartbeat failure, taking " "0459 Adapter heartbeat failure, taking "
"this port offline.\n", phba->brd_no); "this port offline.\n");
spin_lock_irq(&phba->hbalock); spin_lock_irq(&phba->hbalock);
psli->sli_flag &= ~LPFC_SLI2_ACTIVE; psli->sli_flag &= ~LPFC_SLI2_ACTIVE;
...@@ -631,9 +623,9 @@ lpfc_handle_eratt(struct lpfc_hba *phba) ...@@ -631,9 +623,9 @@ lpfc_handle_eratt(struct lpfc_hba *phba)
phba->work_hs & HS_FFER5) { phba->work_hs & HS_FFER5) {
/* Re-establishing Link */ /* Re-establishing Link */
lpfc_printf_log(phba, KERN_INFO, LOG_LINK_EVENT, lpfc_printf_log(phba, KERN_INFO, LOG_LINK_EVENT,
"%d:1301 Re-establishing Link " "1301 Re-establishing Link "
"Data: x%x x%x x%x\n", "Data: x%x x%x x%x\n",
phba->brd_no, phba->work_hs, phba->work_hs,
phba->work_status[0], phba->work_status[1]); phba->work_status[0], phba->work_status[1]);
vports = lpfc_create_vport_work_array(phba); vports = lpfc_create_vport_work_array(phba);
if (vports != NULL) if (vports != NULL)
...@@ -679,9 +671,9 @@ lpfc_handle_eratt(struct lpfc_hba *phba) ...@@ -679,9 +671,9 @@ lpfc_handle_eratt(struct lpfc_hba *phba)
* twice. This is the adapter hardware error path. * twice. This is the adapter hardware error path.
*/ */
lpfc_printf_log(phba, KERN_ERR, LOG_INIT, lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
"%d:0457 Adapter Hardware Error " "0457 Adapter Hardware Error "
"Data: x%x x%x x%x\n", "Data: x%x x%x x%x\n",
phba->brd_no, phba->work_hs, phba->work_hs,
phba->work_status[0], phba->work_status[1]); phba->work_status[0], phba->work_status[1]);
event_data = FC_REG_DUMP_EVENT; event_data = FC_REG_DUMP_EVENT;
...@@ -777,8 +769,7 @@ lpfc_handle_latt(struct lpfc_hba *phba) ...@@ -777,8 +769,7 @@ lpfc_handle_latt(struct lpfc_hba *phba)
/* The other case is an error from issue_mbox */ /* The other case is an error from issue_mbox */
if (rc == -ENOMEM) if (rc == -ENOMEM)
lpfc_printf_log(phba, KERN_WARNING, LOG_MBOX, lpfc_printf_log(phba, KERN_WARNING, LOG_MBOX,
"%d:0300 READ_LA: no buffers\n", "0300 READ_LA: no buffers\n");
phba->brd_no);
return; return;
} }
...@@ -803,8 +794,7 @@ lpfc_parse_vpd(struct lpfc_hba *phba, uint8_t *vpd, int len) ...@@ -803,8 +794,7 @@ lpfc_parse_vpd(struct lpfc_hba *phba, uint8_t *vpd, int len)
/* Vital Product */ /* Vital Product */
lpfc_printf_log(phba, KERN_INFO, LOG_INIT, lpfc_printf_log(phba, KERN_INFO, LOG_INIT,
"%d:0455 Vital Product Data: x%x x%x x%x x%x\n", "0455 Vital Product Data: x%x x%x x%x x%x\n",
phba->brd_no,
(uint32_t) vpd[0], (uint32_t) vpd[1], (uint32_t) vpd[2], (uint32_t) vpd[0], (uint32_t) vpd[1], (uint32_t) vpd[2],
(uint32_t) vpd[3]); (uint32_t) vpd[3]);
while (!finished && (index < (len - 4))) { while (!finished && (index < (len - 4))) {
...@@ -1323,10 +1313,9 @@ lpfc_establish_link_tmo(unsigned long ptr) ...@@ -1323,10 +1313,9 @@ lpfc_establish_link_tmo(unsigned long ptr)
/* Re-establishing Link, timer expired */ /* Re-establishing Link, timer expired */
lpfc_printf_log(phba, KERN_ERR, LOG_LINK_EVENT, lpfc_printf_log(phba, KERN_ERR, LOG_LINK_EVENT,
"%d:1300 Re-establishing Link, timer expired " "1300 Re-establishing Link, timer expired "
"Data: x%x x%x\n", "Data: x%x x%x\n",
phba->brd_no, phba->pport->fc_flag, phba->pport->fc_flag, phba->pport->port_state);
phba->pport->port_state);
vports = lpfc_create_vport_work_array(phba); vports = lpfc_create_vport_work_array(phba);
if (vports != NULL) if (vports != NULL)
for(i = 0; i < LPFC_MAX_VPORTS && vports[i] != NULL; i++) { for(i = 0; i < LPFC_MAX_VPORTS && vports[i] != NULL; i++) {
...@@ -1382,8 +1371,7 @@ lpfc_online(struct lpfc_hba *phba) ...@@ -1382,8 +1371,7 @@ lpfc_online(struct lpfc_hba *phba)
return 0; return 0;
lpfc_printf_log(phba, KERN_WARNING, LOG_INIT, lpfc_printf_log(phba, KERN_WARNING, LOG_INIT,
"%d:0458 Bring Adapter online\n", "0458 Bring Adapter online\n");
phba->brd_no);
lpfc_block_mgmt_io(phba); lpfc_block_mgmt_io(phba);
...@@ -1468,8 +1456,7 @@ lpfc_offline(struct lpfc_hba *phba) ...@@ -1468,8 +1456,7 @@ lpfc_offline(struct lpfc_hba *phba)
/* stop all timers associated with this hba */ /* stop all timers associated with this hba */
lpfc_stop_phba_timers(phba); lpfc_stop_phba_timers(phba);
lpfc_printf_log(phba, KERN_WARNING, LOG_INIT, lpfc_printf_log(phba, KERN_WARNING, LOG_INIT,
"%d:0460 Bring Adapter offline\n", "0460 Bring Adapter offline\n");
phba->brd_no);
/* Bring down the SLI Layer and cleanup. The HBA is offline /* Bring down the SLI Layer and cleanup. The HBA is offline
now. */ now. */
lpfc_sli_hba_down(phba); lpfc_sli_hba_down(phba);
...@@ -1648,17 +1635,15 @@ int lpfc_scan_finished(struct Scsi_Host *shost, unsigned long time) ...@@ -1648,17 +1635,15 @@ int lpfc_scan_finished(struct Scsi_Host *shost, unsigned long time)
} }
if (time >= 30 * HZ) { if (time >= 30 * HZ) {
lpfc_printf_log(phba, KERN_INFO, LOG_INIT, lpfc_printf_log(phba, KERN_INFO, LOG_INIT,
"%d:0461 Scanning longer than 30 " "0461 Scanning longer than 30 "
"seconds. Continuing initialization\n", "seconds. Continuing initialization\n");
phba->brd_no);
stat = 1; stat = 1;
goto finished; goto finished;
} }
if (time >= 15 * HZ && phba->link_state <= LPFC_LINK_DOWN) { if (time >= 15 * HZ && phba->link_state <= LPFC_LINK_DOWN) {
lpfc_printf_log(phba, KERN_INFO, LOG_INIT, lpfc_printf_log(phba, KERN_INFO, LOG_INIT,
"%d:0465 Link down longer than 15 " "0465 Link down longer than 15 "
"seconds. Continuing initialization\n", "seconds. Continuing initialization\n");
phba->brd_no);
stat = 1; stat = 1;
goto finished; goto finished;
} }
...@@ -1910,17 +1895,16 @@ lpfc_pci_probe_one(struct pci_dev *pdev, const struct pci_device_id *pid) ...@@ -1910,17 +1895,16 @@ lpfc_pci_probe_one(struct pci_dev *pdev, const struct pci_device_id *pid)
if (phba->cfg_use_msi) { if (phba->cfg_use_msi) {
error = pci_enable_msi(phba->pcidev); error = pci_enable_msi(phba->pcidev);
if (error) if (error)
lpfc_printf_log(phba, KERN_INFO, LOG_INIT, "%d:0452 " lpfc_printf_log(phba, KERN_INFO, LOG_INIT,
"Enable MSI failed, continuing with " "0452 Enable MSI failed, continuing "
"IRQ\n", phba->brd_no); "with IRQ\n");
} }
error = request_irq(phba->pcidev->irq, lpfc_intr_handler, IRQF_SHARED, error = request_irq(phba->pcidev->irq, lpfc_intr_handler, IRQF_SHARED,
LPFC_DRIVER_NAME, phba); LPFC_DRIVER_NAME, phba);
if (error) { if (error) {
lpfc_printf_log(phba, KERN_ERR, LOG_INIT, lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
"%d:0451 Enable interrupt handler failed\n", "0451 Enable interrupt handler failed\n");
phba->brd_no);
goto out_disable_msi; goto out_disable_msi;
} }
......
...@@ -33,6 +33,12 @@ ...@@ -33,6 +33,12 @@
#define LOG_VPORT 0x4000 /* NPIV events */ #define LOG_VPORT 0x4000 /* NPIV events */
#define LOG_ALL_MSG 0xffff /* LOG all messages */ #define LOG_ALL_MSG 0xffff /* LOG all messages */
#define lpfc_printf_vlog(vport, level, mask, fmt, arg...) \
{ if (((mask) &(vport)->cfg_log_verbose) || (level[1] <= '3')) \
dev_printk(level, &((vport)->phba->pcidev)->dev, "%d:(%d):" \
fmt, (vport)->phba->brd_no, vport->vpi, ##arg); }
#define lpfc_printf_log(phba, level, mask, fmt, arg...) \ #define lpfc_printf_log(phba, level, mask, fmt, arg...) \
{ if (((mask) &(phba)->cfg_log_verbose) || (level[1] <= '3')) \ { if (((mask) &(phba)->pport->cfg_log_verbose) || (level[1] <= '3')) \
dev_printk(level, &((phba)->pcidev)->dev, fmt, ##arg); } dev_printk(level, &((phba)->pcidev)->dev, "%d:" \
fmt, phba->brd_no, ##arg); }
...@@ -275,11 +275,8 @@ lpfc_read_sparam(struct lpfc_hba *phba, LPFC_MBOXQ_t *pmb, int vpi) ...@@ -275,11 +275,8 @@ lpfc_read_sparam(struct lpfc_hba *phba, LPFC_MBOXQ_t *pmb, int vpi)
kfree(mp); kfree(mp);
mb->mbxCommand = MBX_READ_SPARM64; mb->mbxCommand = MBX_READ_SPARM64;
/* READ_SPARAM: no buffers */ /* READ_SPARAM: no buffers */
lpfc_printf_log(phba, lpfc_printf_log(phba, KERN_WARNING, LOG_MBOX,
KERN_WARNING, "0301 READ_SPARAM: no buffers\n");
LOG_MBOX,
"%d:0301 READ_SPARAM: no buffers\n",
phba->brd_no);
return (1); return (1);
} }
INIT_LIST_HEAD(&mp->list); INIT_LIST_HEAD(&mp->list);
...@@ -378,9 +375,8 @@ lpfc_reg_login(struct lpfc_hba *phba, uint16_t vpi, uint32_t did, ...@@ -378,9 +375,8 @@ lpfc_reg_login(struct lpfc_hba *phba, uint16_t vpi, uint32_t did,
mb->mbxCommand = MBX_REG_LOGIN64; mb->mbxCommand = MBX_REG_LOGIN64;
/* REG_LOGIN: no buffers */ /* REG_LOGIN: no buffers */
lpfc_printf_log(phba, KERN_WARNING, LOG_MBOX, lpfc_printf_log(phba, KERN_WARNING, LOG_MBOX,
"%d (%d):0302 REG_LOGIN: no buffers, DID x%x, " "0302 REG_LOGIN: no buffers, VPI:%d DID:x%x, "
"flag x%x\n", "flag x%x\n", vpi, did, flag);
phba->brd_no, vpi, did, flag);
return (1); return (1);
} }
INIT_LIST_HEAD(&mp->list); INIT_LIST_HEAD(&mp->list);
......
...@@ -133,15 +133,15 @@ lpfc_check_sparm(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp, ...@@ -133,15 +133,15 @@ lpfc_check_sparm(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp,
memcpy(&ndlp->nlp_portname, &sp->portName, sizeof (struct lpfc_name)); memcpy(&ndlp->nlp_portname, &sp->portName, sizeof (struct lpfc_name));
return 1; return 1;
bad_service_param: bad_service_param:
lpfc_printf_log(vport->phba, KERN_ERR, LOG_DISCOVERY, lpfc_printf_vlog(vport, KERN_ERR, LOG_DISCOVERY,
"%d (%d):0207 Device %x " "0207 Device %x "
"(%02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x) sent " "(%02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x) sent "
"invalid service parameters. Ignoring device.\n", "invalid service parameters. Ignoring device.\n",
vport->phba->brd_no, ndlp->vport->vpi, ndlp->nlp_DID, ndlp->nlp_DID,
sp->nodeName.u.wwn[0], sp->nodeName.u.wwn[1], sp->nodeName.u.wwn[0], sp->nodeName.u.wwn[1],
sp->nodeName.u.wwn[2], sp->nodeName.u.wwn[3], sp->nodeName.u.wwn[2], sp->nodeName.u.wwn[3],
sp->nodeName.u.wwn[4], sp->nodeName.u.wwn[5], sp->nodeName.u.wwn[4], sp->nodeName.u.wwn[5],
sp->nodeName.u.wwn[6], sp->nodeName.u.wwn[7]); sp->nodeName.u.wwn[6], sp->nodeName.u.wwn[7]);
return 0; return 0;
} }
...@@ -194,11 +194,11 @@ lpfc_els_abort(struct lpfc_hba *phba, struct lpfc_nodelist *ndlp) ...@@ -194,11 +194,11 @@ lpfc_els_abort(struct lpfc_hba *phba, struct lpfc_nodelist *ndlp)
IOCB_t *cmd; IOCB_t *cmd;
/* Abort outstanding I/O on NPort <nlp_DID> */ /* Abort outstanding I/O on NPort <nlp_DID> */
lpfc_printf_log(phba, KERN_INFO, LOG_DISCOVERY, lpfc_printf_vlog(ndlp->vport, KERN_INFO, LOG_DISCOVERY,
"%d (%d):0205 Abort outstanding I/O on NPort x%x " "0205 Abort outstanding I/O on NPort x%x "
"Data: x%x x%x x%x\n", "Data: x%x x%x x%x\n",
phba->brd_no, ndlp->vport->vpi, ndlp->nlp_DID, ndlp->nlp_DID, ndlp->nlp_flag, ndlp->nlp_state,
ndlp->nlp_flag, ndlp->nlp_state, ndlp->nlp_rpi); ndlp->nlp_rpi);
lpfc_fabric_abort_nport(ndlp); lpfc_fabric_abort_nport(ndlp);
...@@ -298,11 +298,10 @@ lpfc_rcv_plogi(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp, ...@@ -298,11 +298,10 @@ lpfc_rcv_plogi(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp,
icmd = &cmdiocb->iocb; icmd = &cmdiocb->iocb;
/* PLOGI chkparm OK */ /* PLOGI chkparm OK */
lpfc_printf_log(phba, KERN_INFO, LOG_ELS, lpfc_printf_vlog(vport, KERN_INFO, LOG_ELS,
"%d (%d):0114 PLOGI chkparm OK Data: x%x x%x x%x x%x\n", "0114 PLOGI chkparm OK Data: x%x x%x x%x x%x\n",
phba->brd_no, vport->vpi, ndlp->nlp_DID, ndlp->nlp_state, ndlp->nlp_flag,
ndlp->nlp_DID, ndlp->nlp_state, ndlp->nlp_flag, ndlp->nlp_rpi);
ndlp->nlp_rpi);
if (vport->cfg_fcp_class == 2 && sp->cls2.classValid) if (vport->cfg_fcp_class == 2 && sp->cls2.classValid)
ndlp->nlp_fcp_info |= CLASS2; ndlp->nlp_fcp_info |= CLASS2;
...@@ -582,12 +581,11 @@ static uint32_t ...@@ -582,12 +581,11 @@ static uint32_t
lpfc_disc_illegal(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp, lpfc_disc_illegal(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp,
void *arg, uint32_t evt) void *arg, uint32_t evt)
{ {
lpfc_printf_log(vport->phba, KERN_ERR, LOG_DISCOVERY, lpfc_printf_vlog(vport, KERN_ERR, LOG_DISCOVERY,
"%d (%d):0253 Illegal State Transition: node x%x " "0253 Illegal State Transition: node x%x "
"event x%x, state x%x Data: x%x x%x\n", "event x%x, state x%x Data: x%x x%x\n",
vport->phba->brd_no, vport->vpi, ndlp->nlp_DID, evt, ndlp->nlp_state, ndlp->nlp_rpi,
ndlp->nlp_DID, evt, ndlp->nlp_state, ndlp->nlp_rpi, ndlp->nlp_flag);
ndlp->nlp_flag);
return ndlp->nlp_state; return ndlp->nlp_state;
} }
...@@ -777,15 +775,11 @@ lpfc_cmpl_plogi_plogi_issue(struct lpfc_vport *vport, ...@@ -777,15 +775,11 @@ lpfc_cmpl_plogi_plogi_issue(struct lpfc_vport *vport,
sp = (struct serv_parm *) ((uint8_t *) lp + sizeof (uint32_t)); sp = (struct serv_parm *) ((uint8_t *) lp + sizeof (uint32_t));
if (!lpfc_check_sparm(vport, ndlp, sp, CLASS3)) if (!lpfc_check_sparm(vport, ndlp, sp, CLASS3))
goto out; goto out;
/* PLOGI chkparm OK */ /* PLOGI chkparm OK */
lpfc_printf_log(phba, KERN_INFO, LOG_ELS, lpfc_printf_vlog(vport, KERN_INFO, LOG_ELS,
"%d (%d):0121 PLOGI chkparm OK " "0121 PLOGI chkparm OK Data: x%x x%x x%x x%x\n",
"Data: x%x x%x x%x x%x\n", ndlp->nlp_DID, ndlp->nlp_state,
phba->brd_no, vport->vpi, ndlp->nlp_flag, ndlp->nlp_rpi);
ndlp->nlp_DID, ndlp->nlp_state,
ndlp->nlp_flag, ndlp->nlp_rpi);
if (vport->cfg_fcp_class == 2 && (sp->cls2.classValid)) if (vport->cfg_fcp_class == 2 && (sp->cls2.classValid))
ndlp->nlp_fcp_info |= CLASS2; ndlp->nlp_fcp_info |= CLASS2;
else else
...@@ -805,10 +799,9 @@ lpfc_cmpl_plogi_plogi_issue(struct lpfc_vport *vport, ...@@ -805,10 +799,9 @@ lpfc_cmpl_plogi_plogi_issue(struct lpfc_vport *vport,
mbox = mempool_alloc(phba->mbox_mem_pool, GFP_KERNEL); mbox = mempool_alloc(phba->mbox_mem_pool, GFP_KERNEL);
if (!mbox) { if (!mbox) {
lpfc_printf_log(phba, KERN_ERR, LOG_ELS, lpfc_printf_vlog(vport, KERN_ERR, LOG_ELS,
"%d (%d):0133 PLOGI: no memory for reg_login " "0133 PLOGI: no memory for reg_login "
"Data: x%x x%x x%x x%x\n", "Data: x%x x%x x%x x%x\n",
phba->brd_no, vport->vpi,
ndlp->nlp_DID, ndlp->nlp_state, ndlp->nlp_DID, ndlp->nlp_state,
ndlp->nlp_flag, ndlp->nlp_rpi); ndlp->nlp_flag, ndlp->nlp_rpi);
goto out; goto out;
...@@ -843,30 +836,27 @@ lpfc_cmpl_plogi_plogi_issue(struct lpfc_vport *vport, ...@@ -843,30 +836,27 @@ lpfc_cmpl_plogi_plogi_issue(struct lpfc_vport *vport,
kfree(mp); kfree(mp);
mempool_free(mbox, phba->mbox_mem_pool); mempool_free(mbox, phba->mbox_mem_pool);
lpfc_printf_log(phba, KERN_ERR, LOG_ELS, lpfc_printf_vlog(vport, KERN_ERR, LOG_ELS,
"%d (%d):0134 PLOGI: cannot issue reg_login " "0134 PLOGI: cannot issue reg_login "
"Data: x%x x%x x%x x%x\n", "Data: x%x x%x x%x x%x\n",
phba->brd_no, vport->vpi, ndlp->nlp_DID, ndlp->nlp_state,
ndlp->nlp_DID, ndlp->nlp_state, ndlp->nlp_flag, ndlp->nlp_rpi);
ndlp->nlp_flag, ndlp->nlp_rpi);
} else { } else {
mempool_free(mbox, phba->mbox_mem_pool); mempool_free(mbox, phba->mbox_mem_pool);
lpfc_printf_log(phba, KERN_ERR, LOG_ELS, lpfc_printf_vlog(vport, KERN_ERR, LOG_ELS,
"%d (%d):0135 PLOGI: cannot format reg_login " "0135 PLOGI: cannot format reg_login "
"Data: x%x x%x x%x x%x\n", "Data: x%x x%x x%x x%x\n",
phba->brd_no, vport->vpi, ndlp->nlp_DID, ndlp->nlp_state,
ndlp->nlp_DID, ndlp->nlp_state, ndlp->nlp_flag, ndlp->nlp_rpi);
ndlp->nlp_flag, ndlp->nlp_rpi);
} }
out: out:
if (ndlp->nlp_DID == NameServer_DID) { if (ndlp->nlp_DID == NameServer_DID) {
lpfc_vport_set_state(vport, FC_VPORT_FAILED); lpfc_vport_set_state(vport, FC_VPORT_FAILED);
lpfc_printf_log(phba, KERN_ERR, LOG_ELS, lpfc_printf_vlog(vport, KERN_ERR, LOG_ELS,
"%d (%d):0261 Cannot Register NameServer login\n", "0261 Cannot Register NameServer login\n");
phba->brd_no, vport->vpi);
} }
/* Free this node since the driver cannot login or has the wrong /* Free this node since the driver cannot login or has the wrong
...@@ -1188,19 +1178,15 @@ lpfc_cmpl_reglogin_reglogin_issue(struct lpfc_vport *vport, ...@@ -1188,19 +1178,15 @@ lpfc_cmpl_reglogin_reglogin_issue(struct lpfc_vport *vport,
uint32_t evt) uint32_t evt)
{ {
struct Scsi_Host *shost = lpfc_shost_from_vport(vport); struct Scsi_Host *shost = lpfc_shost_from_vport(vport);
struct lpfc_hba *phba = vport->phba;
LPFC_MBOXQ_t *pmb = (LPFC_MBOXQ_t *) arg; LPFC_MBOXQ_t *pmb = (LPFC_MBOXQ_t *) arg;
MAILBOX_t *mb = &pmb->mb; MAILBOX_t *mb = &pmb->mb;
uint32_t did = mb->un.varWords[1]; uint32_t did = mb->un.varWords[1];
if (mb->mbxStatus) { if (mb->mbxStatus) {
/* RegLogin failed */ /* RegLogin failed */
lpfc_printf_log(phba, KERN_ERR, LOG_DISCOVERY, lpfc_printf_vlog(vport, KERN_ERR, LOG_DISCOVERY,
"%d (%d):0246 RegLogin failed Data: x%x x%x " "0246 RegLogin failed Data: x%x x%x x%x\n",
"x%x\n",
phba->brd_no, vport->vpi,
did, mb->mbxStatus, vport->port_state); did, mb->mbxStatus, vport->port_state);
/* /*
* If RegLogin failed due to lack of HBA resources do not * If RegLogin failed due to lack of HBA resources do not
* retry discovery. * retry discovery.
...@@ -2046,7 +2032,6 @@ int ...@@ -2046,7 +2032,6 @@ int
lpfc_disc_state_machine(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp, lpfc_disc_state_machine(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp,
void *arg, uint32_t evt) void *arg, uint32_t evt)
{ {
struct lpfc_hba *phba = vport->phba;
uint32_t cur_state, rc; uint32_t cur_state, rc;
uint32_t(*func) (struct lpfc_vport *, struct lpfc_nodelist *, void *, uint32_t(*func) (struct lpfc_vport *, struct lpfc_nodelist *, void *,
uint32_t); uint32_t);
...@@ -2055,11 +2040,10 @@ lpfc_disc_state_machine(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp, ...@@ -2055,11 +2040,10 @@ lpfc_disc_state_machine(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp,
cur_state = ndlp->nlp_state; cur_state = ndlp->nlp_state;
/* DSM in event <evt> on NPort <nlp_DID> in state <cur_state> */ /* DSM in event <evt> on NPort <nlp_DID> in state <cur_state> */
lpfc_printf_log(phba, KERN_INFO, LOG_DISCOVERY, lpfc_printf_vlog(vport, KERN_INFO, LOG_DISCOVERY,
"%d (%d):0211 DSM in event x%x on NPort x%x in " "0211 DSM in event x%x on NPort x%x in "
"state %d Data: x%x\n", "state %d Data: x%x\n",
phba->brd_no, vport->vpi, evt, ndlp->nlp_DID, cur_state, ndlp->nlp_flag);
evt, ndlp->nlp_DID, cur_state, ndlp->nlp_flag);
lpfc_debugfs_disc_trc(vport, LPFC_DISC_TRC_DSM, lpfc_debugfs_disc_trc(vport, LPFC_DISC_TRC_DSM,
"DSM in: evt:%d ste:%d did:x%x", "DSM in: evt:%d ste:%d did:x%x",
...@@ -2069,11 +2053,9 @@ lpfc_disc_state_machine(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp, ...@@ -2069,11 +2053,9 @@ lpfc_disc_state_machine(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp,
rc = (func) (vport, ndlp, arg, evt); rc = (func) (vport, ndlp, arg, evt);
/* DSM out state <rc> on NPort <nlp_DID> */ /* DSM out state <rc> on NPort <nlp_DID> */
lpfc_printf_log(phba, KERN_INFO, LOG_DISCOVERY, lpfc_printf_vlog(vport, KERN_INFO, LOG_DISCOVERY,
"%d (%d):0212 DSM out state %d on NPort x%x " "0212 DSM out state %d on NPort x%x Data: x%x\n",
"Data: x%x\n", rc, ndlp->nlp_DID, ndlp->nlp_flag);
phba->brd_no, vport->vpi,
rc, ndlp->nlp_DID, ndlp->nlp_flag);
lpfc_debugfs_disc_trc(vport, LPFC_DISC_TRC_DSM, lpfc_debugfs_disc_trc(vport, LPFC_DISC_TRC_DSM,
"DSM out: ste:%d did:x%x flg:x%x", "DSM out: ste:%d did:x%x flg:x%x",
......
...@@ -406,9 +406,7 @@ lpfc_handle_fcp_err(struct lpfc_vport *vport, struct lpfc_scsi_buf *lpfc_cmd, ...@@ -406,9 +406,7 @@ lpfc_handle_fcp_err(struct lpfc_vport *vport, struct lpfc_scsi_buf *lpfc_cmd,
struct scsi_cmnd *cmnd = lpfc_cmd->pCmd; struct scsi_cmnd *cmnd = lpfc_cmd->pCmd;
struct fcp_cmnd *fcpcmd = lpfc_cmd->fcp_cmnd; struct fcp_cmnd *fcpcmd = lpfc_cmd->fcp_cmnd;
struct fcp_rsp *fcprsp = lpfc_cmd->fcp_rsp; struct fcp_rsp *fcprsp = lpfc_cmd->fcp_rsp;
struct lpfc_hba *phba = vport->phba;
uint32_t fcpi_parm = rsp_iocb->iocb.un.fcpi.fcpi_parm; uint32_t fcpi_parm = rsp_iocb->iocb.un.fcpi.fcpi_parm;
uint32_t vpi = vport->vpi;
uint32_t resp_info = fcprsp->rspStatus2; uint32_t resp_info = fcprsp->rspStatus2;
uint32_t scsi_status = fcprsp->rspStatus3; uint32_t scsi_status = fcprsp->rspStatus3;
uint32_t *lp; uint32_t *lp;
...@@ -440,15 +438,15 @@ lpfc_handle_fcp_err(struct lpfc_vport *vport, struct lpfc_scsi_buf *lpfc_cmd, ...@@ -440,15 +438,15 @@ lpfc_handle_fcp_err(struct lpfc_vport *vport, struct lpfc_scsi_buf *lpfc_cmd,
if (!scsi_status && (resp_info & RESID_UNDER)) if (!scsi_status && (resp_info & RESID_UNDER))
logit = LOG_FCP; logit = LOG_FCP;
lpfc_printf_log(phba, KERN_WARNING, logit, lpfc_printf_vlog(vport, KERN_WARNING, logit,
"%d (%d):0730 FCP command x%x failed: x%x SNS x%x x%x " "0730 FCP command x%x failed: x%x SNS x%x x%x "
"Data: x%x x%x x%x x%x x%x\n", "Data: x%x x%x x%x x%x x%x\n",
phba->brd_no, vpi, cmnd->cmnd[0], scsi_status, cmnd->cmnd[0], scsi_status,
be32_to_cpu(*lp), be32_to_cpu(*(lp + 3)), resp_info, be32_to_cpu(*lp), be32_to_cpu(*(lp + 3)), resp_info,
be32_to_cpu(fcprsp->rspResId), be32_to_cpu(fcprsp->rspResId),
be32_to_cpu(fcprsp->rspSnsLen), be32_to_cpu(fcprsp->rspSnsLen),
be32_to_cpu(fcprsp->rspRspLen), be32_to_cpu(fcprsp->rspRspLen),
fcprsp->rspInfo3); fcprsp->rspInfo3);
if (resp_info & RSP_LEN_VALID) { if (resp_info & RSP_LEN_VALID) {
rsplen = be32_to_cpu(fcprsp->rspRspLen); rsplen = be32_to_cpu(fcprsp->rspRspLen);
...@@ -463,12 +461,12 @@ lpfc_handle_fcp_err(struct lpfc_vport *vport, struct lpfc_scsi_buf *lpfc_cmd, ...@@ -463,12 +461,12 @@ lpfc_handle_fcp_err(struct lpfc_vport *vport, struct lpfc_scsi_buf *lpfc_cmd,
if (resp_info & RESID_UNDER) { if (resp_info & RESID_UNDER) {
scsi_set_resid(cmnd, be32_to_cpu(fcprsp->rspResId)); scsi_set_resid(cmnd, be32_to_cpu(fcprsp->rspResId));
lpfc_printf_log(phba, KERN_INFO, LOG_FCP, lpfc_printf_vlog(vport, KERN_INFO, LOG_FCP,
"%d (%d):0716 FCP Read Underrun, expected %d, " "0716 FCP Read Underrun, expected %d, "
"residual %d Data: x%x x%x x%x\n", "residual %d Data: x%x x%x x%x\n",
phba->brd_no, vpi, be32_to_cpu(fcpcmd->fcpDl), be32_to_cpu(fcpcmd->fcpDl),
scsi_get_resid(cmnd), fcpi_parm, cmnd->cmnd[0], scsi_get_resid(cmnd), fcpi_parm, cmnd->cmnd[0],
cmnd->underflow); cmnd->underflow);
/* /*
* If there is an under run check if under run reported by * If there is an under run check if under run reported by
...@@ -478,14 +476,13 @@ lpfc_handle_fcp_err(struct lpfc_vport *vport, struct lpfc_scsi_buf *lpfc_cmd, ...@@ -478,14 +476,13 @@ lpfc_handle_fcp_err(struct lpfc_vport *vport, struct lpfc_scsi_buf *lpfc_cmd,
if ((cmnd->sc_data_direction == DMA_FROM_DEVICE) && if ((cmnd->sc_data_direction == DMA_FROM_DEVICE) &&
fcpi_parm && fcpi_parm &&
(scsi_get_resid(cmnd) != fcpi_parm)) { (scsi_get_resid(cmnd) != fcpi_parm)) {
lpfc_printf_log(phba, KERN_WARNING, lpfc_printf_vlog(vport, KERN_WARNING,
LOG_FCP | LOG_FCP_ERROR, LOG_FCP | LOG_FCP_ERROR,
"%d (%d):0735 FCP Read Check Error " "0735 FCP Read Check Error "
"and Underrun Data: x%x x%x x%x x%x\n", "and Underrun Data: x%x x%x x%x x%x\n",
phba->brd_no, vpi, be32_to_cpu(fcpcmd->fcpDl),
be32_to_cpu(fcpcmd->fcpDl), scsi_get_resid(cmnd), fcpi_parm,
scsi_get_resid(cmnd), fcpi_parm, cmnd->cmnd[0]);
cmnd->cmnd[0]);
scsi_set_resid(cmnd, scsi_bufflen(cmnd)); scsi_set_resid(cmnd, scsi_bufflen(cmnd));
host_status = DID_ERROR; host_status = DID_ERROR;
} }
...@@ -499,21 +496,19 @@ lpfc_handle_fcp_err(struct lpfc_vport *vport, struct lpfc_scsi_buf *lpfc_cmd, ...@@ -499,21 +496,19 @@ lpfc_handle_fcp_err(struct lpfc_vport *vport, struct lpfc_scsi_buf *lpfc_cmd,
(scsi_status == SAM_STAT_GOOD) && (scsi_status == SAM_STAT_GOOD) &&
(scsi_bufflen(cmnd) - scsi_get_resid(cmnd) (scsi_bufflen(cmnd) - scsi_get_resid(cmnd)
< cmnd->underflow)) { < cmnd->underflow)) {
lpfc_printf_log(phba, KERN_INFO, LOG_FCP, lpfc_printf_vlog(vport, KERN_INFO, LOG_FCP,
"%d (%d):0717 FCP command x%x residual " "0717 FCP command x%x residual "
"underrun converted to error " "underrun converted to error "
"Data: x%x x%x x%x\n", "Data: x%x x%x x%x\n",
phba->brd_no, vpi, cmnd->cmnd[0], cmnd->cmnd[0], cmnd->request_bufflen,
scsi_bufflen(cmnd), scsi_get_resid(cmnd), cmnd->underflow);
scsi_get_resid(cmnd), cmnd->underflow);
host_status = DID_ERROR; host_status = DID_ERROR;
} }
} else if (resp_info & RESID_OVER) { } else if (resp_info & RESID_OVER) {
lpfc_printf_log(phba, KERN_WARNING, LOG_FCP, lpfc_printf_vlog(vport, KERN_WARNING, LOG_FCP,
"%d (%d):0720 FCP command x%x residual " "0720 FCP command x%x residual overrun error. "
"overrun error. Data: x%x x%x \n", "Data: x%x x%x \n", cmnd->cmnd[0],
phba->brd_no, vpi, cmnd->cmnd[0], scsi_bufflen(cmnd), scsi_get_resid(cmnd));
scsi_bufflen(cmnd), scsi_get_resid(cmnd));
host_status = DID_ERROR; host_status = DID_ERROR;
/* /*
...@@ -522,13 +517,12 @@ lpfc_handle_fcp_err(struct lpfc_vport *vport, struct lpfc_scsi_buf *lpfc_cmd, ...@@ -522,13 +517,12 @@ lpfc_handle_fcp_err(struct lpfc_vport *vport, struct lpfc_scsi_buf *lpfc_cmd,
*/ */
} else if ((scsi_status == SAM_STAT_GOOD) && fcpi_parm && } else if ((scsi_status == SAM_STAT_GOOD) && fcpi_parm &&
(cmnd->sc_data_direction == DMA_FROM_DEVICE)) { (cmnd->sc_data_direction == DMA_FROM_DEVICE)) {
lpfc_printf_log(phba, KERN_WARNING, LOG_FCP | LOG_FCP_ERROR, lpfc_printf_vlog(vport, KERN_WARNING, LOG_FCP | LOG_FCP_ERROR,
"%d (%d):0734 FCP Read Check Error Data: " "0734 FCP Read Check Error Data: "
"x%x x%x x%x x%x\n", "x%x x%x x%x x%x\n",
phba->brd_no, vpi, be32_to_cpu(fcpcmd->fcpDl),
be32_to_cpu(fcpcmd->fcpDl), be32_to_cpu(fcprsp->rspResId),
be32_to_cpu(fcprsp->rspResId), fcpi_parm, cmnd->cmnd[0]);
fcpi_parm, cmnd->cmnd[0]);
host_status = DID_ERROR; host_status = DID_ERROR;
scsi_set_resid(cmnd, scsi_bufflen(cmnd)); scsi_set_resid(cmnd, scsi_bufflen(cmnd));
} }
...@@ -547,9 +541,6 @@ lpfc_scsi_cmd_iocb_cmpl(struct lpfc_hba *phba, struct lpfc_iocbq *pIocbIn, ...@@ -547,9 +541,6 @@ lpfc_scsi_cmd_iocb_cmpl(struct lpfc_hba *phba, struct lpfc_iocbq *pIocbIn,
struct lpfc_rport_data *rdata = lpfc_cmd->rdata; struct lpfc_rport_data *rdata = lpfc_cmd->rdata;
struct lpfc_nodelist *pnode = rdata->pnode; struct lpfc_nodelist *pnode = rdata->pnode;
struct scsi_cmnd *cmd = lpfc_cmd->pCmd; struct scsi_cmnd *cmd = lpfc_cmd->pCmd;
uint32_t vpi = (lpfc_cmd->cur_iocbq.vport
? lpfc_cmd->cur_iocbq.vport->vpi
: 0);
int result; int result;
struct scsi_device *sdev, *tmp_sdev; struct scsi_device *sdev, *tmp_sdev;
int depth = 0; int depth = 0;
...@@ -564,15 +555,15 @@ lpfc_scsi_cmd_iocb_cmpl(struct lpfc_hba *phba, struct lpfc_iocbq *pIocbIn, ...@@ -564,15 +555,15 @@ lpfc_scsi_cmd_iocb_cmpl(struct lpfc_hba *phba, struct lpfc_iocbq *pIocbIn,
else if (lpfc_cmd->status >= IOSTAT_CNT) else if (lpfc_cmd->status >= IOSTAT_CNT)
lpfc_cmd->status = IOSTAT_DEFAULT; lpfc_cmd->status = IOSTAT_DEFAULT;
lpfc_printf_log(phba, KERN_WARNING, LOG_FCP, lpfc_printf_vlog(vport, KERN_WARNING, LOG_FCP,
"%d (%d):0729 FCP cmd x%x failed <%d/%d> " "0729 FCP cmd x%x failed <%d/%d> "
"status: x%x result: x%x Data: x%x x%x\n", "status: x%x result: x%x Data: x%x x%x\n",
phba->brd_no, vpi, cmd->cmnd[0], cmd->cmnd[0],
cmd->device ? cmd->device->id : 0xffff, cmd->device ? cmd->device->id : 0xffff,
cmd->device ? cmd->device->lun : 0xffff, cmd->device ? cmd->device->lun : 0xffff,
lpfc_cmd->status, lpfc_cmd->result, lpfc_cmd->status, lpfc_cmd->result,
pIocbOut->iocb.ulpContext, pIocbOut->iocb.ulpContext,
lpfc_cmd->cur_iocbq.iocb.ulpIoTag); lpfc_cmd->cur_iocbq.iocb.ulpIoTag);
switch (lpfc_cmd->status) { switch (lpfc_cmd->status) {
case IOSTAT_FCP_RSP_ERROR: case IOSTAT_FCP_RSP_ERROR:
...@@ -605,13 +596,12 @@ lpfc_scsi_cmd_iocb_cmpl(struct lpfc_hba *phba, struct lpfc_iocbq *pIocbIn, ...@@ -605,13 +596,12 @@ lpfc_scsi_cmd_iocb_cmpl(struct lpfc_hba *phba, struct lpfc_iocbq *pIocbIn,
if (cmd->result || lpfc_cmd->fcp_rsp->rspSnsLen) { if (cmd->result || lpfc_cmd->fcp_rsp->rspSnsLen) {
uint32_t *lp = (uint32_t *)cmd->sense_buffer; uint32_t *lp = (uint32_t *)cmd->sense_buffer;
lpfc_printf_log(phba, KERN_INFO, LOG_FCP, lpfc_printf_vlog(vport, KERN_INFO, LOG_FCP,
"%d (%d):0710 Iodone <%d/%d> cmd %p, error " "0710 Iodone <%d/%d> cmd %p, error "
"x%x SNS x%x x%x Data: x%x x%x\n", "x%x SNS x%x x%x Data: x%x x%x\n",
phba->brd_no, vpi, cmd->device->id, cmd->device->id, cmd->device->lun, cmd,
cmd->device->lun, cmd, cmd->result, cmd->result, *lp, *(lp + 3), cmd->retries,
*lp, *(lp + 3), cmd->retries, scsi_get_resid(cmd));
scsi_get_resid(cmd));
} }
result = cmd->result; result = cmd->result;
...@@ -675,10 +665,9 @@ lpfc_scsi_cmd_iocb_cmpl(struct lpfc_hba *phba, struct lpfc_iocbq *pIocbIn, ...@@ -675,10 +665,9 @@ lpfc_scsi_cmd_iocb_cmpl(struct lpfc_hba *phba, struct lpfc_iocbq *pIocbIn,
depth = sdev->host->cmd_per_lun; depth = sdev->host->cmd_per_lun;
if (depth) { if (depth) {
lpfc_printf_log(phba, KERN_WARNING, LOG_FCP, lpfc_printf_vlog(vport, KERN_WARNING, LOG_FCP,
"%d (%d):0711 detected queue full - " "0711 detected queue full - lun queue "
"lun queue depth adjusted to %d.\n", "depth adjusted to %d.\n", depth);
phba->brd_no, vpi, depth);
} }
} }
...@@ -848,12 +837,9 @@ lpfc_scsi_tgt_reset(struct lpfc_scsi_buf *lpfc_cmd, struct lpfc_vport *vport, ...@@ -848,12 +837,9 @@ lpfc_scsi_tgt_reset(struct lpfc_scsi_buf *lpfc_cmd, struct lpfc_vport *vport,
return FAILED; return FAILED;
/* Issue Target Reset to TGT <num> */ /* Issue Target Reset to TGT <num> */
lpfc_printf_log(phba, KERN_INFO, LOG_FCP, lpfc_printf_vlog(vport, KERN_INFO, LOG_FCP,
"%d (%d):0702 Issue Target Reset to TGT %d " "0702 Issue Target Reset to TGT %d Data: x%x x%x\n",
"Data: x%x x%x\n", tgt_id, rdata->pnode->nlp_rpi, rdata->pnode->nlp_flag);
phba->brd_no, vport->vpi, tgt_id,
rdata->pnode->nlp_rpi, rdata->pnode->nlp_flag);
ret = lpfc_sli_issue_iocb_wait(phba, ret = lpfc_sli_issue_iocb_wait(phba,
&phba->sli.ring[phba->sli.fcp_ring], &phba->sli.ring[phba->sli.fcp_ring],
iocbq, iocbqrsp, lpfc_cmd->timeout); iocbq, iocbqrsp, lpfc_cmd->timeout);
...@@ -960,10 +946,9 @@ lpfc_queuecommand(struct scsi_cmnd *cmnd, void (*done) (struct scsi_cmnd *)) ...@@ -960,10 +946,9 @@ lpfc_queuecommand(struct scsi_cmnd *cmnd, void (*done) (struct scsi_cmnd *))
if (lpfc_cmd == NULL) { if (lpfc_cmd == NULL) {
lpfc_adjust_queue_depth(phba); lpfc_adjust_queue_depth(phba);
lpfc_printf_log(phba, KERN_INFO, LOG_FCP, lpfc_printf_vlog(vport, KERN_INFO, LOG_FCP,
"%d (%d):0707 driver's buffer pool is empty, " "0707 driver's buffer pool is empty, "
"IO busied\n", "IO busied\n");
phba->brd_no, vport->vpi);
goto out_host_busy; goto out_host_busy;
} }
...@@ -1104,22 +1089,19 @@ lpfc_abort_handler(struct scsi_cmnd *cmnd) ...@@ -1104,22 +1089,19 @@ lpfc_abort_handler(struct scsi_cmnd *cmnd)
if (lpfc_cmd->pCmd == cmnd) { if (lpfc_cmd->pCmd == cmnd) {
ret = FAILED; ret = FAILED;
lpfc_printf_log(phba, KERN_ERR, LOG_FCP, lpfc_printf_vlog(vport, KERN_ERR, LOG_FCP,
"%d (%d):0748 abort handler timed out waiting " "0748 abort handler timed out waiting "
"for abort to complete: ret %#x, ID %d, " "for abort to complete: ret %#x, ID %d, "
"LUN %d, snum %#lx\n", "LUN %d, snum %#lx\n",
phba->brd_no, vport->vpi, ret, ret, cmnd->device->id, cmnd->device->lun,
cmnd->device->id, cmnd->device->lun, cmnd->serial_number);
cmnd->serial_number);
} }
out: out:
lpfc_printf_log(phba, KERN_WARNING, LOG_FCP, lpfc_printf_vlog(vport, KERN_WARNING, LOG_FCP,
"%d (%d):0749 SCSI Layer I/O Abort Request " "0749 SCSI Layer I/O Abort Request Status x%x ID %d "
"Status x%x ID %d LUN %d snum %#lx\n", "LUN %d snum %#lx\n", ret, cmnd->device->id,
phba->brd_no, vport->vpi, ret, cmnd->device->id, cmnd->device->lun, cmnd->serial_number);
cmnd->device->lun, cmnd->serial_number);
return ret; return ret;
} }
...@@ -1154,11 +1136,10 @@ lpfc_device_reset_handler(struct scsi_cmnd *cmnd) ...@@ -1154,11 +1136,10 @@ lpfc_device_reset_handler(struct scsi_cmnd *cmnd)
rdata = cmnd->device->hostdata; rdata = cmnd->device->hostdata;
if (!rdata || if (!rdata ||
(loopcnt > ((vport->cfg_devloss_tmo * 2) + 1))){ (loopcnt > ((vport->cfg_devloss_tmo * 2) + 1))){
lpfc_printf_log(phba, KERN_ERR, LOG_FCP, lpfc_printf_vlog(vport, KERN_ERR, LOG_FCP,
"%d (%d):0721 LUN Reset rport " "0721 LUN Reset rport "
"failure: cnt x%x rdata x%p\n", "failure: cnt x%x rdata x%p\n",
phba->brd_no, vport->vpi, loopcnt, rdata);
loopcnt, rdata);
goto out; goto out;
} }
pnode = rdata->pnode; pnode = rdata->pnode;
...@@ -1188,12 +1169,10 @@ lpfc_device_reset_handler(struct scsi_cmnd *cmnd) ...@@ -1188,12 +1169,10 @@ lpfc_device_reset_handler(struct scsi_cmnd *cmnd)
if (iocbqrsp == NULL) if (iocbqrsp == NULL)
goto out_free_scsi_buf; goto out_free_scsi_buf;
lpfc_printf_log(phba, KERN_INFO, LOG_FCP, lpfc_printf_vlog(vport, KERN_INFO, LOG_FCP,
"%d (%d):0703 Issue target reset to TGT %d LUN %d " "0703 Issue target reset to TGT %d LUN %d "
"rpi x%x nlp_flag x%x\n", "rpi x%x nlp_flag x%x\n", cmnd->device->id,
phba->brd_no, vport->vpi, cmnd->device->id, cmnd->device->lun, pnode->nlp_rpi, pnode->nlp_flag);
cmnd->device->lun, pnode->nlp_rpi, pnode->nlp_flag);
iocb_status = lpfc_sli_issue_iocb_wait(phba, iocb_status = lpfc_sli_issue_iocb_wait(phba,
&phba->sli.ring[phba->sli.fcp_ring], &phba->sli.ring[phba->sli.fcp_ring],
iocbq, iocbqrsp, lpfc_cmd->timeout); iocbq, iocbqrsp, lpfc_cmd->timeout);
...@@ -1239,10 +1218,9 @@ lpfc_device_reset_handler(struct scsi_cmnd *cmnd) ...@@ -1239,10 +1218,9 @@ lpfc_device_reset_handler(struct scsi_cmnd *cmnd)
} }
if (cnt) { if (cnt) {
lpfc_printf_log(phba, KERN_ERR, LOG_FCP, lpfc_printf_vlog(vport, KERN_ERR, LOG_FCP,
"%d (%d):0719 device reset I/O flush failure: " "0719 device reset I/O flush failure: "
"cnt x%x\n", "cnt x%x\n", cnt);
phba->brd_no, vport->vpi, cnt);
ret = FAILED; ret = FAILED;
} }
...@@ -1250,12 +1228,11 @@ lpfc_device_reset_handler(struct scsi_cmnd *cmnd) ...@@ -1250,12 +1228,11 @@ lpfc_device_reset_handler(struct scsi_cmnd *cmnd)
if (iocb_status != IOCB_TIMEDOUT) { if (iocb_status != IOCB_TIMEDOUT) {
lpfc_release_scsi_buf(phba, lpfc_cmd); lpfc_release_scsi_buf(phba, lpfc_cmd);
} }
lpfc_printf_log(phba, KERN_ERR, LOG_FCP, lpfc_printf_vlog(vport, KERN_ERR, LOG_FCP,
"%d (%d):0713 SCSI layer issued device reset (%d, %d) " "0713 SCSI layer issued device reset (%d, %d) "
"return x%x status x%x result x%x\n", "return x%x status x%x result x%x\n",
phba->brd_no, vport->vpi, cmnd->device->id, cmnd->device->id, cmnd->device->lun, ret,
cmnd->device->lun, ret, cmd_status, cmd_result); cmd_status, cmd_result);
out: out:
return ret; return ret;
} }
...@@ -1306,10 +1283,9 @@ lpfc_bus_reset_handler(struct scsi_cmnd *cmnd) ...@@ -1306,10 +1283,9 @@ lpfc_bus_reset_handler(struct scsi_cmnd *cmnd)
cmnd->device->lun, cmnd->device->lun,
ndlp->rport->dd_data); ndlp->rport->dd_data);
if (ret != SUCCESS) { if (ret != SUCCESS) {
lpfc_printf_log(phba, KERN_ERR, LOG_FCP, lpfc_printf_vlog(vport, KERN_ERR, LOG_FCP,
"%d (%d):0700 Bus Reset on target %d " "0700 Bus Reset on target %d failed\n",
"failed\n", i);
phba->brd_no, vport->vpi, i);
err_count++; err_count++;
break; break;
} }
...@@ -1347,16 +1323,14 @@ lpfc_bus_reset_handler(struct scsi_cmnd *cmnd) ...@@ -1347,16 +1323,14 @@ lpfc_bus_reset_handler(struct scsi_cmnd *cmnd)
} }
if (cnt) { if (cnt) {
lpfc_printf_log(phba, KERN_ERR, LOG_FCP, lpfc_printf_vlog(vport, KERN_ERR, LOG_FCP,
"%d (%d):0715 Bus Reset I/O flush failure: " "0715 Bus Reset I/O flush failure: "
"cnt x%x left x%x\n", "cnt x%x left x%x\n", cnt, i);
phba->brd_no, vport->vpi, cnt, i);
ret = FAILED; ret = FAILED;
} }
lpfc_printf_log(phba, KERN_ERR, LOG_FCP, lpfc_printf_vlog(vport, KERN_ERR, LOG_FCP,
"%d (%d):0714 SCSI layer issued Bus Reset Data: x%x\n", "0714 SCSI layer issued Bus Reset Data: x%x\n", ret);
phba->brd_no, vport->vpi, ret);
out: out:
return ret; return ret;
} }
...@@ -1389,32 +1363,28 @@ lpfc_slave_alloc(struct scsi_device *sdev) ...@@ -1389,32 +1363,28 @@ lpfc_slave_alloc(struct scsi_device *sdev)
/* Allow some exchanges to be available always to complete discovery */ /* Allow some exchanges to be available always to complete discovery */
if (total >= phba->cfg_hba_queue_depth - LPFC_DISC_IOCB_BUFF_COUNT ) { if (total >= phba->cfg_hba_queue_depth - LPFC_DISC_IOCB_BUFF_COUNT ) {
lpfc_printf_log(phba, KERN_WARNING, LOG_FCP, lpfc_printf_vlog(vport, KERN_WARNING, LOG_FCP,
"%d (%d):0704 At limitation of %d " "0704 At limitation of %d preallocated "
"preallocated command buffers\n", "command buffers\n", total);
phba->brd_no, vport->vpi, total);
return 0; return 0;
/* Allow some exchanges to be available always to complete discovery */ /* Allow some exchanges to be available always to complete discovery */
} else if (total + num_to_alloc > } else if (total + num_to_alloc >
phba->cfg_hba_queue_depth - LPFC_DISC_IOCB_BUFF_COUNT ) { phba->cfg_hba_queue_depth - LPFC_DISC_IOCB_BUFF_COUNT ) {
lpfc_printf_log(phba, KERN_WARNING, LOG_FCP, lpfc_printf_vlog(vport, KERN_WARNING, LOG_FCP,
"%d (%d):0705 Allocation request of %d " "0705 Allocation request of %d "
"command buffers will exceed max of %d. " "command buffers will exceed max of %d. "
"Reducing allocation request to %d.\n", "Reducing allocation request to %d.\n",
phba->brd_no, vport->vpi, num_to_alloc, num_to_alloc, phba->cfg_hba_queue_depth,
phba->cfg_hba_queue_depth, (phba->cfg_hba_queue_depth - total));
(phba->cfg_hba_queue_depth - total));
num_to_alloc = phba->cfg_hba_queue_depth - total; num_to_alloc = phba->cfg_hba_queue_depth - total;
} }
for (i = 0; i < num_to_alloc; i++) { for (i = 0; i < num_to_alloc; i++) {
scsi_buf = lpfc_new_scsi_buf(vport); scsi_buf = lpfc_new_scsi_buf(vport);
if (!scsi_buf) { if (!scsi_buf) {
lpfc_printf_log(phba, KERN_ERR, LOG_FCP, lpfc_printf_vlog(vport, KERN_ERR, LOG_FCP,
"%d (%d):0706 Failed to allocate " "0706 Failed to allocate "
"command buffer\n", "command buffer\n");
phba->brd_no, vport->vpi);
break; break;
} }
......
...@@ -49,9 +49,8 @@ ...@@ -49,9 +49,8 @@
lpfc_printf_log(phba, \ lpfc_printf_log(phba, \
KERN_INFO, \ KERN_INFO, \
LOG_MBOX | LOG_SLI, \ LOG_MBOX | LOG_SLI, \
"%d (%d):0311 Mailbox command x%x cannot " \ "(%d):0311 Mailbox command x%x cannot " \
"issue Data: x%x x%x x%x\n", \ "issue Data: x%x x%x x%x\n", \
phba->brd_no, \
pmbox->vport ? pmbox->vport->vpi : 0, \ pmbox->vport ? pmbox->vport->vpi : 0, \
pmbox->mb.mbxCommand, \ pmbox->mb.mbxCommand, \
phba->pport->port_state, \ phba->pport->port_state, \
...@@ -231,13 +230,11 @@ lpfc_sli_ring_map(struct lpfc_hba *phba) ...@@ -231,13 +230,11 @@ lpfc_sli_ring_map(struct lpfc_hba *phba)
rc = lpfc_sli_issue_mbox(phba, pmb, MBX_POLL); rc = lpfc_sli_issue_mbox(phba, pmb, MBX_POLL);
if (rc != MBX_SUCCESS) { if (rc != MBX_SUCCESS) {
lpfc_printf_log(phba, KERN_ERR, LOG_INIT, lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
"%d:0446 Adapter failed to init (%d), " "0446 Adapter failed to init (%d), "
"mbxCmd x%x CFG_RING, mbxStatus x%x, " "mbxCmd x%x CFG_RING, mbxStatus x%x, "
"ring %d\n", "ring %d\n",
phba->brd_no, rc, rc, pmbox->mbxCommand,
pmbox->mbxCommand, pmbox->mbxStatus, i);
pmbox->mbxStatus,
i);
phba->link_state = LPFC_HBA_ERROR; phba->link_state = LPFC_HBA_ERROR;
ret = -ENXIO; ret = -ENXIO;
break; break;
...@@ -296,9 +293,9 @@ lpfc_sli_next_iocb_slot (struct lpfc_hba *phba, struct lpfc_sli_ring *pring) ...@@ -296,9 +293,9 @@ lpfc_sli_next_iocb_slot (struct lpfc_hba *phba, struct lpfc_sli_ring *pring)
if (unlikely(pring->local_getidx >= max_cmd_idx)) { if (unlikely(pring->local_getidx >= max_cmd_idx)) {
lpfc_printf_log(phba, KERN_ERR, LOG_SLI, lpfc_printf_log(phba, KERN_ERR, LOG_SLI,
"%d:0315 Ring %d issue: portCmdGet %d " "0315 Ring %d issue: portCmdGet %d "
"is bigger then cmd ring %d\n", "is bigger then cmd ring %d\n",
phba->brd_no, pring->ringno, pring->ringno,
pring->local_getidx, max_cmd_idx); pring->local_getidx, max_cmd_idx);
phba->link_state = LPFC_HBA_ERROR; phba->link_state = LPFC_HBA_ERROR;
...@@ -380,8 +377,8 @@ lpfc_sli_next_iotag(struct lpfc_hba *phba, struct lpfc_iocbq *iocbq) ...@@ -380,8 +377,8 @@ lpfc_sli_next_iotag(struct lpfc_hba *phba, struct lpfc_iocbq *iocbq)
spin_unlock_irq(&phba->hbalock); spin_unlock_irq(&phba->hbalock);
lpfc_printf_log(phba, KERN_ERR,LOG_SLI, lpfc_printf_log(phba, KERN_ERR,LOG_SLI,
"%d:0318 Failed to allocate IOTAG.last IOTAG is %d\n", "0318 Failed to allocate IOTAG.last IOTAG is %d\n",
phba->brd_no, psli->last_iotag); psli->last_iotag);
return 0; return 0;
} }
...@@ -535,10 +532,9 @@ lpfc_sli_next_hbq_slot(struct lpfc_hba *phba, uint32_t hbqno) ...@@ -535,10 +532,9 @@ lpfc_sli_next_hbq_slot(struct lpfc_hba *phba, uint32_t hbqno)
if (unlikely(hbqp->local_hbqGetIdx >= hbqp->entry_count)) { if (unlikely(hbqp->local_hbqGetIdx >= hbqp->entry_count)) {
lpfc_printf_log(phba, KERN_ERR, lpfc_printf_log(phba, KERN_ERR,
LOG_SLI | LOG_VPORT, LOG_SLI | LOG_VPORT,
"%d:1802 HBQ %d: local_hbqGetIdx " "1802 HBQ %d: local_hbqGetIdx "
"%u is > than hbqp->entry_count %u\n", "%u is > than hbqp->entry_count %u\n",
phba->brd_no, hbqno, hbqno, hbqp->local_hbqGetIdx,
hbqp->local_hbqGetIdx,
hbqp->entry_count); hbqp->entry_count);
phba->link_state = LPFC_HBA_ERROR; phba->link_state = LPFC_HBA_ERROR;
...@@ -666,9 +662,8 @@ lpfc_sli_hbqbuf_find(struct lpfc_hba *phba, uint32_t tag) ...@@ -666,9 +662,8 @@ lpfc_sli_hbqbuf_find(struct lpfc_hba *phba, uint32_t tag)
} }
} }
lpfc_printf_log(phba, KERN_ERR, LOG_SLI | LOG_VPORT, lpfc_printf_log(phba, KERN_ERR, LOG_SLI | LOG_VPORT,
"%d:1803 Bad hbq tag. Data: x%x x%x\n", "1803 Bad hbq tag. Data: x%x x%x\n",
phba->brd_no, tag, tag, lpfc_hbq_defs[tag >> 16]->buffer_count);
lpfc_hbq_defs[tag >> 16]->buffer_count);
return NULL; return NULL;
} }
...@@ -845,12 +840,10 @@ lpfc_sli_handle_mb_event(struct lpfc_hba *phba) ...@@ -845,12 +840,10 @@ lpfc_sli_handle_mb_event(struct lpfc_hba *phba)
*/ */
if (lpfc_sli_chk_mbx_command(pmbox->mbxCommand) == if (lpfc_sli_chk_mbx_command(pmbox->mbxCommand) ==
MBX_SHUTDOWN) { MBX_SHUTDOWN) {
/* Unknow mailbox command compl */ /* Unknow mailbox command compl */
lpfc_printf_log(phba, KERN_ERR, LOG_MBOX | LOG_SLI, lpfc_printf_log(phba, KERN_ERR, LOG_MBOX | LOG_SLI,
"%d (%d):0323 Unknown Mailbox command " "(%d):0323 Unknown Mailbox command "
"%x Cmpl\n", "%x Cmpl\n",
phba->brd_no,
pmb->vport ? pmb->vport->vpi : 0, pmb->vport ? pmb->vport->vpi : 0,
pmbox->mbxCommand); pmbox->mbxCommand);
phba->link_state = LPFC_HBA_ERROR; phba->link_state = LPFC_HBA_ERROR;
...@@ -865,10 +858,9 @@ lpfc_sli_handle_mb_event(struct lpfc_hba *phba) ...@@ -865,10 +858,9 @@ lpfc_sli_handle_mb_event(struct lpfc_hba *phba)
/* Mbox cmd cmpl error - RETRYing */ /* Mbox cmd cmpl error - RETRYing */
lpfc_printf_log(phba, KERN_INFO, lpfc_printf_log(phba, KERN_INFO,
LOG_MBOX | LOG_SLI, LOG_MBOX | LOG_SLI,
"%d (%d):0305 Mbox cmd cmpl " "(%d):0305 Mbox cmd cmpl "
"error - RETRYing Data: x%x " "error - RETRYing Data: x%x "
"x%x x%x x%x\n", "x%x x%x x%x\n",
phba->brd_no,
pmb->vport ? pmb->vport->vpi :0, pmb->vport ? pmb->vport->vpi :0,
pmbox->mbxCommand, pmbox->mbxCommand,
pmbox->mbxStatus, pmbox->mbxStatus,
...@@ -887,9 +879,8 @@ lpfc_sli_handle_mb_event(struct lpfc_hba *phba) ...@@ -887,9 +879,8 @@ lpfc_sli_handle_mb_event(struct lpfc_hba *phba)
/* Mailbox cmd <cmd> Cmpl <cmpl> */ /* Mailbox cmd <cmd> Cmpl <cmpl> */
lpfc_printf_log(phba, KERN_INFO, LOG_MBOX | LOG_SLI, lpfc_printf_log(phba, KERN_INFO, LOG_MBOX | LOG_SLI,
"%d (%d):0307 Mailbox cmd x%x Cmpl x%p " "(%d):0307 Mailbox cmd x%x Cmpl x%p "
"Data: x%x x%x x%x x%x x%x x%x x%x x%x x%x\n", "Data: x%x x%x x%x x%x x%x x%x x%x x%x x%x\n",
phba->brd_no,
pmb->vport ? pmb->vport->vpi : 0, pmb->vport ? pmb->vport->vpi : 0,
pmbox->mbxCommand, pmbox->mbxCommand,
pmb->mbox_cmpl, pmb->mbox_cmpl,
...@@ -1004,12 +995,9 @@ lpfc_sli_process_unsol_iocb(struct lpfc_hba *phba, struct lpfc_sli_ring *pring, ...@@ -1004,12 +995,9 @@ lpfc_sli_process_unsol_iocb(struct lpfc_hba *phba, struct lpfc_sli_ring *pring,
/* Ring <ringno> handler: unexpected /* Ring <ringno> handler: unexpected
Rctl <Rctl> Type <Type> received */ Rctl <Rctl> Type <Type> received */
lpfc_printf_log(phba, KERN_WARNING, LOG_SLI, lpfc_printf_log(phba, KERN_WARNING, LOG_SLI,
"%d:0313 Ring %d handler: unexpected Rctl x%x " "0313 Ring %d handler: unexpected Rctl x%x "
"Type x%x received\n", "Type x%x received\n",
phba->brd_no, pring->ringno, Rctl, Type);
pring->ringno,
Rctl,
Type);
} }
return 1; return 1;
} }
...@@ -1032,10 +1020,9 @@ lpfc_sli_iocbq_lookup(struct lpfc_hba *phba, ...@@ -1032,10 +1020,9 @@ lpfc_sli_iocbq_lookup(struct lpfc_hba *phba,
} }
lpfc_printf_log(phba, KERN_ERR, LOG_SLI, lpfc_printf_log(phba, KERN_ERR, LOG_SLI,
"%d:0317 iotag x%x is out off " "0317 iotag x%x is out off "
"range: max iotag x%x wd0 x%x\n", "range: max iotag x%x wd0 x%x\n",
phba->brd_no, iotag, iotag, phba->sli.last_iotag,
phba->sli.last_iotag,
*(((uint32_t *) &prspiocb->iocb) + 7)); *(((uint32_t *) &prspiocb->iocb) + 7));
return NULL; return NULL;
} }
...@@ -1083,18 +1070,16 @@ lpfc_sli_process_sol_iocb(struct lpfc_hba *phba, struct lpfc_sli_ring *pring, ...@@ -1083,18 +1070,16 @@ lpfc_sli_process_sol_iocb(struct lpfc_hba *phba, struct lpfc_sli_ring *pring,
* Ring <ringno> handler: unexpected completion IoTag * Ring <ringno> handler: unexpected completion IoTag
* <IoTag> * <IoTag>
*/ */
lpfc_printf_log(phba, KERN_WARNING, LOG_SLI, lpfc_printf_vlog(cmdiocbp->vport, KERN_WARNING, LOG_SLI,
"%d (%d):0322 Ring %d handler: " "0322 Ring %d handler: "
"unexpected completion IoTag x%x " "unexpected completion IoTag x%x "
"Data: x%x x%x x%x x%x\n", "Data: x%x x%x x%x x%x\n",
phba->brd_no, pring->ringno,
cmdiocbp->vport->vpi, saveq->iocb.ulpIoTag,
pring->ringno, saveq->iocb.ulpStatus,
saveq->iocb.ulpIoTag, saveq->iocb.un.ulpWord[4],
saveq->iocb.ulpStatus, saveq->iocb.ulpCommand,
saveq->iocb.un.ulpWord[4], saveq->iocb.ulpContext);
saveq->iocb.ulpCommand,
saveq->iocb.ulpContext);
} }
} }
...@@ -1112,10 +1097,9 @@ lpfc_sli_rsp_pointers_error(struct lpfc_hba *phba, struct lpfc_sli_ring *pring) ...@@ -1112,10 +1097,9 @@ lpfc_sli_rsp_pointers_error(struct lpfc_hba *phba, struct lpfc_sli_ring *pring)
* rsp ring <portRspMax> * rsp ring <portRspMax>
*/ */
lpfc_printf_log(phba, KERN_ERR, LOG_SLI, lpfc_printf_log(phba, KERN_ERR, LOG_SLI,
"%d:0312 Ring %d handler: portRspPut %d " "0312 Ring %d handler: portRspPut %d "
"is bigger then rsp ring %d\n", "is bigger then rsp ring %d\n",
phba->brd_no, pring->ringno, pring->ringno, le32_to_cpu(pgp->rspPutInx),
le32_to_cpu(pgp->rspPutInx),
pring->numRiocb); pring->numRiocb);
phba->link_state = LPFC_HBA_ERROR; phba->link_state = LPFC_HBA_ERROR;
...@@ -1185,9 +1169,9 @@ void lpfc_sli_poll_fcp_ring(struct lpfc_hba *phba) ...@@ -1185,9 +1169,9 @@ void lpfc_sli_poll_fcp_ring(struct lpfc_hba *phba)
if (unlikely(irsp->ulpStatus)) { if (unlikely(irsp->ulpStatus)) {
/* Rsp ring <ringno> error: IOCB */ /* Rsp ring <ringno> error: IOCB */
lpfc_printf_log(phba, KERN_WARNING, LOG_SLI, lpfc_printf_log(phba, KERN_WARNING, LOG_SLI,
"%d:0326 Rsp Ring %d error: IOCB Data: " "0326 Rsp Ring %d error: IOCB Data: "
"x%x x%x x%x x%x x%x x%x x%x x%x\n", "x%x x%x x%x x%x x%x x%x x%x x%x\n",
phba->brd_no, pring->ringno, pring->ringno,
irsp->un.ulpWord[0], irsp->un.ulpWord[0],
irsp->un.ulpWord[1], irsp->un.ulpWord[1],
irsp->un.ulpWord[2], irsp->un.ulpWord[2],
...@@ -1207,9 +1191,9 @@ void lpfc_sli_poll_fcp_ring(struct lpfc_hba *phba) ...@@ -1207,9 +1191,9 @@ void lpfc_sli_poll_fcp_ring(struct lpfc_hba *phba)
*/ */
if (unlikely(irsp->ulpCommand == CMD_XRI_ABORTED_CX)) { if (unlikely(irsp->ulpCommand == CMD_XRI_ABORTED_CX)) {
lpfc_printf_log(phba, KERN_INFO, LOG_SLI, lpfc_printf_log(phba, KERN_INFO, LOG_SLI,
"%d:0314 IOCB cmd 0x%x" "0314 IOCB cmd 0x%x "
" processed. Skipping" "processed. Skipping "
" completion", phba->brd_no, "completion",
irsp->ulpCommand); irsp->ulpCommand);
break; break;
} }
...@@ -1234,10 +1218,9 @@ void lpfc_sli_poll_fcp_ring(struct lpfc_hba *phba) ...@@ -1234,10 +1218,9 @@ void lpfc_sli_poll_fcp_ring(struct lpfc_hba *phba)
} else { } else {
/* Unknown IOCB command */ /* Unknown IOCB command */
lpfc_printf_log(phba, KERN_ERR, LOG_SLI, lpfc_printf_log(phba, KERN_ERR, LOG_SLI,
"%d:0321 Unknown IOCB command " "0321 Unknown IOCB command "
"Data: x%x, x%x x%x x%x x%x\n", "Data: x%x, x%x x%x x%x x%x\n",
phba->brd_no, type, type, irsp->ulpCommand,
irsp->ulpCommand,
irsp->ulpStatus, irsp->ulpStatus,
irsp->ulpIoTag, irsp->ulpIoTag,
irsp->ulpContext); irsp->ulpContext);
...@@ -1361,9 +1344,9 @@ lpfc_sli_handle_fast_ring_event(struct lpfc_hba *phba, ...@@ -1361,9 +1344,9 @@ lpfc_sli_handle_fast_ring_event(struct lpfc_hba *phba,
/* Rsp ring <ringno> error: IOCB */ /* Rsp ring <ringno> error: IOCB */
lpfc_printf_log(phba, KERN_WARNING, LOG_SLI, lpfc_printf_log(phba, KERN_WARNING, LOG_SLI,
"%d:0336 Rsp Ring %d error: IOCB Data: " "0336 Rsp Ring %d error: IOCB Data: "
"x%x x%x x%x x%x x%x x%x x%x x%x\n", "x%x x%x x%x x%x x%x x%x x%x x%x\n",
phba->brd_no, pring->ringno, pring->ringno,
irsp->un.ulpWord[0], irsp->un.ulpWord[0],
irsp->un.ulpWord[1], irsp->un.ulpWord[1],
irsp->un.ulpWord[2], irsp->un.ulpWord[2],
...@@ -1383,10 +1366,9 @@ lpfc_sli_handle_fast_ring_event(struct lpfc_hba *phba, ...@@ -1383,10 +1366,9 @@ lpfc_sli_handle_fast_ring_event(struct lpfc_hba *phba,
*/ */
if (unlikely(irsp->ulpCommand == CMD_XRI_ABORTED_CX)) { if (unlikely(irsp->ulpCommand == CMD_XRI_ABORTED_CX)) {
lpfc_printf_log(phba, KERN_INFO, LOG_SLI, lpfc_printf_log(phba, KERN_INFO, LOG_SLI,
"%d:0333 IOCB cmd 0x%x" "0333 IOCB cmd 0x%x"
" processed. Skipping" " processed. Skipping"
" completion\n", " completion\n",
phba->brd_no,
irsp->ulpCommand); irsp->ulpCommand);
break; break;
} }
...@@ -1423,10 +1405,9 @@ lpfc_sli_handle_fast_ring_event(struct lpfc_hba *phba, ...@@ -1423,10 +1405,9 @@ lpfc_sli_handle_fast_ring_event(struct lpfc_hba *phba,
} else { } else {
/* Unknown IOCB command */ /* Unknown IOCB command */
lpfc_printf_log(phba, KERN_ERR, LOG_SLI, lpfc_printf_log(phba, KERN_ERR, LOG_SLI,
"%d:0334 Unknown IOCB command " "0334 Unknown IOCB command "
"Data: x%x, x%x x%x x%x x%x\n", "Data: x%x, x%x x%x x%x x%x\n",
phba->brd_no, type, type, irsp->ulpCommand,
irsp->ulpCommand,
irsp->ulpStatus, irsp->ulpStatus,
irsp->ulpIoTag, irsp->ulpIoTag,
irsp->ulpContext); irsp->ulpContext);
...@@ -1504,10 +1485,9 @@ lpfc_sli_handle_slow_ring_event(struct lpfc_hba *phba, ...@@ -1504,10 +1485,9 @@ lpfc_sli_handle_slow_ring_event(struct lpfc_hba *phba,
* rsp ring <portRspMax> * rsp ring <portRspMax>
*/ */
lpfc_printf_log(phba, KERN_ERR, LOG_SLI, lpfc_printf_log(phba, KERN_ERR, LOG_SLI,
"%d:0303 Ring %d handler: portRspPut %d " "0303 Ring %d handler: portRspPut %d "
"is bigger then rsp ring %d\n", "is bigger then rsp ring %d\n",
phba->brd_no, pring->ringno, portRspPut, pring->ringno, portRspPut, portRspMax);
portRspMax);
phba->link_state = LPFC_HBA_ERROR; phba->link_state = LPFC_HBA_ERROR;
spin_unlock_irqrestore(&phba->hbalock, iflag); spin_unlock_irqrestore(&phba->hbalock, iflag);
...@@ -1596,13 +1576,12 @@ lpfc_sli_handle_slow_ring_event(struct lpfc_hba *phba, ...@@ -1596,13 +1576,12 @@ lpfc_sli_handle_slow_ring_event(struct lpfc_hba *phba,
if (irsp->ulpStatus) { if (irsp->ulpStatus) {
/* Rsp ring <ringno> error: IOCB */ /* Rsp ring <ringno> error: IOCB */
lpfc_printf_log(phba, KERN_WARNING, LOG_SLI, lpfc_printf_log(phba, KERN_WARNING, LOG_SLI,
"%d:0328 Rsp Ring %d error: " "0328 Rsp Ring %d error: "
"IOCB Data: " "IOCB Data: "
"x%x x%x x%x x%x " "x%x x%x x%x x%x "
"x%x x%x x%x x%x " "x%x x%x x%x x%x "
"x%x x%x x%x x%x " "x%x x%x x%x x%x "
"x%x x%x x%x x%x\n", "x%x x%x x%x x%x\n",
phba->brd_no,
pring->ringno, pring->ringno,
irsp->un.ulpWord[0], irsp->un.ulpWord[0],
irsp->un.ulpWord[1], irsp->un.ulpWord[1],
...@@ -1677,10 +1656,9 @@ lpfc_sli_handle_slow_ring_event(struct lpfc_hba *phba, ...@@ -1677,10 +1656,9 @@ lpfc_sli_handle_slow_ring_event(struct lpfc_hba *phba,
} else { } else {
/* Unknown IOCB command */ /* Unknown IOCB command */
lpfc_printf_log(phba, KERN_ERR, LOG_SLI, lpfc_printf_log(phba, KERN_ERR, LOG_SLI,
"%d:0335 Unknown IOCB " "0335 Unknown IOCB "
"command Data: x%x " "command Data: x%x "
"x%x x%x x%x\n", "x%x x%x x%x\n",
phba->brd_no,
irsp->ulpCommand, irsp->ulpCommand,
irsp->ulpStatus, irsp->ulpStatus,
irsp->ulpIoTag, irsp->ulpIoTag,
...@@ -1908,8 +1886,8 @@ lpfc_sli_brdkill(struct lpfc_hba *phba) ...@@ -1908,8 +1886,8 @@ lpfc_sli_brdkill(struct lpfc_hba *phba)
/* Kill HBA */ /* Kill HBA */
lpfc_printf_log(phba, KERN_INFO, LOG_SLI, lpfc_printf_log(phba, KERN_INFO, LOG_SLI,
"%d:0329 Kill HBA Data: x%x x%x\n", "0329 Kill HBA Data: x%x x%x\n",
phba->brd_no, phba->pport->port_state, psli->sli_flag); phba->pport->port_state, psli->sli_flag);
if ((pmb = (LPFC_MBOXQ_t *) mempool_alloc(phba->mbox_mem_pool, if ((pmb = (LPFC_MBOXQ_t *) mempool_alloc(phba->mbox_mem_pool,
GFP_KERNEL)) == 0) GFP_KERNEL)) == 0)
...@@ -1982,7 +1960,7 @@ lpfc_sli_brdreset(struct lpfc_hba *phba) ...@@ -1982,7 +1960,7 @@ lpfc_sli_brdreset(struct lpfc_hba *phba)
/* Reset HBA */ /* Reset HBA */
lpfc_printf_log(phba, KERN_INFO, LOG_SLI, lpfc_printf_log(phba, KERN_INFO, LOG_SLI,
"%d:0325 Reset HBA Data: x%x x%x\n", phba->brd_no, "0325 Reset HBA Data: x%x x%x\n",
phba->pport->port_state, psli->sli_flag); phba->pport->port_state, psli->sli_flag);
/* perform board reset */ /* perform board reset */
...@@ -2037,7 +2015,7 @@ lpfc_sli_brdrestart(struct lpfc_hba *phba) ...@@ -2037,7 +2015,7 @@ lpfc_sli_brdrestart(struct lpfc_hba *phba)
/* Restart HBA */ /* Restart HBA */
lpfc_printf_log(phba, KERN_INFO, LOG_SLI, lpfc_printf_log(phba, KERN_INFO, LOG_SLI,
"%d:0337 Restart HBA Data: x%x x%x\n", phba->brd_no, "0337 Restart HBA Data: x%x x%x\n",
phba->pport->port_state, psli->sli_flag); phba->pport->port_state, psli->sli_flag);
word0 = 0; word0 = 0;
...@@ -2102,9 +2080,8 @@ lpfc_sli_chipset_init(struct lpfc_hba *phba) ...@@ -2102,9 +2080,8 @@ lpfc_sli_chipset_init(struct lpfc_hba *phba)
/* Adapter failed to init, timeout, status reg /* Adapter failed to init, timeout, status reg
<status> */ <status> */
lpfc_printf_log(phba, KERN_ERR, LOG_INIT, lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
"%d:0436 Adapter failed to init, " "0436 Adapter failed to init, "
"timeout, status reg x%x\n", "timeout, status reg x%x\n", status);
phba->brd_no, status);
phba->link_state = LPFC_HBA_ERROR; phba->link_state = LPFC_HBA_ERROR;
return -ETIMEDOUT; return -ETIMEDOUT;
} }
...@@ -2115,10 +2092,8 @@ lpfc_sli_chipset_init(struct lpfc_hba *phba) ...@@ -2115,10 +2092,8 @@ lpfc_sli_chipset_init(struct lpfc_hba *phba)
/* Adapter failed to init, chipset, status reg /* Adapter failed to init, chipset, status reg
<status> */ <status> */
lpfc_printf_log(phba, KERN_ERR, LOG_INIT, lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
"%d:0437 Adapter failed to init, " "0437 Adapter failed to init, "
"chipset, status reg x%x\n", "chipset, status reg x%x\n", status);
phba->brd_no,
status);
phba->link_state = LPFC_HBA_ERROR; phba->link_state = LPFC_HBA_ERROR;
return -EIO; return -EIO;
} }
...@@ -2145,10 +2120,8 @@ lpfc_sli_chipset_init(struct lpfc_hba *phba) ...@@ -2145,10 +2120,8 @@ lpfc_sli_chipset_init(struct lpfc_hba *phba)
/* ERROR: During chipset initialization */ /* ERROR: During chipset initialization */
/* Adapter failed to init, chipset, status reg <status> */ /* Adapter failed to init, chipset, status reg <status> */
lpfc_printf_log(phba, KERN_ERR, LOG_INIT, lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
"%d:0438 Adapter failed to init, chipset, " "0438 Adapter failed to init, chipset, "
"status reg x%x\n", "status reg x%x\n", status);
phba->brd_no,
status);
phba->link_state = LPFC_HBA_ERROR; phba->link_state = LPFC_HBA_ERROR;
return -EIO; return -EIO;
} }
...@@ -2226,9 +2199,9 @@ lpfc_sli_hbq_setup(struct lpfc_hba *phba) ...@@ -2226,9 +2199,9 @@ lpfc_sli_hbq_setup(struct lpfc_hba *phba)
lpfc_printf_log(phba, KERN_ERR, lpfc_printf_log(phba, KERN_ERR,
LOG_SLI | LOG_VPORT, LOG_SLI | LOG_VPORT,
"%d:1805 Adapter failed to init. " "1805 Adapter failed to init. "
"Data: x%x x%x x%x\n", "Data: x%x x%x x%x\n",
phba->brd_no, pmbox->mbxCommand, pmbox->mbxCommand,
pmbox->mbxStatus, hbqno); pmbox->mbxStatus, hbqno);
phba->link_state = LPFC_HBA_ERROR; phba->link_state = LPFC_HBA_ERROR;
...@@ -2295,10 +2268,9 @@ lpfc_do_config_port(struct lpfc_hba *phba, int sli_mode) ...@@ -2295,10 +2268,9 @@ lpfc_do_config_port(struct lpfc_hba *phba, int sli_mode)
rc = lpfc_sli_issue_mbox(phba, pmb, MBX_POLL); rc = lpfc_sli_issue_mbox(phba, pmb, MBX_POLL);
if (rc != MBX_SUCCESS) { if (rc != MBX_SUCCESS) {
lpfc_printf_log(phba, KERN_ERR, LOG_INIT, lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
"%d:0442 Adapter failed to init, mbxCmd x%x " "0442 Adapter failed to init, mbxCmd x%x "
"CONFIG_PORT, mbxStatus x%x Data: x%x\n", "CONFIG_PORT, mbxStatus x%x Data: x%x\n",
phba->brd_no, pmb->mb.mbxCommand, pmb->mb.mbxCommand, pmb->mb.mbxStatus, 0);
pmb->mb.mbxStatus, 0);
spin_lock_irq(&phba->hbalock); spin_lock_irq(&phba->hbalock);
phba->sli.sli_flag &= ~LPFC_SLI2_ACTIVE; phba->sli.sli_flag &= ~LPFC_SLI2_ACTIVE;
spin_unlock_irq(&phba->hbalock); spin_unlock_irq(&phba->hbalock);
...@@ -2339,9 +2311,9 @@ lpfc_sli_hba_setup(struct lpfc_hba *phba) ...@@ -2339,9 +2311,9 @@ lpfc_sli_hba_setup(struct lpfc_hba *phba)
case 2: case 2:
if (phba->cfg_npiv_enable) { if (phba->cfg_npiv_enable) {
lpfc_printf_log(phba, KERN_ERR, LOG_INIT | LOG_VPORT, lpfc_printf_log(phba, KERN_ERR, LOG_INIT | LOG_VPORT,
"%d:1824 NPIV enabled: Override lpfc_sli_mode " "1824 NPIV enabled: Override lpfc_sli_mode "
"parameter (%d) to auto (0).\n", "parameter (%d) to auto (0).\n",
phba->brd_no, lpfc_sli_mode); lpfc_sli_mode);
break; break;
} }
mode = 2; mode = 2;
...@@ -2351,9 +2323,8 @@ lpfc_sli_hba_setup(struct lpfc_hba *phba) ...@@ -2351,9 +2323,8 @@ lpfc_sli_hba_setup(struct lpfc_hba *phba)
break; break;
default: default:
lpfc_printf_log(phba, KERN_ERR, LOG_INIT | LOG_VPORT, lpfc_printf_log(phba, KERN_ERR, LOG_INIT | LOG_VPORT,
"%d:1819 Unrecognized lpfc_sli_mode " "1819 Unrecognized lpfc_sli_mode "
"parameter: %d.\n", "parameter: %d.\n", lpfc_sli_mode);
phba->brd_no, lpfc_sli_mode);
break; break;
} }
...@@ -2361,9 +2332,8 @@ lpfc_sli_hba_setup(struct lpfc_hba *phba) ...@@ -2361,9 +2332,8 @@ lpfc_sli_hba_setup(struct lpfc_hba *phba)
rc = lpfc_do_config_port(phba, mode); rc = lpfc_do_config_port(phba, mode);
if (rc && lpfc_sli_mode == 3) if (rc && lpfc_sli_mode == 3)
lpfc_printf_log(phba, KERN_ERR, LOG_INIT | LOG_VPORT, lpfc_printf_log(phba, KERN_ERR, LOG_INIT | LOG_VPORT,
"%d:1820 Unable to select SLI-3. " "1820 Unable to select SLI-3. "
"Not supported by adapter.\n", "Not supported by adapter.\n");
phba->brd_no);
if (rc && mode != 2) if (rc && mode != 2)
rc = lpfc_do_config_port(phba, 2); rc = lpfc_do_config_port(phba, 2);
if (rc) if (rc)
...@@ -2382,8 +2352,8 @@ lpfc_sli_hba_setup(struct lpfc_hba *phba) ...@@ -2382,8 +2352,8 @@ lpfc_sli_hba_setup(struct lpfc_hba *phba)
} }
lpfc_printf_log(phba, KERN_INFO, LOG_INIT, lpfc_printf_log(phba, KERN_INFO, LOG_INIT,
"%d:0444 Firmware in SLI %x mode. Max_vpi %d\n", "0444 Firmware in SLI %x mode. Max_vpi %d\n",
phba->brd_no, phba->sli_rev, phba->max_vpi); phba->sli_rev, phba->max_vpi);
rc = lpfc_sli_ring_map(phba); rc = lpfc_sli_ring_map(phba);
if (rc) if (rc)
...@@ -2408,8 +2378,7 @@ lpfc_sli_hba_setup(struct lpfc_hba *phba) ...@@ -2408,8 +2378,7 @@ lpfc_sli_hba_setup(struct lpfc_hba *phba)
lpfc_sli_hba_setup_error: lpfc_sli_hba_setup_error:
phba->link_state = LPFC_HBA_ERROR; phba->link_state = LPFC_HBA_ERROR;
lpfc_printf_log(phba, KERN_INFO, LOG_INIT, lpfc_printf_log(phba, KERN_INFO, LOG_INIT,
"%d:0445 Firmware initialization failed\n", "0445 Firmware initialization failed\n");
phba->brd_no);
return rc; return rc;
} }
...@@ -2461,9 +2430,7 @@ lpfc_mbox_timeout_handler(struct lpfc_hba *phba) ...@@ -2461,9 +2430,7 @@ lpfc_mbox_timeout_handler(struct lpfc_hba *phba)
/* Mbox cmd <mbxCommand> timeout */ /* Mbox cmd <mbxCommand> timeout */
lpfc_printf_log(phba, KERN_ERR, LOG_MBOX | LOG_SLI, lpfc_printf_log(phba, KERN_ERR, LOG_MBOX | LOG_SLI,
"%d:0310 Mailbox command x%x timeout Data: x%x x%x " "0310 Mailbox command x%x timeout Data: x%x x%x x%p\n",
"x%p\n",
phba->brd_no,
mb->mbxCommand, mb->mbxCommand,
phba->pport->port_state, phba->pport->port_state,
phba->sli.sli_flag, phba->sli.sli_flag,
...@@ -2486,8 +2453,7 @@ lpfc_mbox_timeout_handler(struct lpfc_hba *phba) ...@@ -2486,8 +2453,7 @@ lpfc_mbox_timeout_handler(struct lpfc_hba *phba)
lpfc_sli_abort_iocb_ring(phba, pring); lpfc_sli_abort_iocb_ring(phba, pring);
lpfc_printf_log(phba, KERN_ERR, LOG_MBOX | LOG_SLI, lpfc_printf_log(phba, KERN_ERR, LOG_MBOX | LOG_SLI,
"%d:0316 Resetting board due to mailbox timeout\n", "0316 Resetting board due to mailbox timeout\n");
phba->brd_no);
/* /*
* lpfc_offline calls lpfc_sli_hba_down which will clean up * lpfc_offline calls lpfc_sli_hba_down which will clean up
* on oustanding mailbox commands. * on oustanding mailbox commands.
...@@ -2518,8 +2484,7 @@ lpfc_sli_issue_mbox(struct lpfc_hba *phba, LPFC_MBOXQ_t *pmbox, uint32_t flag) ...@@ -2518,8 +2484,7 @@ lpfc_sli_issue_mbox(struct lpfc_hba *phba, LPFC_MBOXQ_t *pmbox, uint32_t flag)
if(!pmbox->vport) { if(!pmbox->vport) {
lpfc_printf_log(phba, KERN_ERR, lpfc_printf_log(phba, KERN_ERR,
LOG_MBOX | LOG_VPORT, LOG_MBOX | LOG_VPORT,
"%d:1806 Mbox x%x failed. No vport\n", "1806 Mbox x%x failed. No vport\n",
phba->brd_no,
pmbox->mb.mbxCommand); pmbox->mb.mbxCommand);
dump_stack(); dump_stack();
return MBXERR_ERROR; return MBXERR_ERROR;
...@@ -2596,9 +2561,8 @@ lpfc_sli_issue_mbox(struct lpfc_hba *phba, LPFC_MBOXQ_t *pmbox, uint32_t flag) ...@@ -2596,9 +2561,8 @@ lpfc_sli_issue_mbox(struct lpfc_hba *phba, LPFC_MBOXQ_t *pmbox, uint32_t flag)
/* Mbox cmd issue - BUSY */ /* Mbox cmd issue - BUSY */
lpfc_printf_log(phba, KERN_INFO, LOG_MBOX | LOG_SLI, lpfc_printf_log(phba, KERN_INFO, LOG_MBOX | LOG_SLI,
"%d (%d):0308 Mbox cmd issue - BUSY Data: " "(%d):0308 Mbox cmd issue - BUSY Data: "
"x%x x%x x%x x%x\n", "x%x x%x x%x x%x\n",
phba->brd_no,
pmbox->vport ? pmbox->vport->vpi : 0xffffff, pmbox->vport ? pmbox->vport->vpi : 0xffffff,
mb->mbxCommand, phba->pport->port_state, mb->mbxCommand, phba->pport->port_state,
psli->sli_flag, flag); psli->sli_flag, flag);
...@@ -2660,9 +2624,9 @@ lpfc_sli_issue_mbox(struct lpfc_hba *phba, LPFC_MBOXQ_t *pmbox, uint32_t flag) ...@@ -2660,9 +2624,9 @@ lpfc_sli_issue_mbox(struct lpfc_hba *phba, LPFC_MBOXQ_t *pmbox, uint32_t flag)
/* Mailbox cmd <cmd> issue */ /* Mailbox cmd <cmd> issue */
lpfc_printf_log(phba, KERN_INFO, LOG_MBOX | LOG_SLI, lpfc_printf_log(phba, KERN_INFO, LOG_MBOX | LOG_SLI,
"%d (%d):0309 Mailbox cmd x%x issue Data: x%x x%x " "(%d):0309 Mailbox cmd x%x issue Data: x%x x%x "
"x%x\n", "x%x\n",
phba->brd_no, pmbox->vport ? pmbox->vport->vpi : 0, pmbox->vport ? pmbox->vport->vpi : 0,
mb->mbxCommand, phba->pport->port_state, mb->mbxCommand, phba->pport->port_state,
psli->sli_flag, flag); psli->sli_flag, flag);
...@@ -2864,8 +2828,7 @@ __lpfc_sli_issue_iocb(struct lpfc_hba *phba, struct lpfc_sli_ring *pring, ...@@ -2864,8 +2828,7 @@ __lpfc_sli_issue_iocb(struct lpfc_hba *phba, struct lpfc_sli_ring *pring,
(piocb->iocb.ulpCommand != CMD_CLOSE_XRI_CN)) { (piocb->iocb.ulpCommand != CMD_CLOSE_XRI_CN)) {
lpfc_printf_log(phba, KERN_ERR, lpfc_printf_log(phba, KERN_ERR,
LOG_SLI | LOG_VPORT, LOG_SLI | LOG_VPORT,
"%d:1807 IOCB x%x failed. No vport\n", "1807 IOCB x%x failed. No vport\n",
phba->brd_no,
piocb->iocb.ulpCommand); piocb->iocb.ulpCommand);
dump_stack(); dump_stack();
return IOCB_ERROR; return IOCB_ERROR;
...@@ -3096,11 +3059,10 @@ lpfc_sli_setup(struct lpfc_hba *phba) ...@@ -3096,11 +3059,10 @@ lpfc_sli_setup(struct lpfc_hba *phba)
} }
if (totiocbsize > MAX_SLIM_IOCB_SIZE) { if (totiocbsize > MAX_SLIM_IOCB_SIZE) {
/* Too many cmd / rsp ring entries in SLI2 SLIM */ /* Too many cmd / rsp ring entries in SLI2 SLIM */
lpfc_printf_log(phba, KERN_ERR, LOG_INIT, printk(KERN_ERR "%d:0462 Too many cmd / rsp ring entries in "
"%d:0462 Too many cmd / rsp ring entries in " "SLI2 SLIM Data: x%x x%lx\n",
"SLI2 SLIM Data: x%x x%lx\n", phba->brd_no, totiocbsize,
phba->brd_no, totiocbsize, (unsigned long) MAX_SLIM_IOCB_SIZE);
(unsigned long) MAX_SLIM_IOCB_SIZE);
} }
if (phba->cfg_multi_ring_support == 2) if (phba->cfg_multi_ring_support == 2)
lpfc_extra_ring_setup(phba); lpfc_extra_ring_setup(phba);
...@@ -3321,9 +3283,9 @@ lpfc_sli_ringpostbuf_get(struct lpfc_hba *phba, struct lpfc_sli_ring *pring, ...@@ -3321,9 +3283,9 @@ lpfc_sli_ringpostbuf_get(struct lpfc_hba *phba, struct lpfc_sli_ring *pring,
spin_unlock_irq(&phba->hbalock); spin_unlock_irq(&phba->hbalock);
lpfc_printf_log(phba, KERN_ERR, LOG_INIT, lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
"%d:0410 Cannot find virtual addr for mapped buf on " "0410 Cannot find virtual addr for mapped buf on "
"ring %d Data x%llx x%p x%p x%x\n", "ring %d Data x%llx x%p x%p x%x\n",
phba->brd_no, pring->ringno, (unsigned long long)phys, pring->ringno, (unsigned long long)phys,
slp->next, slp->prev, pring->postbufq_cnt); slp->next, slp->prev, pring->postbufq_cnt);
return NULL; return NULL;
} }
...@@ -3348,12 +3310,11 @@ lpfc_sli_abort_els_cmpl(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb, ...@@ -3348,12 +3310,11 @@ lpfc_sli_abort_els_cmpl(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb,
abort_iocb = phba->sli.iocbq_lookup[abort_iotag]; abort_iocb = phba->sli.iocbq_lookup[abort_iotag];
lpfc_printf_log(phba, KERN_INFO, LOG_ELS | LOG_SLI, lpfc_printf_log(phba, KERN_INFO, LOG_ELS | LOG_SLI,
"%d:0327 Cannot abort els iocb %p " "0327 Cannot abort els iocb %p "
"with tag %x context %x, abort status %x, " "with tag %x context %x, abort status %x, "
"abort code %x\n", "abort code %x\n",
phba->brd_no, abort_iocb, abort_iotag, abort_iocb, abort_iotag, abort_context,
abort_context, irsp->ulpStatus, irsp->ulpStatus, irsp->un.ulpWord[4]);
irsp->un.ulpWord[4]);
/* /*
* make sure we have the right iocbq before taking it * make sure we have the right iocbq before taking it
...@@ -3387,9 +3348,9 @@ lpfc_ignore_els_cmpl(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb, ...@@ -3387,9 +3348,9 @@ lpfc_ignore_els_cmpl(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb,
/* ELS cmd tag <ulpIoTag> completes */ /* ELS cmd tag <ulpIoTag> completes */
lpfc_printf_log(phba, KERN_INFO, LOG_ELS, lpfc_printf_log(phba, KERN_INFO, LOG_ELS,
"%d (X):0133 Ignoring ELS cmd tag x%x completion Data: " "0133 Ignoring ELS cmd tag x%x completion Data: "
"x%x x%x x%x\n", "x%x x%x x%x\n",
phba->brd_no, irsp->ulpIoTag, irsp->ulpStatus, irsp->ulpIoTag, irsp->ulpStatus,
irsp->un.ulpWord[4], irsp->ulpTimeout); irsp->un.ulpWord[4], irsp->ulpTimeout);
if (cmdiocb->iocb.ulpCommand == CMD_GEN_REQUEST64_CR) if (cmdiocb->iocb.ulpCommand == CMD_GEN_REQUEST64_CR)
lpfc_ct_free_iocb(phba, cmdiocb); lpfc_ct_free_iocb(phba, cmdiocb);
...@@ -3455,12 +3416,11 @@ lpfc_sli_issue_abort_iotag(struct lpfc_hba *phba, struct lpfc_sli_ring *pring, ...@@ -3455,12 +3416,11 @@ lpfc_sli_issue_abort_iotag(struct lpfc_hba *phba, struct lpfc_sli_ring *pring,
abtsiocbp->iocb_cmpl = lpfc_sli_abort_els_cmpl; abtsiocbp->iocb_cmpl = lpfc_sli_abort_els_cmpl;
lpfc_printf_log(phba, KERN_INFO, LOG_SLI, lpfc_printf_vlog(vport, KERN_INFO, LOG_SLI,
"%d (%d):0339 Abort xri x%x, original iotag x%x, " "0339 Abort xri x%x, original iotag x%x, "
"abort cmd iotag x%x\n", "abort cmd iotag x%x\n",
phba->brd_no, vport->vpi, iabt->un.acxri.abortContextTag,
iabt->un.acxri.abortContextTag, iabt->un.acxri.abortIoTag, abtsiocbp->iotag);
iabt->un.acxri.abortIoTag, abtsiocbp->iotag);
retval = __lpfc_sli_issue_iocb(phba, pring, abtsiocbp, 0); retval = __lpfc_sli_issue_iocb(phba, pring, abtsiocbp, 0);
abort_iotag_exit: abort_iotag_exit:
...@@ -3663,25 +3623,23 @@ lpfc_sli_issue_iocb_wait(struct lpfc_hba *phba, ...@@ -3663,25 +3623,23 @@ lpfc_sli_issue_iocb_wait(struct lpfc_hba *phba,
if (piocb->iocb_flag & LPFC_IO_WAKE) { if (piocb->iocb_flag & LPFC_IO_WAKE) {
lpfc_printf_log(phba, KERN_INFO, LOG_SLI, lpfc_printf_log(phba, KERN_INFO, LOG_SLI,
"%d:0331 IOCB wake signaled\n", "0331 IOCB wake signaled\n");
phba->brd_no);
} else if (timeleft == 0) { } else if (timeleft == 0) {
lpfc_printf_log(phba, KERN_ERR, LOG_SLI, lpfc_printf_log(phba, KERN_ERR, LOG_SLI,
"%d:0338 IOCB wait timeout error - no " "0338 IOCB wait timeout error - no "
"wake response Data x%x\n", "wake response Data x%x\n", timeout);
phba->brd_no, timeout);
retval = IOCB_TIMEDOUT; retval = IOCB_TIMEDOUT;
} else { } else {
lpfc_printf_log(phba, KERN_ERR, LOG_SLI, lpfc_printf_log(phba, KERN_ERR, LOG_SLI,
"%d:0330 IOCB wake NOT set, " "0330 IOCB wake NOT set, "
"Data x%x x%lx\n", phba->brd_no, "Data x%x x%lx\n",
timeout, (timeleft / jiffies)); timeout, (timeleft / jiffies));
retval = IOCB_TIMEDOUT; retval = IOCB_TIMEDOUT;
} }
} else { } else {
lpfc_printf_log(phba, KERN_INFO, LOG_SLI, lpfc_printf_log(phba, KERN_INFO, LOG_SLI,
"%d:0332 IOCB wait issue failed, Data x%x\n", ":0332 IOCB wait issue failed, Data x%x\n",
phba->brd_no, retval); retval);
retval = IOCB_ERROR; retval = IOCB_ERROR;
} }
...@@ -3932,12 +3890,10 @@ lpfc_intr_handler(int irq, void *dev_id) ...@@ -3932,12 +3890,10 @@ lpfc_intr_handler(int irq, void *dev_id)
*/ */
lpfc_printf_log(phba, KERN_WARNING, LOG_MBOX | lpfc_printf_log(phba, KERN_WARNING, LOG_MBOX |
LOG_SLI, LOG_SLI,
"%d (%d):0304 Stray Mailbox " "(%d):0304 Stray Mailbox "
"Interrupt mbxCommand x%x " "Interrupt mbxCommand x%x "
"mbxStatus x%x\n", "mbxStatus x%x\n",
phba->brd_no, (vport ? vport->vpi : 0),
(vport
? vport->vpi : 0),
pmbox->mbxCommand, pmbox->mbxCommand,
pmbox->mbxStatus); pmbox->mbxStatus);
} }
......
...@@ -125,11 +125,10 @@ lpfc_vport_sparm(struct lpfc_hba *phba, struct lpfc_vport *vport) ...@@ -125,11 +125,10 @@ lpfc_vport_sparm(struct lpfc_hba *phba, struct lpfc_vport *vport)
pmb->vport = vport; pmb->vport = vport;
rc = lpfc_sli_issue_mbox_wait(phba, pmb, phba->fc_ratov * 2); rc = lpfc_sli_issue_mbox_wait(phba, pmb, phba->fc_ratov * 2);
if (rc != MBX_SUCCESS) { if (rc != MBX_SUCCESS) {
lpfc_printf_log(phba, KERN_ERR, LOG_INIT | LOG_VPORT, lpfc_printf_vlog(vport, KERN_ERR, LOG_INIT | LOG_VPORT,
"%d (%d):1818 VPort failed init, mbxCmd x%x " "1818 VPort failed init, mbxCmd x%x "
"READ_SPARM mbxStatus x%x, rc = x%x\n", "READ_SPARM mbxStatus x%x, rc = x%x\n",
phba->brd_no, vport->vpi, mb->mbxCommand, mb->mbxStatus, rc);
mb->mbxCommand, mb->mbxStatus, rc);
lpfc_mbuf_free(phba, mp->virt, mp->phys); lpfc_mbuf_free(phba, mp->virt, mp->phys);
kfree(mp); kfree(mp);
if (rc != MBX_TIMEOUT) if (rc != MBX_TIMEOUT)
...@@ -162,9 +161,9 @@ lpfc_valid_wwn_format(struct lpfc_hba *phba, struct lpfc_name *wwn, ...@@ -162,9 +161,9 @@ lpfc_valid_wwn_format(struct lpfc_hba *phba, struct lpfc_name *wwn,
return 1; return 1;
lpfc_printf_log(phba, KERN_ERR, LOG_VPORT, lpfc_printf_log(phba, KERN_ERR, LOG_VPORT,
"%d:1822 Invalid %s: %02x:%02x:%02x:%02x:" "1822 Invalid %s: %02x:%02x:%02x:%02x:"
"%02x:%02x:%02x:%02x\n", "%02x:%02x:%02x:%02x\n",
phba->brd_no, name_type, name_type,
wwn->u.wwn[0], wwn->u.wwn[1], wwn->u.wwn[0], wwn->u.wwn[1],
wwn->u.wwn[2], wwn->u.wwn[3], wwn->u.wwn[2], wwn->u.wwn[3],
wwn->u.wwn[4], wwn->u.wwn[5], wwn->u.wwn[4], wwn->u.wwn[5],
...@@ -209,9 +208,9 @@ lpfc_vport_create(struct fc_vport *fc_vport, bool disable) ...@@ -209,9 +208,9 @@ lpfc_vport_create(struct fc_vport *fc_vport, bool disable)
if ((phba->sli_rev < 3) || if ((phba->sli_rev < 3) ||
!(phba->sli3_options & LPFC_SLI3_NPIV_ENABLED)) { !(phba->sli3_options & LPFC_SLI3_NPIV_ENABLED)) {
lpfc_printf_log(phba, KERN_ERR, LOG_VPORT, lpfc_printf_log(phba, KERN_ERR, LOG_VPORT,
"%d:1808 Create VPORT failed: " "1808 Create VPORT failed: "
"NPIV is not enabled: SLImode:%d\n", "NPIV is not enabled: SLImode:%d\n",
phba->brd_no, phba->sli_rev); phba->sli_rev);
rc = VPORT_INVAL; rc = VPORT_INVAL;
goto error_out; goto error_out;
} }
...@@ -219,9 +218,9 @@ lpfc_vport_create(struct fc_vport *fc_vport, bool disable) ...@@ -219,9 +218,9 @@ lpfc_vport_create(struct fc_vport *fc_vport, bool disable)
vpi = lpfc_alloc_vpi(phba); vpi = lpfc_alloc_vpi(phba);
if (vpi == 0) { if (vpi == 0) {
lpfc_printf_log(phba, KERN_ERR, LOG_VPORT, lpfc_printf_log(phba, KERN_ERR, LOG_VPORT,
"%d:1809 Create VPORT failed: " "1809 Create VPORT failed: "
"Max VPORTs (%d) exceeded\n", "Max VPORTs (%d) exceeded\n",
phba->brd_no, phba->max_vpi); phba->max_vpi);
rc = VPORT_NORESOURCES; rc = VPORT_NORESOURCES;
goto error_out; goto error_out;
} }
...@@ -230,8 +229,8 @@ lpfc_vport_create(struct fc_vport *fc_vport, bool disable) ...@@ -230,8 +229,8 @@ lpfc_vport_create(struct fc_vport *fc_vport, bool disable)
/* Assign an unused board number */ /* Assign an unused board number */
if ((instance = lpfc_get_instance()) < 0) { if ((instance = lpfc_get_instance()) < 0) {
lpfc_printf_log(phba, KERN_ERR, LOG_VPORT, lpfc_printf_log(phba, KERN_ERR, LOG_VPORT,
"%d:1810 Create VPORT failed: Cannot get " "1810 Create VPORT failed: Cannot get "
"instance number\n", phba->brd_no); "instance number\n");
lpfc_free_vpi(phba, vpi); lpfc_free_vpi(phba, vpi);
rc = VPORT_NORESOURCES; rc = VPORT_NORESOURCES;
goto error_out; goto error_out;
...@@ -240,8 +239,7 @@ lpfc_vport_create(struct fc_vport *fc_vport, bool disable) ...@@ -240,8 +239,7 @@ lpfc_vport_create(struct fc_vport *fc_vport, bool disable)
vport = lpfc_create_port(phba, instance, &fc_vport->dev); vport = lpfc_create_port(phba, instance, &fc_vport->dev);
if (!vport) { if (!vport) {
lpfc_printf_log(phba, KERN_ERR, LOG_VPORT, lpfc_printf_log(phba, KERN_ERR, LOG_VPORT,
"%d:1811 Create VPORT failed: vpi x%x\n", "1811 Create VPORT failed: vpi x%x\n", vpi);
phba->brd_no, vpi);
lpfc_free_vpi(phba, vpi); lpfc_free_vpi(phba, vpi);
rc = VPORT_NORESOURCES; rc = VPORT_NORESOURCES;
goto error_out; goto error_out;
...@@ -251,10 +249,9 @@ lpfc_vport_create(struct fc_vport *fc_vport, bool disable) ...@@ -251,10 +249,9 @@ lpfc_vport_create(struct fc_vport *fc_vport, bool disable)
lpfc_debugfs_initialize(vport); lpfc_debugfs_initialize(vport);
if (lpfc_vport_sparm(phba, vport)) { if (lpfc_vport_sparm(phba, vport)) {
lpfc_printf_log(phba, KERN_ERR, LOG_VPORT, lpfc_printf_vlog(vport, KERN_ERR, LOG_VPORT,
"%d:1813 Create VPORT failed: vpi:%d " "1813 Create VPORT failed. "
"Cannot get sparam\n", "Cannot get sparam\n");
phba->brd_no, vpi);
lpfc_free_vpi(phba, vpi); lpfc_free_vpi(phba, vpi);
destroy_port(vport); destroy_port(vport);
rc = VPORT_NORESOURCES; rc = VPORT_NORESOURCES;
...@@ -274,10 +271,9 @@ lpfc_vport_create(struct fc_vport *fc_vport, bool disable) ...@@ -274,10 +271,9 @@ lpfc_vport_create(struct fc_vport *fc_vport, bool disable)
if (!lpfc_valid_wwn_format(phba, &vport->fc_sparam.nodeName, "WWNN") || if (!lpfc_valid_wwn_format(phba, &vport->fc_sparam.nodeName, "WWNN") ||
!lpfc_valid_wwn_format(phba, &vport->fc_sparam.portName, "WWPN")) { !lpfc_valid_wwn_format(phba, &vport->fc_sparam.portName, "WWPN")) {
lpfc_printf_log(phba, KERN_ERR, LOG_VPORT, lpfc_printf_vlog(vport, KERN_ERR, LOG_VPORT,
"%d:1821 Create VPORT failed: vpi:%d " "1821 Create VPORT failed. "
"Invalid WWN format\n", "Invalid WWN format\n");
phba->brd_no, vpi);
lpfc_free_vpi(phba, vpi); lpfc_free_vpi(phba, vpi);
destroy_port(vport); destroy_port(vport);
rc = VPORT_INVAL; rc = VPORT_INVAL;
...@@ -285,10 +281,9 @@ lpfc_vport_create(struct fc_vport *fc_vport, bool disable) ...@@ -285,10 +281,9 @@ lpfc_vport_create(struct fc_vport *fc_vport, bool disable)
} }
if (!lpfc_unique_wwpn(phba, vport)) { if (!lpfc_unique_wwpn(phba, vport)) {
lpfc_printf_log(phba, KERN_ERR, LOG_VPORT, lpfc_printf_vlog(vport, KERN_ERR, LOG_VPORT,
"%d:1823 Create VPORT failed: vpi:%d " "1823 Create VPORT failed. "
"Duplicate WWN on HBA\n", "Duplicate WWN on HBA\n");
phba->brd_no, vpi);
lpfc_free_vpi(phba, vpi); lpfc_free_vpi(phba, vpi);
destroy_port(vport); destroy_port(vport);
rc = VPORT_INVAL; rc = VPORT_INVAL;
...@@ -320,10 +315,8 @@ lpfc_vport_create(struct fc_vport *fc_vport, bool disable) ...@@ -320,10 +315,8 @@ lpfc_vport_create(struct fc_vport *fc_vport, bool disable)
lpfc_initial_fdisc(vport); lpfc_initial_fdisc(vport);
} else { } else {
lpfc_vport_set_state(vport, FC_VPORT_NO_FABRIC_SUPP); lpfc_vport_set_state(vport, FC_VPORT_NO_FABRIC_SUPP);
lpfc_printf_log(phba, KERN_ERR, LOG_ELS, lpfc_printf_vlog(vport, KERN_ERR, LOG_ELS,
"%d (%d):0262 No NPIV Fabric " "0262 No NPIV Fabric support\n");
"support\n",
phba->brd_no, vport->vpi);
} }
} else { } else {
lpfc_vport_set_state(vport, FC_VPORT_FAILED); lpfc_vport_set_state(vport, FC_VPORT_FAILED);
...@@ -409,10 +402,8 @@ enable_vport(struct fc_vport *fc_vport) ...@@ -409,10 +402,8 @@ enable_vport(struct fc_vport *fc_vport)
lpfc_initial_fdisc(vport); lpfc_initial_fdisc(vport);
} else { } else {
lpfc_vport_set_state(vport, FC_VPORT_NO_FABRIC_SUPP); lpfc_vport_set_state(vport, FC_VPORT_NO_FABRIC_SUPP);
lpfc_printf_log(phba, KERN_ERR, LOG_ELS, lpfc_printf_vlog(vport, KERN_ERR, LOG_ELS,
"%d (%d):0264 No NPIV Fabric " "0264 No NPIV Fabric support\n");
"support\n",
phba->brd_no, vport->vpi);
} }
} else { } else {
lpfc_vport_set_state(vport, FC_VPORT_FAILED); lpfc_vport_set_state(vport, FC_VPORT_FAILED);
...@@ -462,9 +453,9 @@ lpfc_vport_delete(struct fc_vport *fc_vport) ...@@ -462,9 +453,9 @@ lpfc_vport_delete(struct fc_vport *fc_vport)
return VPORT_INVAL; return VPORT_INVAL;
if (vport->port_type == LPFC_PHYSICAL_PORT) { if (vport->port_type == LPFC_PHYSICAL_PORT) {
lpfc_printf_log(phba, KERN_ERR, LOG_VPORT, lpfc_printf_vlog(vport, KERN_ERR, LOG_VPORT,
"%d:1812 vport_delete failed: Cannot delete " "1812 vport_delete failed: Cannot delete "
"physical host\n", phba->brd_no); "physical host\n");
goto out; goto out;
} }
...@@ -544,8 +535,12 @@ lpfc_create_vport_work_array(struct lpfc_hba *phba) ...@@ -544,8 +535,12 @@ lpfc_create_vport_work_array(struct lpfc_hba *phba)
return NULL; return NULL;
spin_lock_irq(&phba->hbalock); spin_lock_irq(&phba->hbalock);
list_for_each_entry(port_iterator, &phba->port_list, listentry) { list_for_each_entry(port_iterator, &phba->port_list, listentry) {
if (!scsi_host_get(lpfc_shost_from_vport(port_iterator))) if (!scsi_host_get(lpfc_shost_from_vport(port_iterator))) {
lpfc_printf_vlog(port_iterator, KERN_ERR, LOG_VPORT,
"1801 Create vport work array FAILED: "
"cannot do scsi_host_get\n");
continue; continue;
}
vports[index++] = port_iterator; vports[index++] = port_iterator;
} }
spin_unlock_irq(&phba->hbalock); spin_unlock_irq(&phba->hbalock);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment