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);
......
This diff is collapsed.
...@@ -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:
......
This diff is collapsed.
This diff is collapsed.
...@@ -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",
......
This diff is collapsed.
This diff is collapsed.
...@@ -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