.. | .. |
---|
1 | 1 | /******************************************************************* |
---|
2 | 2 | * This file is part of the Emulex Linux Device Driver for * |
---|
3 | 3 | * Fibre Channel Host Bus Adapters. * |
---|
4 | | - * Copyright (C) 2017-2018 Broadcom. All Rights Reserved. The term * |
---|
| 4 | + * Copyright (C) 2017-2020 Broadcom. All Rights Reserved. The term * |
---|
5 | 5 | * “Broadcom” refers to Broadcom Inc. and/or its subsidiaries. * |
---|
6 | 6 | * Copyright (C) 2004-2016 Emulex. All rights reserved. * |
---|
7 | 7 | * EMULEX and SLI are trademarks of Emulex. * |
---|
.. | .. |
---|
28 | 28 | #include <linux/kthread.h> |
---|
29 | 29 | #include <linux/interrupt.h> |
---|
30 | 30 | #include <linux/lockdep.h> |
---|
| 31 | +#include <linux/utsname.h> |
---|
31 | 32 | |
---|
32 | 33 | #include <scsi/scsi.h> |
---|
33 | 34 | #include <scsi/scsi_device.h> |
---|
34 | 35 | #include <scsi/scsi_host.h> |
---|
35 | 36 | #include <scsi/scsi_transport_fc.h> |
---|
36 | 37 | #include <scsi/fc/fc_fs.h> |
---|
37 | | - |
---|
38 | | -#include <linux/nvme-fc-driver.h> |
---|
39 | 38 | |
---|
40 | 39 | #include "lpfc_hw4.h" |
---|
41 | 40 | #include "lpfc_hw.h" |
---|
.. | .. |
---|
72 | 71 | static void lpfc_disc_flush_list(struct lpfc_vport *vport); |
---|
73 | 72 | static void lpfc_unregister_fcfi_cmpl(struct lpfc_hba *, LPFC_MBOXQ_t *); |
---|
74 | 73 | static int lpfc_fcf_inuse(struct lpfc_hba *); |
---|
| 74 | +static void lpfc_mbx_cmpl_read_sparam(struct lpfc_hba *, LPFC_MBOXQ_t *); |
---|
75 | 75 | |
---|
76 | 76 | void |
---|
77 | 77 | lpfc_terminate_rport_io(struct fc_rport *rport) |
---|
.. | .. |
---|
118 | 118 | struct lpfc_work_evt *evtp; |
---|
119 | 119 | int put_node; |
---|
120 | 120 | int put_rport; |
---|
| 121 | + unsigned long iflags; |
---|
121 | 122 | |
---|
122 | 123 | rdata = rport->dd_data; |
---|
123 | 124 | ndlp = rdata->pnode; |
---|
.. | .. |
---|
132 | 133 | ndlp->nlp_sid, ndlp->nlp_DID, ndlp->nlp_flag); |
---|
133 | 134 | |
---|
134 | 135 | lpfc_printf_vlog(ndlp->vport, KERN_INFO, LOG_NODE, |
---|
135 | | - "3181 dev_loss_callbk x%06x, rport %p flg x%x\n", |
---|
| 136 | + "3181 dev_loss_callbk x%06x, rport x%px flg x%x\n", |
---|
136 | 137 | ndlp->nlp_DID, ndlp->rport, ndlp->nlp_flag); |
---|
137 | 138 | |
---|
138 | 139 | /* Don't defer this if we are in the process of deleting the vport |
---|
.. | .. |
---|
155 | 156 | return; |
---|
156 | 157 | |
---|
157 | 158 | if (rport->port_name != wwn_to_u64(ndlp->nlp_portname.u.wwn)) |
---|
158 | | - lpfc_printf_vlog(vport, KERN_ERR, LOG_NODE, |
---|
159 | | - "6789 rport name %llx != node port name %llx", |
---|
160 | | - rport->port_name, |
---|
161 | | - wwn_to_u64(ndlp->nlp_portname.u.wwn)); |
---|
| 159 | + lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT, |
---|
| 160 | + "6789 rport name %llx != node port name %llx", |
---|
| 161 | + rport->port_name, |
---|
| 162 | + wwn_to_u64(ndlp->nlp_portname.u.wwn)); |
---|
162 | 163 | |
---|
163 | 164 | evtp = &ndlp->dev_loss_evt; |
---|
164 | 165 | |
---|
165 | 166 | if (!list_empty(&evtp->evt_listp)) { |
---|
166 | | - lpfc_printf_vlog(vport, KERN_ERR, LOG_NODE, |
---|
167 | | - "6790 rport name %llx dev_loss_evt pending", |
---|
168 | | - rport->port_name); |
---|
| 167 | + lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT, |
---|
| 168 | + "6790 rport name %llx dev_loss_evt pending", |
---|
| 169 | + rport->port_name); |
---|
169 | 170 | return; |
---|
170 | 171 | } |
---|
171 | 172 | |
---|
172 | 173 | shost = lpfc_shost_from_vport(vport); |
---|
173 | | - spin_lock_irq(shost->host_lock); |
---|
| 174 | + spin_lock_irqsave(shost->host_lock, iflags); |
---|
174 | 175 | ndlp->nlp_flag |= NLP_IN_DEV_LOSS; |
---|
175 | | - spin_unlock_irq(shost->host_lock); |
---|
| 176 | + spin_unlock_irqrestore(shost->host_lock, iflags); |
---|
176 | 177 | |
---|
177 | 178 | /* We need to hold the node by incrementing the reference |
---|
178 | 179 | * count until this queued work is done |
---|
179 | 180 | */ |
---|
180 | 181 | evtp->evt_arg1 = lpfc_nlp_get(ndlp); |
---|
181 | 182 | |
---|
182 | | - spin_lock_irq(&phba->hbalock); |
---|
| 183 | + spin_lock_irqsave(&phba->hbalock, iflags); |
---|
183 | 184 | if (evtp->evt_arg1) { |
---|
184 | 185 | evtp->evt = LPFC_EVT_DEV_LOSS; |
---|
185 | 186 | list_add_tail(&evtp->evt_listp, &phba->work_list); |
---|
186 | 187 | lpfc_worker_wake_up(phba); |
---|
187 | 188 | } |
---|
188 | | - spin_unlock_irq(&phba->hbalock); |
---|
| 189 | + spin_unlock_irqrestore(&phba->hbalock, iflags); |
---|
189 | 190 | |
---|
190 | 191 | return; |
---|
191 | 192 | } |
---|
.. | .. |
---|
212 | 213 | int put_node; |
---|
213 | 214 | int warn_on = 0; |
---|
214 | 215 | int fcf_inuse = 0; |
---|
| 216 | + unsigned long iflags; |
---|
215 | 217 | |
---|
216 | 218 | rport = ndlp->rport; |
---|
217 | 219 | vport = ndlp->vport; |
---|
218 | 220 | shost = lpfc_shost_from_vport(vport); |
---|
219 | 221 | |
---|
220 | | - spin_lock_irq(shost->host_lock); |
---|
| 222 | + spin_lock_irqsave(shost->host_lock, iflags); |
---|
221 | 223 | ndlp->nlp_flag &= ~NLP_IN_DEV_LOSS; |
---|
222 | | - spin_unlock_irq(shost->host_lock); |
---|
| 224 | + spin_unlock_irqrestore(shost->host_lock, iflags); |
---|
223 | 225 | |
---|
224 | 226 | if (!rport) |
---|
225 | 227 | return fcf_inuse; |
---|
.. | .. |
---|
235 | 237 | ndlp->nlp_DID, ndlp->nlp_type, rport->scsi_target_id); |
---|
236 | 238 | |
---|
237 | 239 | lpfc_printf_vlog(ndlp->vport, KERN_INFO, LOG_NODE, |
---|
238 | | - "3182 dev_loss_tmo_handler x%06x, rport %p flg x%x\n", |
---|
| 240 | + "3182 dev_loss_tmo_handler x%06x, rport x%px flg x%x\n", |
---|
239 | 241 | ndlp->nlp_DID, ndlp->rport, ndlp->nlp_flag); |
---|
240 | 242 | |
---|
241 | 243 | /* |
---|
.. | .. |
---|
294 | 296 | } |
---|
295 | 297 | |
---|
296 | 298 | if (warn_on) { |
---|
297 | | - lpfc_printf_vlog(vport, KERN_ERR, LOG_DISCOVERY, |
---|
| 299 | + lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT, |
---|
298 | 300 | "0203 Devloss timeout on " |
---|
299 | 301 | "WWPN %02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x " |
---|
300 | 302 | "NPort x%06x Data: x%x x%x x%x\n", |
---|
.. | .. |
---|
303 | 305 | ndlp->nlp_DID, ndlp->nlp_flag, |
---|
304 | 306 | ndlp->nlp_state, ndlp->nlp_rpi); |
---|
305 | 307 | } else { |
---|
306 | | - lpfc_printf_vlog(vport, KERN_INFO, LOG_DISCOVERY, |
---|
| 308 | + lpfc_printf_vlog(vport, KERN_INFO, LOG_TRACE_EVENT, |
---|
307 | 309 | "0204 Devloss timeout on " |
---|
308 | 310 | "WWPN %02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x " |
---|
309 | 311 | "NPort x%06x Data: x%x x%x x%x\n", |
---|
.. | .. |
---|
550 | 552 | fcf_inuse, |
---|
551 | 553 | nlp_did); |
---|
552 | 554 | break; |
---|
| 555 | + case LPFC_EVT_RECOVER_PORT: |
---|
| 556 | + ndlp = (struct lpfc_nodelist *)(evtp->evt_arg1); |
---|
| 557 | + lpfc_sli_abts_recover_port(ndlp->vport, ndlp); |
---|
| 558 | + free_evt = 0; |
---|
| 559 | + /* decrement the node reference count held for |
---|
| 560 | + * this queued work |
---|
| 561 | + */ |
---|
| 562 | + lpfc_nlp_put(ndlp); |
---|
| 563 | + break; |
---|
553 | 564 | case LPFC_EVT_ONLINE: |
---|
554 | 565 | if (phba->link_state < LPFC_LINK_DOWN) |
---|
555 | 566 | *(int *) (evtp->evt_arg1) = lpfc_online(phba); |
---|
.. | .. |
---|
624 | 635 | if (phba->pci_dev_grp == LPFC_PCI_DEV_OC) |
---|
625 | 636 | lpfc_sli4_post_async_mbox(phba); |
---|
626 | 637 | |
---|
627 | | - if (ha_copy & HA_ERATT) |
---|
| 638 | + if (ha_copy & HA_ERATT) { |
---|
628 | 639 | /* Handle the error attention event */ |
---|
629 | 640 | lpfc_handle_eratt(phba); |
---|
| 641 | + |
---|
| 642 | + if (phba->fw_dump_cmpl) { |
---|
| 643 | + complete(phba->fw_dump_cmpl); |
---|
| 644 | + phba->fw_dump_cmpl = NULL; |
---|
| 645 | + } |
---|
| 646 | + } |
---|
630 | 647 | |
---|
631 | 648 | if (ha_copy & HA_MBATT) |
---|
632 | 649 | lpfc_sli_handle_mb_event(phba); |
---|
.. | .. |
---|
638 | 655 | if (phba->pci_dev_grp == LPFC_PCI_DEV_OC) { |
---|
639 | 656 | if (phba->hba_flag & HBA_RRQ_ACTIVE) |
---|
640 | 657 | lpfc_handle_rrq_active(phba); |
---|
641 | | - if (phba->hba_flag & FCP_XRI_ABORT_EVENT) |
---|
642 | | - lpfc_sli4_fcp_xri_abort_event_proc(phba); |
---|
643 | 658 | if (phba->hba_flag & ELS_XRI_ABORT_EVENT) |
---|
644 | 659 | lpfc_sli4_els_xri_abort_event_proc(phba); |
---|
645 | 660 | if (phba->hba_flag & ASYNC_EVENT) |
---|
.. | .. |
---|
700 | 715 | if (!(phba->hba_flag & HBA_SP_QUEUE_EVT)) |
---|
701 | 716 | set_bit(LPFC_DATA_READY, &phba->data_flags); |
---|
702 | 717 | } else { |
---|
703 | | - if (phba->link_state >= LPFC_LINK_UP || |
---|
| 718 | + /* Driver could have abort request completed in queue |
---|
| 719 | + * when link goes down. Allow for this transition. |
---|
| 720 | + */ |
---|
| 721 | + if (phba->link_state >= LPFC_LINK_DOWN || |
---|
704 | 722 | phba->link_flag & LS_MDS_LOOPBACK) { |
---|
705 | 723 | pring->flag &= ~LPFC_DEFERRED_RING_EVENT; |
---|
706 | 724 | lpfc_sli_handle_slow_ring_event(phba, pring, |
---|
.. | .. |
---|
753 | 771 | || kthread_should_stop())); |
---|
754 | 772 | /* Signal wakeup shall terminate the worker thread */ |
---|
755 | 773 | if (rc) { |
---|
756 | | - lpfc_printf_log(phba, KERN_ERR, LOG_ELS, |
---|
| 774 | + lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, |
---|
757 | 775 | "0433 Wakeup on signal: rc=x%x\n", rc); |
---|
758 | 776 | break; |
---|
759 | 777 | } |
---|
.. | .. |
---|
821 | 839 | if ((phba->sli_rev < LPFC_SLI_REV4) && |
---|
822 | 840 | (!remove && ndlp->nlp_type & NLP_FABRIC)) |
---|
823 | 841 | continue; |
---|
| 842 | + |
---|
| 843 | + /* Notify transport of connectivity loss to trigger cleanup. */ |
---|
| 844 | + if (phba->nvmet_support && |
---|
| 845 | + ndlp->nlp_state == NLP_STE_UNMAPPED_NODE) |
---|
| 846 | + lpfc_nvmet_invalidate_host(phba, ndlp); |
---|
| 847 | + |
---|
824 | 848 | lpfc_disc_state_machine(vport, ndlp, NULL, |
---|
825 | 849 | remove |
---|
826 | 850 | ? NLP_EVT_DEVICE_RM |
---|
.. | .. |
---|
859 | 883 | void |
---|
860 | 884 | lpfc_linkdown_port(struct lpfc_vport *vport) |
---|
861 | 885 | { |
---|
862 | | - struct lpfc_hba *phba = vport->phba; |
---|
863 | 886 | struct Scsi_Host *shost = lpfc_shost_from_vport(vport); |
---|
864 | 887 | |
---|
865 | | - if (phba->cfg_enable_fc4_type != LPFC_ENABLE_NVME) |
---|
| 888 | + if (vport->cfg_enable_fc4_type != LPFC_ENABLE_NVME) |
---|
866 | 889 | fc_host_post_event(shost, fc_get_event_number(), |
---|
867 | 890 | FCH_EVT_LINKDOWN, 0); |
---|
868 | 891 | |
---|
.. | .. |
---|
894 | 917 | /* Block all SCSI stack I/Os */ |
---|
895 | 918 | lpfc_scsi_dev_block(phba); |
---|
896 | 919 | |
---|
| 920 | + phba->defer_flogi_acc_flag = false; |
---|
| 921 | + |
---|
897 | 922 | spin_lock_irq(&phba->hbalock); |
---|
898 | 923 | phba->fcf.fcf_flag &= ~(FCF_AVAILABLE | FCF_SCAN_DONE); |
---|
899 | 924 | spin_unlock_irq(&phba->hbalock); |
---|
900 | 925 | if (phba->link_state > LPFC_LINK_DOWN) { |
---|
901 | 926 | phba->link_state = LPFC_LINK_DOWN; |
---|
| 927 | + if (phba->sli4_hba.conf_trunk) { |
---|
| 928 | + phba->trunk_link.link0.state = 0; |
---|
| 929 | + phba->trunk_link.link1.state = 0; |
---|
| 930 | + phba->trunk_link.link2.state = 0; |
---|
| 931 | + phba->trunk_link.link3.state = 0; |
---|
| 932 | + phba->sli4_hba.link_state.logical_speed = |
---|
| 933 | + LPFC_LINK_SPEED_UNKNOWN; |
---|
| 934 | + } |
---|
902 | 935 | spin_lock_irq(shost->host_lock); |
---|
903 | 936 | phba->pport->fc_flag &= ~FC_LBIT; |
---|
904 | 937 | spin_unlock_irq(shost->host_lock); |
---|
.. | .. |
---|
911 | 944 | |
---|
912 | 945 | vports[i]->fc_myDID = 0; |
---|
913 | 946 | |
---|
914 | | - if ((phba->cfg_enable_fc4_type == LPFC_ENABLE_BOTH) || |
---|
915 | | - (phba->cfg_enable_fc4_type == LPFC_ENABLE_NVME)) { |
---|
| 947 | + if ((vport->cfg_enable_fc4_type == LPFC_ENABLE_BOTH) || |
---|
| 948 | + (vport->cfg_enable_fc4_type == LPFC_ENABLE_NVME)) { |
---|
916 | 949 | if (phba->nvmet_support) |
---|
917 | 950 | lpfc_nvmet_update_targetport(phba); |
---|
918 | 951 | else |
---|
.. | .. |
---|
1003 | 1036 | (vport != phba->pport)) |
---|
1004 | 1037 | return; |
---|
1005 | 1038 | |
---|
1006 | | - if (phba->cfg_enable_fc4_type != LPFC_ENABLE_NVME) |
---|
| 1039 | + if (vport->cfg_enable_fc4_type != LPFC_ENABLE_NVME) |
---|
1007 | 1040 | fc_host_post_event(shost, fc_get_event_number(), |
---|
1008 | 1041 | FCH_EVT_LINKUP, 0); |
---|
1009 | 1042 | |
---|
.. | .. |
---|
1045 | 1078 | spin_lock_irq(shost->host_lock); |
---|
1046 | 1079 | phba->pport->rcv_flogi_cnt = 0; |
---|
1047 | 1080 | spin_unlock_irq(shost->host_lock); |
---|
| 1081 | + |
---|
| 1082 | + /* reinitialize initial FLOGI flag */ |
---|
| 1083 | + phba->hba_flag &= ~(HBA_FLOGI_ISSUED); |
---|
| 1084 | + phba->defer_flogi_acc_flag = false; |
---|
| 1085 | + |
---|
1048 | 1086 | return 0; |
---|
1049 | 1087 | } |
---|
1050 | 1088 | |
---|
.. | .. |
---|
1070 | 1108 | /* Check for error */ |
---|
1071 | 1109 | if ((mb->mbxStatus) && (mb->mbxStatus != 0x1601)) { |
---|
1072 | 1110 | /* CLEAR_LA mbox error <mbxStatus> state <hba_state> */ |
---|
1073 | | - lpfc_printf_vlog(vport, KERN_ERR, LOG_MBOX, |
---|
| 1111 | + lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT, |
---|
1074 | 1112 | "0320 CLEAR_LA mbxStatus error x%x hba " |
---|
1075 | 1113 | "state x%x\n", |
---|
1076 | 1114 | mb->mbxStatus, vport->port_state); |
---|
.. | .. |
---|
1116 | 1154 | return; |
---|
1117 | 1155 | } |
---|
1118 | 1156 | |
---|
1119 | | - |
---|
1120 | 1157 | void |
---|
1121 | 1158 | lpfc_mbx_cmpl_local_config_link(struct lpfc_hba *phba, LPFC_MBOXQ_t *pmb) |
---|
1122 | 1159 | { |
---|
1123 | 1160 | struct lpfc_vport *vport = pmb->vport; |
---|
1124 | | - uint8_t bbscn = 0; |
---|
1125 | | - |
---|
1126 | | - if (pmb->u.mb.mbxStatus) |
---|
1127 | | - goto out; |
---|
| 1161 | + LPFC_MBOXQ_t *sparam_mb; |
---|
| 1162 | + struct lpfc_dmabuf *sparam_mp; |
---|
| 1163 | + u16 status = pmb->u.mb.mbxStatus; |
---|
| 1164 | + int rc; |
---|
1128 | 1165 | |
---|
1129 | 1166 | mempool_free(pmb, phba->mbox_mem_pool); |
---|
| 1167 | + |
---|
| 1168 | + if (status) |
---|
| 1169 | + goto out; |
---|
1130 | 1170 | |
---|
1131 | 1171 | /* don't perform discovery for SLI4 loopback diagnostic test */ |
---|
1132 | 1172 | if ((phba->sli_rev == LPFC_SLI_REV4) && |
---|
.. | .. |
---|
1146 | 1186 | } |
---|
1147 | 1187 | |
---|
1148 | 1188 | /* Start discovery by sending a FLOGI. port_state is identically |
---|
1149 | | - * LPFC_FLOGI while waiting for FLOGI cmpl |
---|
| 1189 | + * LPFC_FLOGI while waiting for FLOGI cmpl. |
---|
1150 | 1190 | */ |
---|
1151 | 1191 | if (vport->port_state != LPFC_FLOGI) { |
---|
1152 | | - if (phba->bbcredit_support && phba->cfg_enable_bbcr) { |
---|
1153 | | - bbscn = bf_get(lpfc_bbscn_def, |
---|
1154 | | - &phba->sli4_hba.bbscn_params); |
---|
1155 | | - vport->fc_sparam.cmn.bbRcvSizeMsb &= 0xf; |
---|
1156 | | - vport->fc_sparam.cmn.bbRcvSizeMsb |= (bbscn << 4); |
---|
| 1192 | + /* Issue MBX_READ_SPARAM to update CSPs before FLOGI if |
---|
| 1193 | + * bb-credit recovery is in place. |
---|
| 1194 | + */ |
---|
| 1195 | + if (phba->bbcredit_support && phba->cfg_enable_bbcr && |
---|
| 1196 | + !(phba->link_flag & LS_LOOPBACK_MODE)) { |
---|
| 1197 | + sparam_mb = mempool_alloc(phba->mbox_mem_pool, |
---|
| 1198 | + GFP_KERNEL); |
---|
| 1199 | + if (!sparam_mb) |
---|
| 1200 | + goto sparam_out; |
---|
| 1201 | + |
---|
| 1202 | + rc = lpfc_read_sparam(phba, sparam_mb, 0); |
---|
| 1203 | + if (rc) { |
---|
| 1204 | + mempool_free(sparam_mb, phba->mbox_mem_pool); |
---|
| 1205 | + goto sparam_out; |
---|
| 1206 | + } |
---|
| 1207 | + sparam_mb->vport = vport; |
---|
| 1208 | + sparam_mb->mbox_cmpl = lpfc_mbx_cmpl_read_sparam; |
---|
| 1209 | + rc = lpfc_sli_issue_mbox(phba, sparam_mb, MBX_NOWAIT); |
---|
| 1210 | + if (rc == MBX_NOT_FINISHED) { |
---|
| 1211 | + sparam_mp = (struct lpfc_dmabuf *) |
---|
| 1212 | + sparam_mb->ctx_buf; |
---|
| 1213 | + lpfc_mbuf_free(phba, sparam_mp->virt, |
---|
| 1214 | + sparam_mp->phys); |
---|
| 1215 | + kfree(sparam_mp); |
---|
| 1216 | + sparam_mb->ctx_buf = NULL; |
---|
| 1217 | + mempool_free(sparam_mb, phba->mbox_mem_pool); |
---|
| 1218 | + goto sparam_out; |
---|
| 1219 | + } |
---|
| 1220 | + |
---|
| 1221 | + phba->hba_flag |= HBA_DEFER_FLOGI; |
---|
| 1222 | + } else { |
---|
| 1223 | + lpfc_initial_flogi(vport); |
---|
1157 | 1224 | } |
---|
1158 | | - lpfc_initial_flogi(vport); |
---|
1159 | | - } else if (vport->fc_flag & FC_PT2PT) { |
---|
1160 | | - lpfc_disc_start(vport); |
---|
| 1225 | + } else { |
---|
| 1226 | + if (vport->fc_flag & FC_PT2PT) |
---|
| 1227 | + lpfc_disc_start(vport); |
---|
1161 | 1228 | } |
---|
1162 | 1229 | return; |
---|
1163 | 1230 | |
---|
1164 | 1231 | out: |
---|
1165 | | - lpfc_printf_vlog(vport, KERN_ERR, LOG_MBOX, |
---|
1166 | | - "0306 CONFIG_LINK mbxStatus error x%x " |
---|
1167 | | - "HBA state x%x\n", |
---|
1168 | | - pmb->u.mb.mbxStatus, vport->port_state); |
---|
1169 | | - mempool_free(pmb, phba->mbox_mem_pool); |
---|
| 1232 | + lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT, |
---|
| 1233 | + "0306 CONFIG_LINK mbxStatus error x%x HBA state x%x\n", |
---|
| 1234 | + status, vport->port_state); |
---|
1170 | 1235 | |
---|
| 1236 | +sparam_out: |
---|
1171 | 1237 | lpfc_linkdown(phba); |
---|
1172 | 1238 | |
---|
1173 | | - lpfc_printf_vlog(vport, KERN_ERR, LOG_DISCOVERY, |
---|
| 1239 | + lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT, |
---|
1174 | 1240 | "0200 CONFIG_LINK bad hba state x%x\n", |
---|
1175 | 1241 | vport->port_state); |
---|
1176 | 1242 | |
---|
.. | .. |
---|
1180 | 1246 | |
---|
1181 | 1247 | /** |
---|
1182 | 1248 | * lpfc_sli4_clear_fcf_rr_bmask |
---|
1183 | | - * @phba pointer to the struct lpfc_hba for this port. |
---|
| 1249 | + * @phba: pointer to the struct lpfc_hba for this port. |
---|
1184 | 1250 | * This fucnction resets the round robin bit mask and clears the |
---|
1185 | 1251 | * fcf priority list. The list deletions are done while holding the |
---|
1186 | 1252 | * hbalock. The ON_LIST flag and the FLOGI_FAILED flags are cleared |
---|
.. | .. |
---|
1206 | 1272 | struct lpfc_vport *vport = mboxq->vport; |
---|
1207 | 1273 | |
---|
1208 | 1274 | if (mboxq->u.mb.mbxStatus) { |
---|
1209 | | - lpfc_printf_vlog(vport, KERN_ERR, LOG_MBOX, |
---|
1210 | | - "2017 REG_FCFI mbxStatus error x%x " |
---|
1211 | | - "HBA state x%x\n", |
---|
1212 | | - mboxq->u.mb.mbxStatus, vport->port_state); |
---|
| 1275 | + lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT, |
---|
| 1276 | + "2017 REG_FCFI mbxStatus error x%x " |
---|
| 1277 | + "HBA state x%x\n", mboxq->u.mb.mbxStatus, |
---|
| 1278 | + vport->port_state); |
---|
1213 | 1279 | goto fail_out; |
---|
1214 | 1280 | } |
---|
1215 | 1281 | |
---|
.. | .. |
---|
1279 | 1345 | |
---|
1280 | 1346 | /** |
---|
1281 | 1347 | * lpfc_sw_name_match - Check if the fcf switch name match. |
---|
1282 | | - * @fab_name: pointer to fabric name. |
---|
| 1348 | + * @sw_name: pointer to switch name. |
---|
1283 | 1349 | * @new_fcf_record: pointer to fcf record. |
---|
1284 | 1350 | * |
---|
1285 | 1351 | * This routine compare the fcf record's switch name with provided |
---|
.. | .. |
---|
1342 | 1408 | } |
---|
1343 | 1409 | |
---|
1344 | 1410 | /** |
---|
1345 | | - * lpfc_update_fcf_record - Update driver fcf record |
---|
1346 | 1411 | * __lpfc_update_fcf_record_pri - update the lpfc_fcf_pri record. |
---|
1347 | 1412 | * @phba: pointer to lpfc hba data structure. |
---|
1348 | 1413 | * @fcf_index: Index for the lpfc_fcf_record. |
---|
1349 | 1414 | * @new_fcf_record: pointer to hba fcf record. |
---|
1350 | 1415 | * |
---|
1351 | 1416 | * This routine updates the driver FCF priority record from the new HBA FCF |
---|
1352 | | - * record. This routine is called with the host lock held. |
---|
| 1417 | + * record. The hbalock is asserted held in the code path calling this |
---|
| 1418 | + * routine. |
---|
1353 | 1419 | **/ |
---|
1354 | 1420 | static void |
---|
1355 | 1421 | __lpfc_update_fcf_record_pri(struct lpfc_hba *phba, uint16_t fcf_index, |
---|
.. | .. |
---|
1357 | 1423 | ) |
---|
1358 | 1424 | { |
---|
1359 | 1425 | struct lpfc_fcf_pri *fcf_pri; |
---|
1360 | | - |
---|
1361 | | - lockdep_assert_held(&phba->hbalock); |
---|
1362 | 1426 | |
---|
1363 | 1427 | fcf_pri = &phba->fcf.fcf_pri[fcf_index]; |
---|
1364 | 1428 | fcf_pri->fcf_rec.fcf_index = fcf_index; |
---|
.. | .. |
---|
1369 | 1433 | |
---|
1370 | 1434 | /** |
---|
1371 | 1435 | * lpfc_copy_fcf_record - Copy fcf information to lpfc_hba. |
---|
1372 | | - * @fcf: pointer to driver fcf record. |
---|
| 1436 | + * @fcf_rec: pointer to driver fcf record. |
---|
1373 | 1437 | * @new_fcf_record: pointer to fcf record. |
---|
1374 | 1438 | * |
---|
1375 | 1439 | * This routine copies the FCF information from the FCF |
---|
.. | .. |
---|
1437 | 1501 | * |
---|
1438 | 1502 | * This routine updates the driver FCF record from the new HBA FCF record |
---|
1439 | 1503 | * together with the address mode, vlan_id, and other informations. This |
---|
1440 | | - * routine is called with the host lock held. |
---|
| 1504 | + * routine is called with the hbalock held. |
---|
1441 | 1505 | **/ |
---|
1442 | 1506 | static void |
---|
1443 | 1507 | __lpfc_update_fcf_record(struct lpfc_hba *phba, struct lpfc_fcf_rec *fcf_rec, |
---|
.. | .. |
---|
1832 | 1896 | */ |
---|
1833 | 1897 | lpfc_sli4_mbx_sge_get(mboxq, 0, &sge); |
---|
1834 | 1898 | if (unlikely(!mboxq->sge_array)) { |
---|
1835 | | - lpfc_printf_log(phba, KERN_ERR, LOG_MBOX, |
---|
| 1899 | + lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, |
---|
1836 | 1900 | "2524 Failed to get the non-embedded SGE " |
---|
1837 | 1901 | "virtual address\n"); |
---|
1838 | 1902 | return NULL; |
---|
.. | .. |
---|
1848 | 1912 | if (shdr_status || shdr_add_status) { |
---|
1849 | 1913 | if (shdr_status == STATUS_FCF_TABLE_EMPTY || |
---|
1850 | 1914 | if_type == LPFC_SLI_INTF_IF_TYPE_2) |
---|
1851 | | - lpfc_printf_log(phba, KERN_ERR, LOG_FIP, |
---|
| 1915 | + lpfc_printf_log(phba, KERN_ERR, |
---|
| 1916 | + LOG_TRACE_EVENT, |
---|
1852 | 1917 | "2726 READ_FCF_RECORD Indicates empty " |
---|
1853 | 1918 | "FCF table.\n"); |
---|
1854 | 1919 | else |
---|
1855 | | - lpfc_printf_log(phba, KERN_ERR, LOG_FIP, |
---|
| 1920 | + lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, |
---|
1856 | 1921 | "2521 READ_FCF_RECORD mailbox failed " |
---|
1857 | 1922 | "with status x%x add_status x%x, " |
---|
1858 | 1923 | "mbx\n", shdr_status, shdr_add_status); |
---|
.. | .. |
---|
1936 | 2001 | } |
---|
1937 | 2002 | |
---|
1938 | 2003 | /** |
---|
1939 | | - lpfc_sli4_fcf_record_match - testing new FCF record for matching existing FCF |
---|
| 2004 | + * lpfc_sli4_fcf_record_match - testing new FCF record for matching existing FCF |
---|
1940 | 2005 | * @phba: pointer to lpfc hba data structure. |
---|
1941 | 2006 | * @fcf_rec: pointer to an existing FCF record. |
---|
1942 | 2007 | * @new_fcf_record: pointer to a new FCF record. |
---|
.. | .. |
---|
2050 | 2115 | /** |
---|
2051 | 2116 | * lpfc_sli4_fcf_pri_list_del |
---|
2052 | 2117 | * @phba: pointer to lpfc hba data structure. |
---|
2053 | | - * @fcf_index the index of the fcf record to delete |
---|
| 2118 | + * @fcf_index: the index of the fcf record to delete |
---|
2054 | 2119 | * This routine checks the on list flag of the fcf_index to be deleted. |
---|
2055 | 2120 | * If it is one the list then it is removed from the list, and the flag |
---|
2056 | 2121 | * is cleared. This routine grab the hbalock before removing the fcf |
---|
.. | .. |
---|
2080 | 2145 | /** |
---|
2081 | 2146 | * lpfc_sli4_set_fcf_flogi_fail |
---|
2082 | 2147 | * @phba: pointer to lpfc hba data structure. |
---|
2083 | | - * @fcf_index the index of the fcf record to update |
---|
| 2148 | + * @fcf_index: the index of the fcf record to update |
---|
2084 | 2149 | * This routine acquires the hbalock and then set the LPFC_FCF_FLOGI_FAILED |
---|
2085 | 2150 | * flag so the the round robin slection for the particular priority level |
---|
2086 | 2151 | * will try a different fcf record that does not have this bit set. |
---|
.. | .. |
---|
2100 | 2165 | /** |
---|
2101 | 2166 | * lpfc_sli4_fcf_pri_list_add |
---|
2102 | 2167 | * @phba: pointer to lpfc hba data structure. |
---|
2103 | | - * @fcf_index the index of the fcf record to add |
---|
| 2168 | + * @fcf_index: the index of the fcf record to add |
---|
| 2169 | + * @new_fcf_record: pointer to a new FCF record. |
---|
2104 | 2170 | * This routine checks the priority of the fcf_index to be added. |
---|
2105 | 2171 | * If it is a lower priority than the current head of the fcf_pri list |
---|
2106 | 2172 | * then it is added to the list in the right order. |
---|
.. | .. |
---|
2230 | 2296 | new_fcf_record = lpfc_sli4_fcf_rec_mbox_parse(phba, mboxq, |
---|
2231 | 2297 | &next_fcf_index); |
---|
2232 | 2298 | if (!new_fcf_record) { |
---|
2233 | | - lpfc_printf_log(phba, KERN_ERR, LOG_FIP, |
---|
| 2299 | + lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, |
---|
2234 | 2300 | "2765 Mailbox command READ_FCF_RECORD " |
---|
2235 | 2301 | "failed to retrieve a FCF record.\n"); |
---|
2236 | 2302 | /* Let next new FCF event trigger fast failover */ |
---|
.. | .. |
---|
2274 | 2340 | new_fcf_record, LPFC_FCOE_IGNORE_VID)) { |
---|
2275 | 2341 | if (bf_get(lpfc_fcf_record_fcf_index, new_fcf_record) != |
---|
2276 | 2342 | phba->fcf.current_rec.fcf_indx) { |
---|
2277 | | - lpfc_printf_log(phba, KERN_ERR, LOG_FIP, |
---|
| 2343 | + lpfc_printf_log(phba, KERN_ERR, |
---|
| 2344 | + LOG_TRACE_EVENT, |
---|
2278 | 2345 | "2862 FCF (x%x) matches property " |
---|
2279 | 2346 | "of in-use FCF (x%x)\n", |
---|
2280 | 2347 | bf_get(lpfc_fcf_record_fcf_index, |
---|
.. | .. |
---|
2344 | 2411 | phba->pport->fc_flag); |
---|
2345 | 2412 | goto out; |
---|
2346 | 2413 | } else |
---|
2347 | | - lpfc_printf_log(phba, KERN_ERR, LOG_FIP, |
---|
| 2414 | + lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, |
---|
2348 | 2415 | "2863 New FCF (x%x) matches " |
---|
2349 | 2416 | "property of in-use FCF (x%x)\n", |
---|
2350 | 2417 | bf_get(lpfc_fcf_record_fcf_index, |
---|
.. | .. |
---|
2758 | 2825 | (bf_get(lpfc_sli_intf_if_type, &phba->sli4_hba.sli_intf) != |
---|
2759 | 2826 | LPFC_SLI_INTF_IF_TYPE_0) && |
---|
2760 | 2827 | mboxq->u.mb.mbxStatus != MBX_VFI_IN_USE) { |
---|
2761 | | - lpfc_printf_vlog(vport, KERN_ERR, |
---|
2762 | | - LOG_MBOX, |
---|
2763 | | - "2891 Init VFI mailbox failed 0x%x\n", |
---|
2764 | | - mboxq->u.mb.mbxStatus); |
---|
| 2828 | + lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT, |
---|
| 2829 | + "2891 Init VFI mailbox failed 0x%x\n", |
---|
| 2830 | + mboxq->u.mb.mbxStatus); |
---|
2765 | 2831 | mempool_free(mboxq, phba->mbox_mem_pool); |
---|
2766 | 2832 | lpfc_vport_set_state(vport, FC_VPORT_FAILED); |
---|
2767 | 2833 | return; |
---|
.. | .. |
---|
2789 | 2855 | mboxq = mempool_alloc(phba->mbox_mem_pool, GFP_KERNEL); |
---|
2790 | 2856 | if (!mboxq) { |
---|
2791 | 2857 | lpfc_printf_vlog(vport, KERN_ERR, |
---|
2792 | | - LOG_MBOX, "2892 Failed to allocate " |
---|
| 2858 | + LOG_TRACE_EVENT, "2892 Failed to allocate " |
---|
2793 | 2859 | "init_vfi mailbox\n"); |
---|
2794 | 2860 | return; |
---|
2795 | 2861 | } |
---|
.. | .. |
---|
2797 | 2863 | mboxq->mbox_cmpl = lpfc_init_vfi_cmpl; |
---|
2798 | 2864 | rc = lpfc_sli_issue_mbox(phba, mboxq, MBX_NOWAIT); |
---|
2799 | 2865 | if (rc == MBX_NOT_FINISHED) { |
---|
2800 | | - lpfc_printf_vlog(vport, KERN_ERR, |
---|
2801 | | - LOG_MBOX, "2893 Failed to issue init_vfi mailbox\n"); |
---|
| 2866 | + lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT, |
---|
| 2867 | + "2893 Failed to issue init_vfi mailbox\n"); |
---|
2802 | 2868 | mempool_free(mboxq, vport->phba->mbox_mem_pool); |
---|
2803 | 2869 | } |
---|
2804 | 2870 | } |
---|
.. | .. |
---|
2818 | 2884 | struct Scsi_Host *shost = lpfc_shost_from_vport(vport); |
---|
2819 | 2885 | |
---|
2820 | 2886 | if (mboxq->u.mb.mbxStatus) { |
---|
2821 | | - lpfc_printf_vlog(vport, KERN_ERR, |
---|
2822 | | - LOG_MBOX, |
---|
2823 | | - "2609 Init VPI mailbox failed 0x%x\n", |
---|
2824 | | - mboxq->u.mb.mbxStatus); |
---|
| 2887 | + lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT, |
---|
| 2888 | + "2609 Init VPI mailbox failed 0x%x\n", |
---|
| 2889 | + mboxq->u.mb.mbxStatus); |
---|
2825 | 2890 | mempool_free(mboxq, phba->mbox_mem_pool); |
---|
2826 | 2891 | lpfc_vport_set_state(vport, FC_VPORT_FAILED); |
---|
2827 | 2892 | return; |
---|
.. | .. |
---|
2835 | 2900 | ndlp = lpfc_findnode_did(vport, Fabric_DID); |
---|
2836 | 2901 | if (!ndlp) |
---|
2837 | 2902 | lpfc_printf_vlog(vport, KERN_ERR, |
---|
2838 | | - LOG_DISCOVERY, |
---|
| 2903 | + LOG_TRACE_EVENT, |
---|
2839 | 2904 | "2731 Cannot find fabric " |
---|
2840 | 2905 | "controller node\n"); |
---|
2841 | 2906 | else |
---|
.. | .. |
---|
2848 | 2913 | lpfc_initial_fdisc(vport); |
---|
2849 | 2914 | else { |
---|
2850 | 2915 | lpfc_vport_set_state(vport, FC_VPORT_NO_FABRIC_SUPP); |
---|
2851 | | - lpfc_printf_vlog(vport, KERN_ERR, LOG_ELS, |
---|
| 2916 | + lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT, |
---|
2852 | 2917 | "2606 No NPIV Fabric support\n"); |
---|
2853 | 2918 | } |
---|
2854 | 2919 | mempool_free(mboxq, phba->mbox_mem_pool); |
---|
.. | .. |
---|
2871 | 2936 | if ((vport->port_type != LPFC_PHYSICAL_PORT) && (!vport->vpi)) { |
---|
2872 | 2937 | vpi = lpfc_alloc_vpi(vport->phba); |
---|
2873 | 2938 | if (!vpi) { |
---|
2874 | | - lpfc_printf_vlog(vport, KERN_ERR, |
---|
2875 | | - LOG_MBOX, |
---|
| 2939 | + lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT, |
---|
2876 | 2940 | "3303 Failed to obtain vport vpi\n"); |
---|
2877 | 2941 | lpfc_vport_set_state(vport, FC_VPORT_FAILED); |
---|
2878 | 2942 | return; |
---|
.. | .. |
---|
2883 | 2947 | mboxq = mempool_alloc(vport->phba->mbox_mem_pool, GFP_KERNEL); |
---|
2884 | 2948 | if (!mboxq) { |
---|
2885 | 2949 | lpfc_printf_vlog(vport, KERN_ERR, |
---|
2886 | | - LOG_MBOX, "2607 Failed to allocate " |
---|
| 2950 | + LOG_TRACE_EVENT, "2607 Failed to allocate " |
---|
2887 | 2951 | "init_vpi mailbox\n"); |
---|
2888 | 2952 | return; |
---|
2889 | 2953 | } |
---|
.. | .. |
---|
2892 | 2956 | mboxq->mbox_cmpl = lpfc_init_vpi_cmpl; |
---|
2893 | 2957 | rc = lpfc_sli_issue_mbox(vport->phba, mboxq, MBX_NOWAIT); |
---|
2894 | 2958 | if (rc == MBX_NOT_FINISHED) { |
---|
2895 | | - lpfc_printf_vlog(vport, KERN_ERR, |
---|
2896 | | - LOG_MBOX, "2608 Failed to issue init_vpi mailbox\n"); |
---|
| 2959 | + lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT, |
---|
| 2960 | + "2608 Failed to issue init_vpi mailbox\n"); |
---|
2897 | 2961 | mempool_free(mboxq, vport->phba->mbox_mem_pool); |
---|
2898 | 2962 | } |
---|
2899 | 2963 | } |
---|
.. | .. |
---|
2937 | 3001 | lpfc_vport_set_state(vports[i], |
---|
2938 | 3002 | FC_VPORT_NO_FABRIC_SUPP); |
---|
2939 | 3003 | lpfc_printf_vlog(vports[i], KERN_ERR, |
---|
2940 | | - LOG_ELS, |
---|
| 3004 | + LOG_TRACE_EVENT, |
---|
2941 | 3005 | "0259 No NPIV " |
---|
2942 | 3006 | "Fabric support\n"); |
---|
2943 | 3007 | } |
---|
.. | .. |
---|
2949 | 3013 | void |
---|
2950 | 3014 | lpfc_mbx_cmpl_reg_vfi(struct lpfc_hba *phba, LPFC_MBOXQ_t *mboxq) |
---|
2951 | 3015 | { |
---|
2952 | | - struct lpfc_dmabuf *dmabuf = mboxq->context1; |
---|
| 3016 | + struct lpfc_dmabuf *dmabuf = mboxq->ctx_buf; |
---|
2953 | 3017 | struct lpfc_vport *vport = mboxq->vport; |
---|
2954 | 3018 | struct Scsi_Host *shost = lpfc_shost_from_vport(vport); |
---|
2955 | 3019 | |
---|
.. | .. |
---|
2961 | 3025 | (bf_get(lpfc_sli_intf_if_type, &phba->sli4_hba.sli_intf) != |
---|
2962 | 3026 | LPFC_SLI_INTF_IF_TYPE_0) && |
---|
2963 | 3027 | mboxq->u.mb.mbxStatus != MBX_VFI_IN_USE) { |
---|
2964 | | - lpfc_printf_vlog(vport, KERN_ERR, LOG_MBOX, |
---|
2965 | | - "2018 REG_VFI mbxStatus error x%x " |
---|
2966 | | - "HBA state x%x\n", |
---|
2967 | | - mboxq->u.mb.mbxStatus, vport->port_state); |
---|
| 3028 | + lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT, |
---|
| 3029 | + "2018 REG_VFI mbxStatus error x%x " |
---|
| 3030 | + "HBA state x%x\n", |
---|
| 3031 | + mboxq->u.mb.mbxStatus, vport->port_state); |
---|
2968 | 3032 | if (phba->fc_topology == LPFC_TOPOLOGY_LOOP) { |
---|
2969 | 3033 | /* FLOGI failed, use loop map to make discovery list */ |
---|
2970 | 3034 | lpfc_disc_list_loopmap(vport); |
---|
.. | .. |
---|
3042 | 3106 | lpfc_mbx_cmpl_read_sparam(struct lpfc_hba *phba, LPFC_MBOXQ_t *pmb) |
---|
3043 | 3107 | { |
---|
3044 | 3108 | MAILBOX_t *mb = &pmb->u.mb; |
---|
3045 | | - struct lpfc_dmabuf *mp = (struct lpfc_dmabuf *) pmb->context1; |
---|
| 3109 | + struct lpfc_dmabuf *mp = (struct lpfc_dmabuf *)pmb->ctx_buf; |
---|
3046 | 3110 | struct lpfc_vport *vport = pmb->vport; |
---|
3047 | 3111 | struct Scsi_Host *shost = lpfc_shost_from_vport(vport); |
---|
3048 | 3112 | struct serv_parm *sp = &vport->fc_sparam; |
---|
.. | .. |
---|
3051 | 3115 | /* Check for error */ |
---|
3052 | 3116 | if (mb->mbxStatus) { |
---|
3053 | 3117 | /* READ_SPARAM mbox error <mbxStatus> state <hba_state> */ |
---|
3054 | | - lpfc_printf_vlog(vport, KERN_ERR, LOG_MBOX, |
---|
| 3118 | + lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT, |
---|
3055 | 3119 | "0319 READ_SPARAM mbxStatus error x%x " |
---|
3056 | 3120 | "hba state x%x>\n", |
---|
3057 | 3121 | mb->mbxStatus, vport->port_state); |
---|
.. | .. |
---|
3083 | 3147 | lpfc_mbuf_free(phba, mp->virt, mp->phys); |
---|
3084 | 3148 | kfree(mp); |
---|
3085 | 3149 | mempool_free(pmb, phba->mbox_mem_pool); |
---|
| 3150 | + |
---|
| 3151 | + /* Check if sending the FLOGI is being deferred to after we get |
---|
| 3152 | + * up to date CSPs from MBX_READ_SPARAM. |
---|
| 3153 | + */ |
---|
| 3154 | + if (phba->hba_flag & HBA_DEFER_FLOGI) { |
---|
| 3155 | + lpfc_initial_flogi(vport); |
---|
| 3156 | + phba->hba_flag &= ~HBA_DEFER_FLOGI; |
---|
| 3157 | + } |
---|
3086 | 3158 | return; |
---|
3087 | 3159 | |
---|
3088 | 3160 | out: |
---|
3089 | | - pmb->context1 = NULL; |
---|
| 3161 | + pmb->ctx_buf = NULL; |
---|
3090 | 3162 | lpfc_mbuf_free(phba, mp->virt, mp->phys); |
---|
3091 | 3163 | kfree(mp); |
---|
3092 | 3164 | lpfc_issue_clear_la(phba, vport); |
---|
.. | .. |
---|
3105 | 3177 | int rc; |
---|
3106 | 3178 | struct fcf_record *fcf_record; |
---|
3107 | 3179 | uint32_t fc_flags = 0; |
---|
| 3180 | + unsigned long iflags; |
---|
3108 | 3181 | |
---|
3109 | | - spin_lock_irq(&phba->hbalock); |
---|
| 3182 | + spin_lock_irqsave(&phba->hbalock, iflags); |
---|
3110 | 3183 | phba->fc_linkspeed = bf_get(lpfc_mbx_read_top_link_spd, la); |
---|
3111 | 3184 | |
---|
3112 | 3185 | if (!(phba->hba_flag & HBA_FCOE_MODE)) { |
---|
.. | .. |
---|
3119 | 3192 | case LPFC_LINK_SPEED_16GHZ: |
---|
3120 | 3193 | case LPFC_LINK_SPEED_32GHZ: |
---|
3121 | 3194 | case LPFC_LINK_SPEED_64GHZ: |
---|
| 3195 | + case LPFC_LINK_SPEED_128GHZ: |
---|
3122 | 3196 | break; |
---|
3123 | 3197 | default: |
---|
3124 | 3198 | phba->fc_linkspeed = LPFC_LINK_SPEED_UNKNOWN; |
---|
.. | .. |
---|
3202 | 3276 | vport->fc_myDID = phba->fc_pref_DID; |
---|
3203 | 3277 | fc_flags |= FC_LBIT; |
---|
3204 | 3278 | } |
---|
3205 | | - spin_unlock_irq(&phba->hbalock); |
---|
| 3279 | + spin_unlock_irqrestore(&phba->hbalock, iflags); |
---|
3206 | 3280 | |
---|
3207 | 3281 | if (fc_flags) { |
---|
3208 | | - spin_lock_irq(shost->host_lock); |
---|
| 3282 | + spin_lock_irqsave(shost->host_lock, iflags); |
---|
3209 | 3283 | vport->fc_flag |= fc_flags; |
---|
3210 | | - spin_unlock_irq(shost->host_lock); |
---|
| 3284 | + spin_unlock_irqrestore(shost->host_lock, iflags); |
---|
3211 | 3285 | } |
---|
3212 | 3286 | |
---|
3213 | 3287 | lpfc_linkup(phba); |
---|
| 3288 | + sparam_mbox = NULL; |
---|
| 3289 | + |
---|
3214 | 3290 | sparam_mbox = mempool_alloc(phba->mbox_mem_pool, GFP_KERNEL); |
---|
3215 | 3291 | if (!sparam_mbox) |
---|
3216 | 3292 | goto out; |
---|
.. | .. |
---|
3224 | 3300 | sparam_mbox->mbox_cmpl = lpfc_mbx_cmpl_read_sparam; |
---|
3225 | 3301 | rc = lpfc_sli_issue_mbox(phba, sparam_mbox, MBX_NOWAIT); |
---|
3226 | 3302 | if (rc == MBX_NOT_FINISHED) { |
---|
3227 | | - mp = (struct lpfc_dmabuf *) sparam_mbox->context1; |
---|
| 3303 | + mp = (struct lpfc_dmabuf *)sparam_mbox->ctx_buf; |
---|
3228 | 3304 | lpfc_mbuf_free(phba, mp->virt, mp->phys); |
---|
3229 | 3305 | kfree(mp); |
---|
3230 | 3306 | mempool_free(sparam_mbox, phba->mbox_mem_pool); |
---|
.. | .. |
---|
3256 | 3332 | GFP_KERNEL); |
---|
3257 | 3333 | if (unlikely(!fcf_record)) { |
---|
3258 | 3334 | lpfc_printf_log(phba, KERN_ERR, |
---|
3259 | | - LOG_MBOX | LOG_SLI, |
---|
| 3335 | + LOG_TRACE_EVENT, |
---|
3260 | 3336 | "2554 Could not allocate memory for " |
---|
3261 | 3337 | "fcf record\n"); |
---|
3262 | 3338 | rc = -ENODEV; |
---|
.. | .. |
---|
3268 | 3344 | rc = lpfc_sli4_add_fcf_record(phba, fcf_record); |
---|
3269 | 3345 | if (unlikely(rc)) { |
---|
3270 | 3346 | lpfc_printf_log(phba, KERN_ERR, |
---|
3271 | | - LOG_MBOX | LOG_SLI, |
---|
| 3347 | + LOG_TRACE_EVENT, |
---|
3272 | 3348 | "2013 Could not manually add FCF " |
---|
3273 | 3349 | "record 0, status %d\n", rc); |
---|
3274 | 3350 | rc = -ENODEV; |
---|
.. | .. |
---|
3281 | 3357 | * The driver is expected to do FIP/FCF. Call the port |
---|
3282 | 3358 | * and get the FCF Table. |
---|
3283 | 3359 | */ |
---|
3284 | | - spin_lock_irq(&phba->hbalock); |
---|
| 3360 | + spin_lock_irqsave(&phba->hbalock, iflags); |
---|
3285 | 3361 | if (phba->hba_flag & FCF_TS_INPROG) { |
---|
3286 | | - spin_unlock_irq(&phba->hbalock); |
---|
| 3362 | + spin_unlock_irqrestore(&phba->hbalock, iflags); |
---|
3287 | 3363 | return; |
---|
3288 | 3364 | } |
---|
3289 | 3365 | /* This is the initial FCF discovery scan */ |
---|
3290 | 3366 | phba->fcf.fcf_flag |= FCF_INIT_DISC; |
---|
3291 | | - spin_unlock_irq(&phba->hbalock); |
---|
| 3367 | + spin_unlock_irqrestore(&phba->hbalock, iflags); |
---|
3292 | 3368 | lpfc_printf_log(phba, KERN_INFO, LOG_FIP | LOG_DISCOVERY, |
---|
3293 | 3369 | "2778 Start FCF table scan at linkup\n"); |
---|
3294 | 3370 | rc = lpfc_sli4_fcf_scan_read_fcf_rec(phba, |
---|
3295 | 3371 | LPFC_FCOE_FCF_GET_FIRST); |
---|
3296 | 3372 | if (rc) { |
---|
3297 | | - spin_lock_irq(&phba->hbalock); |
---|
| 3373 | + spin_lock_irqsave(&phba->hbalock, iflags); |
---|
3298 | 3374 | phba->fcf.fcf_flag &= ~FCF_INIT_DISC; |
---|
3299 | | - spin_unlock_irq(&phba->hbalock); |
---|
| 3375 | + spin_unlock_irqrestore(&phba->hbalock, iflags); |
---|
3300 | 3376 | goto out; |
---|
3301 | 3377 | } |
---|
3302 | 3378 | /* Reset FCF roundrobin bmask for new discovery */ |
---|
3303 | 3379 | lpfc_sli4_clear_fcf_rr_bmask(phba); |
---|
3304 | 3380 | } |
---|
3305 | 3381 | |
---|
| 3382 | + /* Prepare for LINK up registrations */ |
---|
| 3383 | + memset(phba->os_host_name, 0, sizeof(phba->os_host_name)); |
---|
| 3384 | + scnprintf(phba->os_host_name, sizeof(phba->os_host_name), "%s", |
---|
| 3385 | + init_utsname()->nodename); |
---|
3306 | 3386 | return; |
---|
3307 | 3387 | out: |
---|
3308 | 3388 | lpfc_vport_set_state(vport, FC_VPORT_FAILED); |
---|
3309 | | - lpfc_printf_vlog(vport, KERN_ERR, LOG_MBOX, |
---|
3310 | | - "0263 Discovery Mailbox error: state: 0x%x : %p %p\n", |
---|
| 3389 | + lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT, |
---|
| 3390 | + "0263 Discovery Mailbox error: state: 0x%x : x%px x%px\n", |
---|
3311 | 3391 | vport->port_state, sparam_mbox, cfglink_mbox); |
---|
3312 | 3392 | lpfc_issue_clear_la(phba, vport); |
---|
3313 | 3393 | return; |
---|
.. | .. |
---|
3353 | 3433 | struct lpfc_mbx_read_top *la; |
---|
3354 | 3434 | struct lpfc_sli_ring *pring; |
---|
3355 | 3435 | MAILBOX_t *mb = &pmb->u.mb; |
---|
3356 | | - struct lpfc_dmabuf *mp = (struct lpfc_dmabuf *) (pmb->context1); |
---|
| 3436 | + struct lpfc_dmabuf *mp = (struct lpfc_dmabuf *)(pmb->ctx_buf); |
---|
3357 | 3437 | uint8_t attn_type; |
---|
| 3438 | + unsigned long iflags; |
---|
3358 | 3439 | |
---|
3359 | 3440 | /* Unblock ELS traffic */ |
---|
3360 | 3441 | pring = lpfc_phba_elsring(phba); |
---|
.. | .. |
---|
3376 | 3457 | |
---|
3377 | 3458 | memcpy(&phba->alpa_map[0], mp->virt, 128); |
---|
3378 | 3459 | |
---|
3379 | | - spin_lock_irq(shost->host_lock); |
---|
| 3460 | + spin_lock_irqsave(shost->host_lock, iflags); |
---|
3380 | 3461 | if (bf_get(lpfc_mbx_read_top_pb, la)) |
---|
3381 | 3462 | vport->fc_flag |= FC_BYPASSED_MODE; |
---|
3382 | 3463 | else |
---|
3383 | 3464 | vport->fc_flag &= ~FC_BYPASSED_MODE; |
---|
3384 | | - spin_unlock_irq(shost->host_lock); |
---|
| 3465 | + spin_unlock_irqrestore(shost->host_lock, iflags); |
---|
3385 | 3466 | |
---|
3386 | 3467 | if (phba->fc_eventTag <= la->eventTag) { |
---|
3387 | 3468 | phba->fc_stat.LinkMultiEvent++; |
---|
.. | .. |
---|
3392 | 3473 | |
---|
3393 | 3474 | phba->fc_eventTag = la->eventTag; |
---|
3394 | 3475 | if (phba->sli_rev < LPFC_SLI_REV4) { |
---|
3395 | | - spin_lock_irq(&phba->hbalock); |
---|
| 3476 | + spin_lock_irqsave(&phba->hbalock, iflags); |
---|
3396 | 3477 | if (bf_get(lpfc_mbx_read_top_mm, la)) |
---|
3397 | 3478 | phba->sli.sli_flag |= LPFC_MENLO_MAINT; |
---|
3398 | 3479 | else |
---|
3399 | 3480 | phba->sli.sli_flag &= ~LPFC_MENLO_MAINT; |
---|
3400 | | - spin_unlock_irq(&phba->hbalock); |
---|
| 3481 | + spin_unlock_irqrestore(&phba->hbalock, iflags); |
---|
3401 | 3482 | } |
---|
3402 | 3483 | |
---|
3403 | 3484 | phba->link_events++; |
---|
.. | .. |
---|
3439 | 3520 | phba->pport->port_state, vport->fc_flag); |
---|
3440 | 3521 | else if (attn_type == LPFC_ATT_UNEXP_WWPN) |
---|
3441 | 3522 | lpfc_printf_log(phba, KERN_ERR, LOG_LINK_EVENT, |
---|
3442 | | - "1313 Link Down UNEXP WWPN Event x%x received " |
---|
3443 | | - "Data: x%x x%x x%x x%x x%x\n", |
---|
| 3523 | + "1313 Link Down Unexpected FA WWPN Event x%x " |
---|
| 3524 | + "received Data: x%x x%x x%x x%x x%x\n", |
---|
3444 | 3525 | la->eventTag, phba->fc_eventTag, |
---|
3445 | 3526 | phba->pport->port_state, vport->fc_flag, |
---|
3446 | 3527 | bf_get(lpfc_mbx_read_top_mm, la), |
---|
.. | .. |
---|
3510 | 3591 | lpfc_mbx_cmpl_reg_login(struct lpfc_hba *phba, LPFC_MBOXQ_t *pmb) |
---|
3511 | 3592 | { |
---|
3512 | 3593 | struct lpfc_vport *vport = pmb->vport; |
---|
3513 | | - struct lpfc_dmabuf *mp = (struct lpfc_dmabuf *) (pmb->context1); |
---|
3514 | | - struct lpfc_nodelist *ndlp = (struct lpfc_nodelist *) pmb->context2; |
---|
| 3594 | + struct lpfc_dmabuf *mp = (struct lpfc_dmabuf *)(pmb->ctx_buf); |
---|
| 3595 | + struct lpfc_nodelist *ndlp = (struct lpfc_nodelist *)pmb->ctx_ndlp; |
---|
3515 | 3596 | struct Scsi_Host *shost = lpfc_shost_from_vport(vport); |
---|
3516 | 3597 | |
---|
3517 | | - pmb->context1 = NULL; |
---|
3518 | | - pmb->context2 = NULL; |
---|
| 3598 | + pmb->ctx_buf = NULL; |
---|
| 3599 | + pmb->ctx_ndlp = NULL; |
---|
3519 | 3600 | |
---|
3520 | 3601 | lpfc_printf_vlog(vport, KERN_INFO, LOG_SLI, |
---|
3521 | | - "0002 rpi:%x DID:%x flg:%x %d map:%x %p\n", |
---|
| 3602 | + "0002 rpi:%x DID:%x flg:%x %d map:%x x%px\n", |
---|
3522 | 3603 | ndlp->nlp_rpi, ndlp->nlp_DID, ndlp->nlp_flag, |
---|
3523 | 3604 | kref_read(&ndlp->kref), |
---|
3524 | 3605 | ndlp->nlp_usg_map, ndlp); |
---|
.. | .. |
---|
3578 | 3659 | break; |
---|
3579 | 3660 | /* If VPI is busy, reset the HBA */ |
---|
3580 | 3661 | case 0x9700: |
---|
3581 | | - lpfc_printf_vlog(vport, KERN_ERR, LOG_NODE, |
---|
| 3662 | + lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT, |
---|
3582 | 3663 | "2798 Unreg_vpi failed vpi 0x%x, mb status = 0x%x\n", |
---|
3583 | 3664 | vport->vpi, mb->mbxStatus); |
---|
3584 | 3665 | if (!(phba->pport->load_flag & FC_UNLOADING)) |
---|
.. | .. |
---|
3616 | 3697 | mbox->mbox_cmpl = lpfc_mbx_cmpl_unreg_vpi; |
---|
3617 | 3698 | rc = lpfc_sli_issue_mbox(phba, mbox, MBX_NOWAIT); |
---|
3618 | 3699 | if (rc == MBX_NOT_FINISHED) { |
---|
3619 | | - lpfc_printf_vlog(vport, KERN_ERR, LOG_MBOX | LOG_VPORT, |
---|
| 3700 | + lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT, |
---|
3620 | 3701 | "1800 Could not issue unreg_vpi\n"); |
---|
3621 | 3702 | mempool_free(mbox, phba->mbox_mem_pool); |
---|
3622 | 3703 | vport->unreg_vpi_cmpl = VPORT_ERROR; |
---|
.. | .. |
---|
3645 | 3726 | spin_unlock_irq(shost->host_lock); |
---|
3646 | 3727 | vport->fc_myDID = 0; |
---|
3647 | 3728 | |
---|
3648 | | - if ((phba->cfg_enable_fc4_type == LPFC_ENABLE_BOTH) || |
---|
3649 | | - (phba->cfg_enable_fc4_type == LPFC_ENABLE_NVME)) { |
---|
| 3729 | + if ((vport->cfg_enable_fc4_type == LPFC_ENABLE_BOTH) || |
---|
| 3730 | + (vport->cfg_enable_fc4_type == LPFC_ENABLE_NVME)) { |
---|
3650 | 3731 | if (phba->nvmet_support) |
---|
3651 | 3732 | lpfc_nvmet_update_targetport(phba); |
---|
3652 | 3733 | else |
---|
.. | .. |
---|
3703 | 3784 | |
---|
3704 | 3785 | pmb = mempool_alloc(phba->mbox_mem_pool, GFP_KERNEL); |
---|
3705 | 3786 | if (!pmb) { |
---|
3706 | | - lpfc_printf_log(phba, KERN_ERR, LOG_INIT, |
---|
| 3787 | + lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, |
---|
3707 | 3788 | "0542 lpfc_create_static_vport failed to" |
---|
3708 | 3789 | " allocate mailbox memory\n"); |
---|
3709 | 3790 | return; |
---|
.. | .. |
---|
3713 | 3794 | |
---|
3714 | 3795 | vport_info = kzalloc(sizeof(struct static_vport_info), GFP_KERNEL); |
---|
3715 | 3796 | if (!vport_info) { |
---|
3716 | | - lpfc_printf_log(phba, KERN_ERR, LOG_INIT, |
---|
| 3797 | + lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, |
---|
3717 | 3798 | "0543 lpfc_create_static_vport failed to" |
---|
3718 | 3799 | " allocate vport_info\n"); |
---|
3719 | 3800 | mempool_free(pmb, phba->mbox_mem_pool); |
---|
.. | .. |
---|
3723 | 3804 | vport_buff = (uint8_t *) vport_info; |
---|
3724 | 3805 | do { |
---|
3725 | 3806 | /* free dma buffer from previous round */ |
---|
3726 | | - if (pmb->context1) { |
---|
3727 | | - mp = (struct lpfc_dmabuf *)pmb->context1; |
---|
| 3807 | + if (pmb->ctx_buf) { |
---|
| 3808 | + mp = (struct lpfc_dmabuf *)pmb->ctx_buf; |
---|
3728 | 3809 | lpfc_mbuf_free(phba, mp->virt, mp->phys); |
---|
3729 | 3810 | kfree(mp); |
---|
3730 | 3811 | } |
---|
.. | .. |
---|
3746 | 3827 | |
---|
3747 | 3828 | if (phba->sli_rev == LPFC_SLI_REV4) { |
---|
3748 | 3829 | byte_count = pmb->u.mqe.un.mb_words[5]; |
---|
3749 | | - mp = (struct lpfc_dmabuf *)pmb->context1; |
---|
| 3830 | + mp = (struct lpfc_dmabuf *)pmb->ctx_buf; |
---|
3750 | 3831 | if (byte_count > sizeof(struct static_vport_info) - |
---|
3751 | 3832 | offset) |
---|
3752 | 3833 | byte_count = sizeof(struct static_vport_info) |
---|
.. | .. |
---|
3774 | 3855 | if ((le32_to_cpu(vport_info->signature) != VPORT_INFO_SIG) || |
---|
3775 | 3856 | ((le32_to_cpu(vport_info->rev) & VPORT_INFO_REV_MASK) |
---|
3776 | 3857 | != VPORT_INFO_REV)) { |
---|
3777 | | - lpfc_printf_log(phba, KERN_ERR, LOG_INIT, |
---|
3778 | | - "0545 lpfc_create_static_vport bad" |
---|
3779 | | - " information header 0x%x 0x%x\n", |
---|
3780 | | - le32_to_cpu(vport_info->signature), |
---|
3781 | | - le32_to_cpu(vport_info->rev) & VPORT_INFO_REV_MASK); |
---|
| 3858 | + lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, |
---|
| 3859 | + "0545 lpfc_create_static_vport bad" |
---|
| 3860 | + " information header 0x%x 0x%x\n", |
---|
| 3861 | + le32_to_cpu(vport_info->signature), |
---|
| 3862 | + le32_to_cpu(vport_info->rev) & |
---|
| 3863 | + VPORT_INFO_REV_MASK); |
---|
3782 | 3864 | |
---|
3783 | 3865 | goto out; |
---|
3784 | 3866 | } |
---|
.. | .. |
---|
3811 | 3893 | out: |
---|
3812 | 3894 | kfree(vport_info); |
---|
3813 | 3895 | if (mbx_wait_rc != MBX_TIMEOUT) { |
---|
3814 | | - if (pmb->context1) { |
---|
3815 | | - mp = (struct lpfc_dmabuf *)pmb->context1; |
---|
| 3896 | + if (pmb->ctx_buf) { |
---|
| 3897 | + mp = (struct lpfc_dmabuf *)pmb->ctx_buf; |
---|
3816 | 3898 | lpfc_mbuf_free(phba, mp->virt, mp->phys); |
---|
3817 | 3899 | kfree(mp); |
---|
3818 | 3900 | } |
---|
.. | .. |
---|
3833 | 3915 | { |
---|
3834 | 3916 | struct lpfc_vport *vport = pmb->vport; |
---|
3835 | 3917 | MAILBOX_t *mb = &pmb->u.mb; |
---|
3836 | | - struct lpfc_dmabuf *mp = (struct lpfc_dmabuf *) (pmb->context1); |
---|
| 3918 | + struct lpfc_dmabuf *mp = (struct lpfc_dmabuf *)(pmb->ctx_buf); |
---|
3837 | 3919 | struct lpfc_nodelist *ndlp; |
---|
3838 | 3920 | struct Scsi_Host *shost; |
---|
3839 | 3921 | |
---|
3840 | | - ndlp = (struct lpfc_nodelist *) pmb->context2; |
---|
3841 | | - pmb->context1 = NULL; |
---|
3842 | | - pmb->context2 = NULL; |
---|
| 3922 | + ndlp = (struct lpfc_nodelist *)pmb->ctx_ndlp; |
---|
| 3923 | + pmb->ctx_ndlp = NULL; |
---|
| 3924 | + pmb->ctx_buf = NULL; |
---|
3843 | 3925 | |
---|
3844 | 3926 | if (mb->mbxStatus) { |
---|
3845 | | - lpfc_printf_vlog(vport, KERN_ERR, LOG_MBOX, |
---|
| 3927 | + lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT, |
---|
3846 | 3928 | "0258 Register Fabric login error: 0x%x\n", |
---|
3847 | 3929 | mb->mbxStatus); |
---|
3848 | 3930 | lpfc_mbuf_free(phba, mp->virt, mp->phys); |
---|
.. | .. |
---|
3908 | 3990 | int |
---|
3909 | 3991 | lpfc_issue_gidft(struct lpfc_vport *vport) |
---|
3910 | 3992 | { |
---|
3911 | | - struct lpfc_hba *phba = vport->phba; |
---|
3912 | | - |
---|
3913 | 3993 | /* Good status, issue CT Request to NameServer */ |
---|
3914 | | - if ((phba->cfg_enable_fc4_type == LPFC_ENABLE_BOTH) || |
---|
3915 | | - (phba->cfg_enable_fc4_type == LPFC_ENABLE_FCP)) { |
---|
| 3994 | + if ((vport->cfg_enable_fc4_type == LPFC_ENABLE_BOTH) || |
---|
| 3995 | + (vport->cfg_enable_fc4_type == LPFC_ENABLE_FCP)) { |
---|
3916 | 3996 | if (lpfc_ns_cmd(vport, SLI_CTNS_GID_FT, 0, SLI_CTPT_FCP)) { |
---|
3917 | 3997 | /* Cannot issue NameServer FCP Query, so finish up |
---|
3918 | 3998 | * discovery |
---|
3919 | 3999 | */ |
---|
3920 | | - lpfc_printf_vlog(vport, KERN_ERR, LOG_SLI, |
---|
| 4000 | + lpfc_printf_vlog(vport, KERN_ERR, |
---|
| 4001 | + LOG_TRACE_EVENT, |
---|
3921 | 4002 | "0604 %s FC TYPE %x %s\n", |
---|
3922 | 4003 | "Failed to issue GID_FT to ", |
---|
3923 | 4004 | FC_TYPE_FCP, |
---|
.. | .. |
---|
3927 | 4008 | vport->gidft_inp++; |
---|
3928 | 4009 | } |
---|
3929 | 4010 | |
---|
3930 | | - if ((phba->cfg_enable_fc4_type == LPFC_ENABLE_BOTH) || |
---|
3931 | | - (phba->cfg_enable_fc4_type == LPFC_ENABLE_NVME)) { |
---|
| 4011 | + if ((vport->cfg_enable_fc4_type == LPFC_ENABLE_BOTH) || |
---|
| 4012 | + (vport->cfg_enable_fc4_type == LPFC_ENABLE_NVME)) { |
---|
3932 | 4013 | if (lpfc_ns_cmd(vport, SLI_CTNS_GID_FT, 0, SLI_CTPT_NVME)) { |
---|
3933 | 4014 | /* Cannot issue NameServer NVME Query, so finish up |
---|
3934 | 4015 | * discovery |
---|
3935 | 4016 | */ |
---|
3936 | | - lpfc_printf_vlog(vport, KERN_ERR, LOG_SLI, |
---|
| 4017 | + lpfc_printf_vlog(vport, KERN_ERR, |
---|
| 4018 | + LOG_TRACE_EVENT, |
---|
3937 | 4019 | "0605 %s FC_TYPE %x %s %d\n", |
---|
3938 | 4020 | "Failed to issue GID_FT to ", |
---|
3939 | 4021 | FC_TYPE_NVME, |
---|
.. | .. |
---|
3947 | 4029 | return vport->gidft_inp; |
---|
3948 | 4030 | } |
---|
3949 | 4031 | |
---|
| 4032 | +/** |
---|
| 4033 | + * lpfc_issue_gidpt - issue a GID_PT for all N_Ports |
---|
| 4034 | + * @vport: The virtual port for which this call is being executed. |
---|
| 4035 | + * |
---|
| 4036 | + * This routine will issue a GID_PT to get a list of all N_Ports |
---|
| 4037 | + * |
---|
| 4038 | + * Return value : |
---|
| 4039 | + * 0 - Failure to issue a GID_PT |
---|
| 4040 | + * 1 - GID_PT issued |
---|
| 4041 | + **/ |
---|
| 4042 | +int |
---|
| 4043 | +lpfc_issue_gidpt(struct lpfc_vport *vport) |
---|
| 4044 | +{ |
---|
| 4045 | + /* Good status, issue CT Request to NameServer */ |
---|
| 4046 | + if (lpfc_ns_cmd(vport, SLI_CTNS_GID_PT, 0, GID_PT_N_PORT)) { |
---|
| 4047 | + /* Cannot issue NameServer FCP Query, so finish up |
---|
| 4048 | + * discovery |
---|
| 4049 | + */ |
---|
| 4050 | + lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT, |
---|
| 4051 | + "0606 %s Port TYPE %x %s\n", |
---|
| 4052 | + "Failed to issue GID_PT to ", |
---|
| 4053 | + GID_PT_N_PORT, |
---|
| 4054 | + "Finishing discovery."); |
---|
| 4055 | + return 0; |
---|
| 4056 | + } |
---|
| 4057 | + vport->gidft_inp++; |
---|
| 4058 | + return 1; |
---|
| 4059 | +} |
---|
| 4060 | + |
---|
3950 | 4061 | /* |
---|
3951 | 4062 | * This routine handles processing a NameServer REG_LOGIN mailbox |
---|
3952 | 4063 | * command upon completion. It is setup in the LPFC_MBOXQ |
---|
.. | .. |
---|
3957 | 4068 | lpfc_mbx_cmpl_ns_reg_login(struct lpfc_hba *phba, LPFC_MBOXQ_t *pmb) |
---|
3958 | 4069 | { |
---|
3959 | 4070 | MAILBOX_t *mb = &pmb->u.mb; |
---|
3960 | | - struct lpfc_dmabuf *mp = (struct lpfc_dmabuf *) (pmb->context1); |
---|
3961 | | - struct lpfc_nodelist *ndlp = (struct lpfc_nodelist *) pmb->context2; |
---|
| 4071 | + struct lpfc_dmabuf *mp = (struct lpfc_dmabuf *)(pmb->ctx_buf); |
---|
| 4072 | + struct lpfc_nodelist *ndlp = (struct lpfc_nodelist *)pmb->ctx_ndlp; |
---|
3962 | 4073 | struct lpfc_vport *vport = pmb->vport; |
---|
3963 | 4074 | |
---|
3964 | | - pmb->context1 = NULL; |
---|
3965 | | - pmb->context2 = NULL; |
---|
| 4075 | + pmb->ctx_buf = NULL; |
---|
| 4076 | + pmb->ctx_ndlp = NULL; |
---|
3966 | 4077 | vport->gidft_inp = 0; |
---|
3967 | 4078 | |
---|
3968 | 4079 | if (mb->mbxStatus) { |
---|
3969 | | - lpfc_printf_vlog(vport, KERN_ERR, LOG_ELS, |
---|
| 4080 | + lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT, |
---|
3970 | 4081 | "0260 Register NameServer error: 0x%x\n", |
---|
3971 | 4082 | mb->mbxStatus); |
---|
3972 | 4083 | |
---|
.. | .. |
---|
4002 | 4113 | ndlp->nlp_flag |= NLP_RPI_REGISTERED; |
---|
4003 | 4114 | ndlp->nlp_type |= NLP_FABRIC; |
---|
4004 | 4115 | lpfc_nlp_set_state(vport, ndlp, NLP_STE_UNMAPPED_NODE); |
---|
4005 | | - lpfc_printf_vlog(vport, KERN_INFO, LOG_SLI, |
---|
4006 | | - "0003 rpi:%x DID:%x flg:%x %d map%x %p\n", |
---|
| 4116 | + lpfc_printf_vlog(vport, KERN_INFO, LOG_NODE | LOG_DISCOVERY, |
---|
| 4117 | + "0003 rpi:%x DID:%x flg:%x %d map%x x%px\n", |
---|
4007 | 4118 | ndlp->nlp_rpi, ndlp->nlp_DID, ndlp->nlp_flag, |
---|
4008 | 4119 | kref_read(&ndlp->kref), |
---|
4009 | 4120 | ndlp->nlp_usg_map, ndlp); |
---|
.. | .. |
---|
4015 | 4126 | lpfc_ns_cmd(vport, SLI_CTNS_RSPN_ID, 0, 0); |
---|
4016 | 4127 | lpfc_ns_cmd(vport, SLI_CTNS_RFT_ID, 0, 0); |
---|
4017 | 4128 | |
---|
4018 | | - if ((phba->cfg_enable_fc4_type == LPFC_ENABLE_BOTH) || |
---|
4019 | | - (phba->cfg_enable_fc4_type == LPFC_ENABLE_FCP)) |
---|
| 4129 | + if ((vport->cfg_enable_fc4_type == LPFC_ENABLE_BOTH) || |
---|
| 4130 | + (vport->cfg_enable_fc4_type == LPFC_ENABLE_FCP)) |
---|
4020 | 4131 | lpfc_ns_cmd(vport, SLI_CTNS_RFF_ID, 0, FC_TYPE_FCP); |
---|
4021 | 4132 | |
---|
4022 | | - if ((phba->cfg_enable_fc4_type == LPFC_ENABLE_BOTH) || |
---|
4023 | | - (phba->cfg_enable_fc4_type == LPFC_ENABLE_NVME)) |
---|
| 4133 | + if ((vport->cfg_enable_fc4_type == LPFC_ENABLE_BOTH) || |
---|
| 4134 | + (vport->cfg_enable_fc4_type == LPFC_ENABLE_NVME)) |
---|
4024 | 4135 | lpfc_ns_cmd(vport, SLI_CTNS_RFF_ID, 0, |
---|
4025 | 4136 | FC_TYPE_NVME); |
---|
4026 | 4137 | |
---|
4027 | 4138 | /* Issue SCR just before NameServer GID_FT Query */ |
---|
4028 | | - lpfc_issue_els_scr(vport, SCR_DID, 0); |
---|
| 4139 | + lpfc_issue_els_scr(vport, 0); |
---|
| 4140 | + |
---|
| 4141 | + lpfc_issue_els_rdf(vport, 0); |
---|
4029 | 4142 | } |
---|
4030 | 4143 | |
---|
4031 | 4144 | vport->fc_ns_retry = 0; |
---|
.. | .. |
---|
4056 | 4169 | struct fc_rport_identifiers rport_ids; |
---|
4057 | 4170 | struct lpfc_hba *phba = vport->phba; |
---|
4058 | 4171 | |
---|
4059 | | - if (phba->cfg_enable_fc4_type == LPFC_ENABLE_NVME) |
---|
| 4172 | + if (vport->cfg_enable_fc4_type == LPFC_ENABLE_NVME) |
---|
4060 | 4173 | return; |
---|
4061 | 4174 | |
---|
4062 | 4175 | /* Remote port has reappeared. Re-register w/ FC transport */ |
---|
.. | .. |
---|
4108 | 4221 | rdata->pnode = lpfc_nlp_get(ndlp); |
---|
4109 | 4222 | |
---|
4110 | 4223 | if (ndlp->nlp_type & NLP_FCP_TARGET) |
---|
4111 | | - rport_ids.roles |= FC_RPORT_ROLE_FCP_TARGET; |
---|
| 4224 | + rport_ids.roles |= FC_PORT_ROLE_FCP_TARGET; |
---|
4112 | 4225 | if (ndlp->nlp_type & NLP_FCP_INITIATOR) |
---|
4113 | | - rport_ids.roles |= FC_RPORT_ROLE_FCP_INITIATOR; |
---|
| 4226 | + rport_ids.roles |= FC_PORT_ROLE_FCP_INITIATOR; |
---|
| 4227 | + if (ndlp->nlp_type & NLP_NVME_INITIATOR) |
---|
| 4228 | + rport_ids.roles |= FC_PORT_ROLE_NVME_INITIATOR; |
---|
| 4229 | + if (ndlp->nlp_type & NLP_NVME_TARGET) |
---|
| 4230 | + rport_ids.roles |= FC_PORT_ROLE_NVME_TARGET; |
---|
| 4231 | + if (ndlp->nlp_type & NLP_NVME_DISCOVERY) |
---|
| 4232 | + rport_ids.roles |= FC_PORT_ROLE_NVME_DISCOVERY; |
---|
4114 | 4233 | |
---|
4115 | 4234 | if (rport_ids.roles != FC_RPORT_ROLE_UNKNOWN) |
---|
4116 | 4235 | fc_remote_port_rolechg(rport, rport_ids.roles); |
---|
4117 | 4236 | |
---|
4118 | 4237 | lpfc_printf_vlog(ndlp->vport, KERN_INFO, LOG_NODE, |
---|
4119 | | - "3183 rport register x%06x, rport %p role x%x\n", |
---|
| 4238 | + "3183 rport register x%06x, rport x%px role x%x\n", |
---|
4120 | 4239 | ndlp->nlp_DID, rport, rport_ids.roles); |
---|
4121 | 4240 | |
---|
4122 | 4241 | if ((rport->scsi_target_id != -1) && |
---|
.. | .. |
---|
4131 | 4250 | { |
---|
4132 | 4251 | struct fc_rport *rport = ndlp->rport; |
---|
4133 | 4252 | struct lpfc_vport *vport = ndlp->vport; |
---|
4134 | | - struct lpfc_hba *phba = vport->phba; |
---|
4135 | 4253 | |
---|
4136 | | - if (phba->cfg_enable_fc4_type == LPFC_ENABLE_NVME) |
---|
| 4254 | + if (vport->cfg_enable_fc4_type == LPFC_ENABLE_NVME) |
---|
4137 | 4255 | return; |
---|
4138 | 4256 | |
---|
4139 | 4257 | lpfc_debugfs_disc_trc(vport, LPFC_DISC_TRC_RPORT, |
---|
.. | .. |
---|
4141 | 4259 | ndlp->nlp_DID, ndlp->nlp_flag, ndlp->nlp_type); |
---|
4142 | 4260 | |
---|
4143 | 4261 | lpfc_printf_vlog(vport, KERN_INFO, LOG_NODE, |
---|
4144 | | - "3184 rport unregister x%06x, rport %p\n", |
---|
| 4262 | + "3184 rport unregister x%06x, rport x%px\n", |
---|
4145 | 4263 | ndlp->nlp_DID, rport); |
---|
4146 | 4264 | |
---|
4147 | 4265 | fc_remote_port_delete(rport); |
---|
.. | .. |
---|
4153 | 4271 | lpfc_nlp_counters(struct lpfc_vport *vport, int state, int count) |
---|
4154 | 4272 | { |
---|
4155 | 4273 | struct Scsi_Host *shost = lpfc_shost_from_vport(vport); |
---|
| 4274 | + unsigned long iflags; |
---|
4156 | 4275 | |
---|
4157 | | - spin_lock_irq(shost->host_lock); |
---|
| 4276 | + spin_lock_irqsave(shost->host_lock, iflags); |
---|
4158 | 4277 | switch (state) { |
---|
4159 | 4278 | case NLP_STE_UNUSED_NODE: |
---|
4160 | 4279 | vport->fc_unused_cnt += count; |
---|
.. | .. |
---|
4184 | 4303 | vport->fc_npr_cnt += count; |
---|
4185 | 4304 | break; |
---|
4186 | 4305 | } |
---|
4187 | | - spin_unlock_irq(shost->host_lock); |
---|
| 4306 | + spin_unlock_irqrestore(shost->host_lock, iflags); |
---|
4188 | 4307 | } |
---|
4189 | 4308 | |
---|
4190 | 4309 | static void |
---|
.. | .. |
---|
4270 | 4389 | GFP_KERNEL); |
---|
4271 | 4390 | |
---|
4272 | 4391 | if (!ndlp->lat_data) |
---|
4273 | | - lpfc_printf_vlog(vport, KERN_ERR, LOG_NODE, |
---|
| 4392 | + lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT, |
---|
4274 | 4393 | "0286 lpfc_nlp_state_cleanup failed to " |
---|
4275 | 4394 | "allocate statistical data buffer DID " |
---|
4276 | 4395 | "0x%x\n", ndlp->nlp_DID); |
---|
.. | .. |
---|
4410 | 4529 | INIT_LIST_HEAD(&ndlp->els_retry_evt.evt_listp); |
---|
4411 | 4530 | INIT_LIST_HEAD(&ndlp->dev_loss_evt.evt_listp); |
---|
4412 | 4531 | timer_setup(&ndlp->nlp_delayfunc, lpfc_els_retry_delay, 0); |
---|
| 4532 | + INIT_LIST_HEAD(&ndlp->recovery_evt.evt_listp); |
---|
| 4533 | + |
---|
4413 | 4534 | ndlp->nlp_DID = did; |
---|
4414 | 4535 | ndlp->vport = vport; |
---|
4415 | 4536 | ndlp->phba = vport->phba; |
---|
.. | .. |
---|
4419 | 4540 | NLP_INT_NODE_ACT(ndlp); |
---|
4420 | 4541 | atomic_set(&ndlp->cmd_pending, 0); |
---|
4421 | 4542 | ndlp->cmd_qdepth = vport->cfg_tgt_queue_depth; |
---|
| 4543 | + ndlp->nlp_defer_did = NLP_EVT_NOTHING_PENDING; |
---|
4422 | 4544 | } |
---|
4423 | 4545 | |
---|
4424 | 4546 | struct lpfc_nodelist * |
---|
.. | .. |
---|
4426 | 4548 | int state) |
---|
4427 | 4549 | { |
---|
4428 | 4550 | struct lpfc_hba *phba = vport->phba; |
---|
4429 | | - uint32_t did; |
---|
| 4551 | + uint32_t did, flag; |
---|
4430 | 4552 | unsigned long flags; |
---|
4431 | 4553 | unsigned long *active_rrqs_xri_bitmap = NULL; |
---|
4432 | 4554 | int rpi = LPFC_RPI_ALLOC_ERROR; |
---|
| 4555 | + uint32_t defer_did = 0; |
---|
4433 | 4556 | |
---|
4434 | 4557 | if (!ndlp) |
---|
4435 | 4558 | return NULL; |
---|
4436 | 4559 | |
---|
4437 | 4560 | if (phba->sli_rev == LPFC_SLI_REV4) { |
---|
4438 | | - rpi = lpfc_sli4_alloc_rpi(vport->phba); |
---|
4439 | | - if (rpi == LPFC_RPI_ALLOC_ERROR) |
---|
| 4561 | + if (ndlp->nlp_rpi == LPFC_RPI_ALLOC_ERROR) |
---|
| 4562 | + rpi = lpfc_sli4_alloc_rpi(vport->phba); |
---|
| 4563 | + else |
---|
| 4564 | + rpi = ndlp->nlp_rpi; |
---|
| 4565 | + |
---|
| 4566 | + if (rpi == LPFC_RPI_ALLOC_ERROR) { |
---|
| 4567 | + lpfc_printf_vlog(vport, KERN_WARNING, LOG_NODE, |
---|
| 4568 | + "0359 %s: ndlp:x%px " |
---|
| 4569 | + "usgmap:x%x refcnt:%d FAILED RPI " |
---|
| 4570 | + " ALLOC\n", |
---|
| 4571 | + __func__, |
---|
| 4572 | + (void *)ndlp, ndlp->nlp_usg_map, |
---|
| 4573 | + kref_read(&ndlp->kref)); |
---|
4440 | 4574 | return NULL; |
---|
| 4575 | + } |
---|
4441 | 4576 | } |
---|
4442 | 4577 | |
---|
4443 | 4578 | spin_lock_irqsave(&phba->ndlp_lock, flags); |
---|
.. | .. |
---|
4445 | 4580 | if (NLP_CHK_FREE_REQ(ndlp)) { |
---|
4446 | 4581 | spin_unlock_irqrestore(&phba->ndlp_lock, flags); |
---|
4447 | 4582 | lpfc_printf_vlog(vport, KERN_WARNING, LOG_NODE, |
---|
4448 | | - "0277 lpfc_enable_node: ndlp:x%p " |
---|
| 4583 | + "0277 %s: ndlp:x%px " |
---|
4449 | 4584 | "usgmap:x%x refcnt:%d\n", |
---|
4450 | | - (void *)ndlp, ndlp->nlp_usg_map, |
---|
| 4585 | + __func__, (void *)ndlp, ndlp->nlp_usg_map, |
---|
4451 | 4586 | kref_read(&ndlp->kref)); |
---|
4452 | 4587 | goto free_rpi; |
---|
4453 | 4588 | } |
---|
.. | .. |
---|
4455 | 4590 | if (NLP_CHK_NODE_ACT(ndlp)) { |
---|
4456 | 4591 | spin_unlock_irqrestore(&phba->ndlp_lock, flags); |
---|
4457 | 4592 | lpfc_printf_vlog(vport, KERN_WARNING, LOG_NODE, |
---|
4458 | | - "0278 lpfc_enable_node: ndlp:x%p " |
---|
| 4593 | + "0278 %s: ndlp:x%px " |
---|
4459 | 4594 | "usgmap:x%x refcnt:%d\n", |
---|
4460 | | - (void *)ndlp, ndlp->nlp_usg_map, |
---|
| 4595 | + __func__, (void *)ndlp, ndlp->nlp_usg_map, |
---|
4461 | 4596 | kref_read(&ndlp->kref)); |
---|
4462 | 4597 | goto free_rpi; |
---|
4463 | 4598 | } |
---|
4464 | 4599 | |
---|
4465 | | - /* Keep the original DID */ |
---|
| 4600 | + /* First preserve the orginal DID, xri_bitmap and some flags */ |
---|
4466 | 4601 | did = ndlp->nlp_DID; |
---|
| 4602 | + flag = (ndlp->nlp_flag & NLP_UNREG_INP); |
---|
| 4603 | + if (flag & NLP_UNREG_INP) |
---|
| 4604 | + defer_did = ndlp->nlp_defer_did; |
---|
4467 | 4605 | if (phba->sli_rev == LPFC_SLI_REV4) |
---|
4468 | 4606 | active_rrqs_xri_bitmap = ndlp->active_rrqs_xri_bitmap; |
---|
4469 | 4607 | |
---|
4470 | | - /* re-initialize ndlp except of ndlp linked list pointer */ |
---|
| 4608 | + /* Zero ndlp except of ndlp linked list pointer */ |
---|
4471 | 4609 | memset((((char *)ndlp) + sizeof (struct list_head)), 0, |
---|
4472 | 4610 | sizeof (struct lpfc_nodelist) - sizeof (struct list_head)); |
---|
4473 | | - lpfc_initialize_node(vport, ndlp, did); |
---|
4474 | 4611 | |
---|
| 4612 | + /* Next reinitialize and restore saved objects */ |
---|
| 4613 | + lpfc_initialize_node(vport, ndlp, did); |
---|
| 4614 | + ndlp->nlp_flag |= flag; |
---|
| 4615 | + if (flag & NLP_UNREG_INP) |
---|
| 4616 | + ndlp->nlp_defer_did = defer_did; |
---|
4475 | 4617 | if (phba->sli_rev == LPFC_SLI_REV4) |
---|
4476 | 4618 | ndlp->active_rrqs_xri_bitmap = active_rrqs_xri_bitmap; |
---|
4477 | 4619 | |
---|
.. | .. |
---|
4480 | 4622 | ndlp->nlp_rpi = rpi; |
---|
4481 | 4623 | lpfc_printf_vlog(vport, KERN_INFO, LOG_NODE, |
---|
4482 | 4624 | "0008 rpi:%x DID:%x flg:%x refcnt:%d " |
---|
4483 | | - "map:%x %p\n", ndlp->nlp_rpi, ndlp->nlp_DID, |
---|
| 4625 | + "map:%x x%px\n", ndlp->nlp_rpi, ndlp->nlp_DID, |
---|
4484 | 4626 | ndlp->nlp_flag, |
---|
4485 | 4627 | kref_read(&ndlp->kref), |
---|
4486 | 4628 | ndlp->nlp_usg_map, ndlp); |
---|
.. | .. |
---|
4489 | 4631 | |
---|
4490 | 4632 | if (state != NLP_STE_UNUSED_NODE) |
---|
4491 | 4633 | lpfc_nlp_set_state(vport, ndlp, state); |
---|
| 4634 | + else |
---|
| 4635 | + lpfc_printf_vlog(vport, KERN_INFO, LOG_NODE, |
---|
| 4636 | + "0013 rpi:%x DID:%x flg:%x refcnt:%d " |
---|
| 4637 | + "map:%x x%px STATE=UNUSED\n", |
---|
| 4638 | + ndlp->nlp_rpi, ndlp->nlp_DID, |
---|
| 4639 | + ndlp->nlp_flag, |
---|
| 4640 | + kref_read(&ndlp->kref), |
---|
| 4641 | + ndlp->nlp_usg_map, ndlp); |
---|
4492 | 4642 | |
---|
4493 | 4643 | lpfc_debugfs_disc_trc(vport, LPFC_DISC_TRC_NODE, |
---|
4494 | 4644 | "node enable: did:x%x", |
---|
.. | .. |
---|
4496 | 4646 | return ndlp; |
---|
4497 | 4647 | |
---|
4498 | 4648 | free_rpi: |
---|
4499 | | - if (phba->sli_rev == LPFC_SLI_REV4) |
---|
| 4649 | + if (phba->sli_rev == LPFC_SLI_REV4) { |
---|
4500 | 4650 | lpfc_sli4_free_rpi(vport->phba, rpi); |
---|
| 4651 | + ndlp->nlp_rpi = LPFC_RPI_ALLOC_ERROR; |
---|
| 4652 | + } |
---|
4501 | 4653 | return NULL; |
---|
4502 | 4654 | } |
---|
4503 | 4655 | |
---|
.. | .. |
---|
4620 | 4772 | case CMD_GEN_REQUEST64_CR: |
---|
4621 | 4773 | if (iocb->context_un.ndlp == ndlp) |
---|
4622 | 4774 | return 1; |
---|
| 4775 | + fallthrough; |
---|
4623 | 4776 | case CMD_ELS_REQUEST64_CR: |
---|
4624 | 4777 | if (icmd->un.elsreq64.remoteID == ndlp->nlp_DID) |
---|
4625 | 4778 | return 1; |
---|
| 4779 | + fallthrough; |
---|
4626 | 4780 | case CMD_XMIT_ELS_RSP64_CX: |
---|
4627 | 4781 | if (iocb->context1 == (uint8_t *) ndlp) |
---|
4628 | 4782 | return 1; |
---|
.. | .. |
---|
4731 | 4885 | struct lpfc_vport *vport = pmb->vport; |
---|
4732 | 4886 | struct lpfc_nodelist *ndlp; |
---|
4733 | 4887 | |
---|
4734 | | - ndlp = (struct lpfc_nodelist *)(pmb->context1); |
---|
| 4888 | + ndlp = (struct lpfc_nodelist *)(pmb->ctx_ndlp); |
---|
4735 | 4889 | if (!ndlp) |
---|
4736 | 4890 | return; |
---|
4737 | 4891 | lpfc_issue_els_logo(vport, ndlp, 0); |
---|
4738 | 4892 | mempool_free(pmb, phba->mbox_mem_pool); |
---|
| 4893 | + |
---|
| 4894 | + /* Check to see if there are any deferred events to process */ |
---|
| 4895 | + if ((ndlp->nlp_flag & NLP_UNREG_INP) && |
---|
| 4896 | + (ndlp->nlp_defer_did != NLP_EVT_NOTHING_PENDING)) { |
---|
| 4897 | + lpfc_printf_vlog(vport, KERN_INFO, LOG_DISCOVERY, |
---|
| 4898 | + "1434 UNREG cmpl deferred logo x%x " |
---|
| 4899 | + "on NPort x%x Data: x%x x%px\n", |
---|
| 4900 | + ndlp->nlp_rpi, ndlp->nlp_DID, |
---|
| 4901 | + ndlp->nlp_defer_did, ndlp); |
---|
| 4902 | + |
---|
| 4903 | + ndlp->nlp_flag &= ~NLP_UNREG_INP; |
---|
| 4904 | + ndlp->nlp_defer_did = NLP_EVT_NOTHING_PENDING; |
---|
| 4905 | + lpfc_issue_els_plogi(vport, ndlp->nlp_DID, 0); |
---|
| 4906 | + } else { |
---|
| 4907 | + if (ndlp->nlp_flag & NLP_RELEASE_RPI) { |
---|
| 4908 | + lpfc_sli4_free_rpi(vport->phba, ndlp->nlp_rpi); |
---|
| 4909 | + ndlp->nlp_flag &= ~NLP_RELEASE_RPI; |
---|
| 4910 | + ndlp->nlp_rpi = LPFC_RPI_ALLOC_ERROR; |
---|
| 4911 | + } |
---|
| 4912 | + ndlp->nlp_flag &= ~NLP_UNREG_INP; |
---|
| 4913 | + } |
---|
| 4914 | +} |
---|
| 4915 | + |
---|
| 4916 | +/* |
---|
| 4917 | + * Sets the mailbox completion handler to be used for the |
---|
| 4918 | + * unreg_rpi command. The handler varies based on the state of |
---|
| 4919 | + * the port and what will be happening to the rpi next. |
---|
| 4920 | + */ |
---|
| 4921 | +static void |
---|
| 4922 | +lpfc_set_unreg_login_mbx_cmpl(struct lpfc_hba *phba, struct lpfc_vport *vport, |
---|
| 4923 | + struct lpfc_nodelist *ndlp, LPFC_MBOXQ_t *mbox) |
---|
| 4924 | +{ |
---|
| 4925 | + unsigned long iflags; |
---|
| 4926 | + |
---|
| 4927 | + if (ndlp->nlp_flag & NLP_ISSUE_LOGO) { |
---|
| 4928 | + mbox->ctx_ndlp = ndlp; |
---|
| 4929 | + mbox->mbox_cmpl = lpfc_nlp_logo_unreg; |
---|
| 4930 | + |
---|
| 4931 | + } else if (phba->sli_rev == LPFC_SLI_REV4 && |
---|
| 4932 | + (!(vport->load_flag & FC_UNLOADING)) && |
---|
| 4933 | + (bf_get(lpfc_sli_intf_if_type, &phba->sli4_hba.sli_intf) >= |
---|
| 4934 | + LPFC_SLI_INTF_IF_TYPE_2) && |
---|
| 4935 | + (kref_read(&ndlp->kref) > 0)) { |
---|
| 4936 | + mbox->ctx_ndlp = lpfc_nlp_get(ndlp); |
---|
| 4937 | + mbox->mbox_cmpl = lpfc_sli4_unreg_rpi_cmpl_clr; |
---|
| 4938 | + } else { |
---|
| 4939 | + if (vport->load_flag & FC_UNLOADING) { |
---|
| 4940 | + if (phba->sli_rev == LPFC_SLI_REV4) { |
---|
| 4941 | + spin_lock_irqsave(&vport->phba->ndlp_lock, |
---|
| 4942 | + iflags); |
---|
| 4943 | + ndlp->nlp_flag |= NLP_RELEASE_RPI; |
---|
| 4944 | + spin_unlock_irqrestore(&vport->phba->ndlp_lock, |
---|
| 4945 | + iflags); |
---|
| 4946 | + } |
---|
| 4947 | + lpfc_nlp_get(ndlp); |
---|
| 4948 | + } |
---|
| 4949 | + mbox->ctx_ndlp = ndlp; |
---|
| 4950 | + mbox->mbox_cmpl = lpfc_sli_def_mbox_cmpl; |
---|
| 4951 | + } |
---|
4739 | 4952 | } |
---|
4740 | 4953 | |
---|
4741 | 4954 | /* |
---|
.. | .. |
---|
4758 | 4971 | if (ndlp->nlp_flag & NLP_RPI_REGISTERED || |
---|
4759 | 4972 | ndlp->nlp_flag & NLP_REG_LOGIN_SEND) { |
---|
4760 | 4973 | if (ndlp->nlp_flag & NLP_REG_LOGIN_SEND) |
---|
4761 | | - lpfc_printf_vlog(vport, KERN_INFO, LOG_SLI, |
---|
| 4974 | + lpfc_printf_vlog(vport, KERN_INFO, |
---|
| 4975 | + LOG_NODE | LOG_DISCOVERY, |
---|
4762 | 4976 | "3366 RPI x%x needs to be " |
---|
4763 | 4977 | "unregistered nlp_flag x%x " |
---|
4764 | 4978 | "did x%x\n", |
---|
4765 | 4979 | ndlp->nlp_rpi, ndlp->nlp_flag, |
---|
4766 | 4980 | ndlp->nlp_DID); |
---|
| 4981 | + |
---|
| 4982 | + /* If there is already an UNREG in progress for this ndlp, |
---|
| 4983 | + * no need to queue up another one. |
---|
| 4984 | + */ |
---|
| 4985 | + if (ndlp->nlp_flag & NLP_UNREG_INP) { |
---|
| 4986 | + lpfc_printf_vlog(vport, KERN_INFO, |
---|
| 4987 | + LOG_NODE | LOG_DISCOVERY, |
---|
| 4988 | + "1436 unreg_rpi SKIP UNREG x%x on " |
---|
| 4989 | + "NPort x%x deferred x%x flg x%x " |
---|
| 4990 | + "Data: x%px\n", |
---|
| 4991 | + ndlp->nlp_rpi, ndlp->nlp_DID, |
---|
| 4992 | + ndlp->nlp_defer_did, |
---|
| 4993 | + ndlp->nlp_flag, ndlp); |
---|
| 4994 | + goto out; |
---|
| 4995 | + } |
---|
| 4996 | + |
---|
4767 | 4997 | mbox = mempool_alloc(phba->mbox_mem_pool, GFP_KERNEL); |
---|
4768 | 4998 | if (mbox) { |
---|
4769 | 4999 | /* SLI4 ports require the physical rpi value. */ |
---|
.. | .. |
---|
4773 | 5003 | |
---|
4774 | 5004 | lpfc_unreg_login(phba, vport->vpi, rpi, mbox); |
---|
4775 | 5005 | mbox->vport = vport; |
---|
4776 | | - if (ndlp->nlp_flag & NLP_ISSUE_LOGO) { |
---|
4777 | | - mbox->context1 = ndlp; |
---|
4778 | | - mbox->mbox_cmpl = lpfc_nlp_logo_unreg; |
---|
4779 | | - } else { |
---|
4780 | | - if (phba->sli_rev == LPFC_SLI_REV4 && |
---|
4781 | | - (!(vport->load_flag & FC_UNLOADING)) && |
---|
4782 | | - (bf_get(lpfc_sli_intf_if_type, |
---|
4783 | | - &phba->sli4_hba.sli_intf) >= |
---|
4784 | | - LPFC_SLI_INTF_IF_TYPE_2) && |
---|
4785 | | - (kref_read(&ndlp->kref) > 0)) { |
---|
4786 | | - mbox->context1 = lpfc_nlp_get(ndlp); |
---|
4787 | | - mbox->mbox_cmpl = |
---|
4788 | | - lpfc_sli4_unreg_rpi_cmpl_clr; |
---|
4789 | | - /* |
---|
4790 | | - * accept PLOGIs after unreg_rpi_cmpl |
---|
4791 | | - */ |
---|
4792 | | - acc_plogi = 0; |
---|
4793 | | - } else |
---|
4794 | | - mbox->mbox_cmpl = |
---|
4795 | | - lpfc_sli_def_mbox_cmpl; |
---|
4796 | | - } |
---|
| 5006 | + lpfc_set_unreg_login_mbx_cmpl(phba, vport, ndlp, mbox); |
---|
| 5007 | + if (mbox->mbox_cmpl == lpfc_sli4_unreg_rpi_cmpl_clr) |
---|
| 5008 | + /* |
---|
| 5009 | + * accept PLOGIs after unreg_rpi_cmpl |
---|
| 5010 | + */ |
---|
| 5011 | + acc_plogi = 0; |
---|
| 5012 | + if (((ndlp->nlp_DID & Fabric_DID_MASK) != |
---|
| 5013 | + Fabric_DID_MASK) && |
---|
| 5014 | + (!(vport->fc_flag & FC_OFFLINE_MODE))) |
---|
| 5015 | + ndlp->nlp_flag |= NLP_UNREG_INP; |
---|
| 5016 | + |
---|
| 5017 | + lpfc_printf_vlog(vport, KERN_INFO, |
---|
| 5018 | + LOG_NODE | LOG_DISCOVERY, |
---|
| 5019 | + "1433 unreg_rpi UNREG x%x on " |
---|
| 5020 | + "NPort x%x deferred flg x%x " |
---|
| 5021 | + "Data:x%px\n", |
---|
| 5022 | + ndlp->nlp_rpi, ndlp->nlp_DID, |
---|
| 5023 | + ndlp->nlp_flag, ndlp); |
---|
4797 | 5024 | |
---|
4798 | 5025 | rc = lpfc_sli_issue_mbox(phba, mbox, MBX_NOWAIT); |
---|
4799 | 5026 | if (rc == MBX_NOT_FINISHED) { |
---|
4800 | 5027 | mempool_free(mbox, phba->mbox_mem_pool); |
---|
4801 | 5028 | acc_plogi = 1; |
---|
4802 | 5029 | } |
---|
| 5030 | + } else { |
---|
| 5031 | + lpfc_printf_vlog(vport, KERN_INFO, |
---|
| 5032 | + LOG_NODE | LOG_DISCOVERY, |
---|
| 5033 | + "1444 Failed to allocate mempool " |
---|
| 5034 | + "unreg_rpi UNREG x%x, " |
---|
| 5035 | + "DID x%x, flag x%x, " |
---|
| 5036 | + "ndlp x%px\n", |
---|
| 5037 | + ndlp->nlp_rpi, ndlp->nlp_DID, |
---|
| 5038 | + ndlp->nlp_flag, ndlp); |
---|
| 5039 | + |
---|
| 5040 | + /* Because mempool_alloc failed, we |
---|
| 5041 | + * will issue a LOGO here and keep the rpi alive if |
---|
| 5042 | + * not unloading. |
---|
| 5043 | + */ |
---|
| 5044 | + if (!(vport->load_flag & FC_UNLOADING)) { |
---|
| 5045 | + ndlp->nlp_flag &= ~NLP_UNREG_INP; |
---|
| 5046 | + lpfc_issue_els_logo(vport, ndlp, 0); |
---|
| 5047 | + ndlp->nlp_prev_state = ndlp->nlp_state; |
---|
| 5048 | + lpfc_nlp_set_state(vport, ndlp, |
---|
| 5049 | + NLP_STE_NPR_NODE); |
---|
| 5050 | + } |
---|
| 5051 | + |
---|
| 5052 | + return 1; |
---|
4803 | 5053 | } |
---|
4804 | 5054 | lpfc_no_rpi(phba, ndlp); |
---|
4805 | | - |
---|
| 5055 | +out: |
---|
4806 | 5056 | if (phba->sli_rev != LPFC_SLI_REV4) |
---|
4807 | 5057 | ndlp->nlp_rpi = 0; |
---|
4808 | 5058 | ndlp->nlp_flag &= ~NLP_RPI_REGISTERED; |
---|
.. | .. |
---|
4832 | 5082 | |
---|
4833 | 5083 | vports = lpfc_create_vport_work_array(phba); |
---|
4834 | 5084 | if (!vports) { |
---|
4835 | | - lpfc_printf_log(phba, KERN_ERR, LOG_DISCOVERY, |
---|
4836 | | - "2884 Vport array allocation failed \n"); |
---|
| 5085 | + lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, |
---|
| 5086 | + "2884 Vport array allocation failed \n"); |
---|
4837 | 5087 | return; |
---|
4838 | 5088 | } |
---|
4839 | 5089 | for (i = 0; i <= phba->max_vports && vports[i] != NULL; i++) { |
---|
.. | .. |
---|
4870 | 5120 | mbox); |
---|
4871 | 5121 | mbox->vport = vport; |
---|
4872 | 5122 | mbox->mbox_cmpl = lpfc_sli_def_mbox_cmpl; |
---|
4873 | | - mbox->context1 = NULL; |
---|
| 5123 | + mbox->ctx_ndlp = NULL; |
---|
4874 | 5124 | rc = lpfc_sli_issue_mbox_wait(phba, mbox, LPFC_MBOX_TMO); |
---|
4875 | 5125 | if (rc != MBX_TIMEOUT) |
---|
4876 | 5126 | mempool_free(mbox, phba->mbox_mem_pool); |
---|
4877 | 5127 | |
---|
4878 | 5128 | if ((rc == MBX_TIMEOUT) || (rc == MBX_NOT_FINISHED)) |
---|
4879 | | - lpfc_printf_vlog(vport, KERN_ERR, LOG_MBOX | LOG_VPORT, |
---|
4880 | | - "1836 Could not issue " |
---|
4881 | | - "unreg_login(all_rpis) status %d\n", rc); |
---|
| 5129 | + lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT, |
---|
| 5130 | + "1836 Could not issue " |
---|
| 5131 | + "unreg_login(all_rpis) status %d\n", |
---|
| 5132 | + rc); |
---|
4882 | 5133 | } |
---|
4883 | 5134 | } |
---|
4884 | 5135 | |
---|
.. | .. |
---|
4899 | 5150 | mbox); |
---|
4900 | 5151 | mbox->vport = vport; |
---|
4901 | 5152 | mbox->mbox_cmpl = lpfc_sli_def_mbox_cmpl; |
---|
4902 | | - mbox->context1 = NULL; |
---|
| 5153 | + mbox->ctx_ndlp = NULL; |
---|
4903 | 5154 | rc = lpfc_sli_issue_mbox_wait(phba, mbox, LPFC_MBOX_TMO); |
---|
4904 | 5155 | if (rc != MBX_TIMEOUT) |
---|
4905 | 5156 | mempool_free(mbox, phba->mbox_mem_pool); |
---|
4906 | 5157 | |
---|
4907 | 5158 | if ((rc == MBX_TIMEOUT) || (rc == MBX_NOT_FINISHED)) |
---|
4908 | | - lpfc_printf_vlog(vport, KERN_ERR, LOG_MBOX | LOG_VPORT, |
---|
| 5159 | + lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT, |
---|
4909 | 5160 | "1815 Could not issue " |
---|
4910 | 5161 | "unreg_did (default rpis) status %d\n", |
---|
4911 | 5162 | rc); |
---|
.. | .. |
---|
4923 | 5174 | struct lpfc_hba *phba = vport->phba; |
---|
4924 | 5175 | LPFC_MBOXQ_t *mb, *nextmb; |
---|
4925 | 5176 | struct lpfc_dmabuf *mp; |
---|
| 5177 | + unsigned long iflags; |
---|
4926 | 5178 | |
---|
4927 | 5179 | /* Cleanup node for NPort <nlp_DID> */ |
---|
4928 | 5180 | lpfc_printf_vlog(vport, KERN_INFO, LOG_NODE, |
---|
.. | .. |
---|
4932 | 5184 | ndlp->nlp_state, ndlp->nlp_rpi); |
---|
4933 | 5185 | if (NLP_CHK_FREE_REQ(ndlp)) { |
---|
4934 | 5186 | lpfc_printf_vlog(vport, KERN_WARNING, LOG_NODE, |
---|
4935 | | - "0280 lpfc_cleanup_node: ndlp:x%p " |
---|
| 5187 | + "0280 %s: ndlp:x%px " |
---|
4936 | 5188 | "usgmap:x%x refcnt:%d\n", |
---|
4937 | | - (void *)ndlp, ndlp->nlp_usg_map, |
---|
| 5189 | + __func__, (void *)ndlp, ndlp->nlp_usg_map, |
---|
4938 | 5190 | kref_read(&ndlp->kref)); |
---|
4939 | 5191 | lpfc_dequeue_node(vport, ndlp); |
---|
4940 | 5192 | } else { |
---|
4941 | 5193 | lpfc_printf_vlog(vport, KERN_WARNING, LOG_NODE, |
---|
4942 | | - "0281 lpfc_cleanup_node: ndlp:x%p " |
---|
| 5194 | + "0281 %s: ndlp:x%px " |
---|
4943 | 5195 | "usgmap:x%x refcnt:%d\n", |
---|
4944 | | - (void *)ndlp, ndlp->nlp_usg_map, |
---|
| 5196 | + __func__, (void *)ndlp, ndlp->nlp_usg_map, |
---|
4945 | 5197 | kref_read(&ndlp->kref)); |
---|
4946 | 5198 | lpfc_disable_node(vport, ndlp); |
---|
4947 | 5199 | } |
---|
.. | .. |
---|
4953 | 5205 | if ((mb = phba->sli.mbox_active)) { |
---|
4954 | 5206 | if ((mb->u.mb.mbxCommand == MBX_REG_LOGIN64) && |
---|
4955 | 5207 | !(mb->mbox_flag & LPFC_MBX_IMED_UNREG) && |
---|
4956 | | - (ndlp == (struct lpfc_nodelist *) mb->context2)) { |
---|
4957 | | - mb->context2 = NULL; |
---|
| 5208 | + (ndlp == (struct lpfc_nodelist *)mb->ctx_ndlp)) { |
---|
| 5209 | + mb->ctx_ndlp = NULL; |
---|
4958 | 5210 | mb->mbox_cmpl = lpfc_sli_def_mbox_cmpl; |
---|
4959 | 5211 | } |
---|
4960 | 5212 | } |
---|
.. | .. |
---|
4964 | 5216 | list_for_each_entry(mb, &phba->sli.mboxq_cmpl, list) { |
---|
4965 | 5217 | if ((mb->u.mb.mbxCommand != MBX_REG_LOGIN64) || |
---|
4966 | 5218 | (mb->mbox_flag & LPFC_MBX_IMED_UNREG) || |
---|
4967 | | - (ndlp != (struct lpfc_nodelist *) mb->context2)) |
---|
| 5219 | + (ndlp != (struct lpfc_nodelist *)mb->ctx_ndlp)) |
---|
4968 | 5220 | continue; |
---|
4969 | 5221 | |
---|
4970 | | - mb->context2 = NULL; |
---|
| 5222 | + mb->ctx_ndlp = NULL; |
---|
4971 | 5223 | mb->mbox_cmpl = lpfc_sli_def_mbox_cmpl; |
---|
4972 | 5224 | } |
---|
4973 | 5225 | |
---|
4974 | 5226 | list_for_each_entry_safe(mb, nextmb, &phba->sli.mboxq, list) { |
---|
4975 | 5227 | if ((mb->u.mb.mbxCommand == MBX_REG_LOGIN64) && |
---|
4976 | 5228 | !(mb->mbox_flag & LPFC_MBX_IMED_UNREG) && |
---|
4977 | | - (ndlp == (struct lpfc_nodelist *) mb->context2)) { |
---|
4978 | | - mp = (struct lpfc_dmabuf *) (mb->context1); |
---|
| 5229 | + (ndlp == (struct lpfc_nodelist *)mb->ctx_ndlp)) { |
---|
| 5230 | + mp = (struct lpfc_dmabuf *)(mb->ctx_buf); |
---|
4979 | 5231 | if (mp) { |
---|
4980 | 5232 | __lpfc_mbuf_free(phba, mp->virt, mp->phys); |
---|
4981 | 5233 | kfree(mp); |
---|
.. | .. |
---|
5001 | 5253 | |
---|
5002 | 5254 | list_del_init(&ndlp->els_retry_evt.evt_listp); |
---|
5003 | 5255 | list_del_init(&ndlp->dev_loss_evt.evt_listp); |
---|
| 5256 | + list_del_init(&ndlp->recovery_evt.evt_listp); |
---|
5004 | 5257 | lpfc_cleanup_vports_rrqs(vport, ndlp); |
---|
5005 | | - lpfc_unreg_rpi(vport, ndlp); |
---|
5006 | | - |
---|
| 5258 | + if (phba->sli_rev == LPFC_SLI_REV4) |
---|
| 5259 | + ndlp->nlp_flag |= NLP_RELEASE_RPI; |
---|
| 5260 | + if (!lpfc_unreg_rpi(vport, ndlp)) { |
---|
| 5261 | + /* Clean up unregistered and non freed rpis */ |
---|
| 5262 | + if ((ndlp->nlp_flag & NLP_RELEASE_RPI) && |
---|
| 5263 | + !(ndlp->nlp_rpi == LPFC_RPI_ALLOC_ERROR)) { |
---|
| 5264 | + lpfc_sli4_free_rpi(vport->phba, |
---|
| 5265 | + ndlp->nlp_rpi); |
---|
| 5266 | + spin_lock_irqsave(&vport->phba->ndlp_lock, |
---|
| 5267 | + iflags); |
---|
| 5268 | + ndlp->nlp_flag &= ~NLP_RELEASE_RPI; |
---|
| 5269 | + ndlp->nlp_rpi = LPFC_RPI_ALLOC_ERROR; |
---|
| 5270 | + spin_unlock_irqrestore(&vport->phba->ndlp_lock, |
---|
| 5271 | + iflags); |
---|
| 5272 | + } |
---|
| 5273 | + } |
---|
5007 | 5274 | return 0; |
---|
5008 | 5275 | } |
---|
5009 | 5276 | |
---|
.. | .. |
---|
5029 | 5296 | /* For this case we need to cleanup the default rpi |
---|
5030 | 5297 | * allocated by the firmware. |
---|
5031 | 5298 | */ |
---|
5032 | | - lpfc_printf_vlog(vport, KERN_INFO, LOG_NODE, |
---|
5033 | | - "0005 rpi:%x DID:%x flg:%x %d map:%x %p\n", |
---|
| 5299 | + lpfc_printf_vlog(vport, KERN_INFO, |
---|
| 5300 | + LOG_NODE | LOG_DISCOVERY, |
---|
| 5301 | + "0005 Cleanup Default rpi:x%x DID:x%x flg:x%x " |
---|
| 5302 | + "ref %d map:x%x ndlp x%px\n", |
---|
5034 | 5303 | ndlp->nlp_rpi, ndlp->nlp_DID, ndlp->nlp_flag, |
---|
5035 | 5304 | kref_read(&ndlp->kref), |
---|
5036 | 5305 | ndlp->nlp_usg_map, ndlp); |
---|
.. | .. |
---|
5045 | 5314 | mbox->mbox_flag |= LPFC_MBX_IMED_UNREG; |
---|
5046 | 5315 | mbox->mbox_cmpl = lpfc_mbx_cmpl_dflt_rpi; |
---|
5047 | 5316 | mbox->vport = vport; |
---|
5048 | | - mbox->context2 = ndlp; |
---|
| 5317 | + mbox->ctx_ndlp = ndlp; |
---|
5049 | 5318 | rc =lpfc_sli_issue_mbox(phba, mbox, MBX_NOWAIT); |
---|
5050 | 5319 | if (rc == MBX_NOT_FINISHED) { |
---|
5051 | 5320 | mempool_free(mbox, phba->mbox_mem_pool); |
---|
.. | .. |
---|
5066 | 5335 | * for registered rport so need to cleanup rport |
---|
5067 | 5336 | */ |
---|
5068 | 5337 | lpfc_printf_vlog(vport, KERN_WARNING, LOG_NODE, |
---|
5069 | | - "0940 removed node x%p DID x%x " |
---|
5070 | | - " rport not null %p\n", |
---|
5071 | | - ndlp, ndlp->nlp_DID, ndlp->rport); |
---|
| 5338 | + "0940 removed node x%px DID x%x " |
---|
| 5339 | + "rpi %d rport not null x%px\n", |
---|
| 5340 | + ndlp, ndlp->nlp_DID, ndlp->nlp_rpi, |
---|
| 5341 | + ndlp->rport); |
---|
5072 | 5342 | rport = ndlp->rport; |
---|
5073 | 5343 | rdata = rport->dd_data; |
---|
5074 | 5344 | rdata->pnode = NULL; |
---|
.. | .. |
---|
5141 | 5411 | |
---|
5142 | 5412 | list_for_each_entry(ndlp, &vport->fc_nodes, nlp_listp) { |
---|
5143 | 5413 | if (lpfc_matchdid(vport, ndlp, did)) { |
---|
5144 | | - data1 = (((uint32_t) ndlp->nlp_state << 24) | |
---|
5145 | | - ((uint32_t) ndlp->nlp_xri << 16) | |
---|
5146 | | - ((uint32_t) ndlp->nlp_type << 8) | |
---|
5147 | | - ((uint32_t) ndlp->nlp_rpi & 0xff)); |
---|
| 5414 | + data1 = (((uint32_t)ndlp->nlp_state << 24) | |
---|
| 5415 | + ((uint32_t)ndlp->nlp_xri << 16) | |
---|
| 5416 | + ((uint32_t)ndlp->nlp_type << 8) | |
---|
| 5417 | + ((uint32_t)ndlp->nlp_usg_map & 0xff)); |
---|
5148 | 5418 | lpfc_printf_vlog(vport, KERN_INFO, LOG_NODE, |
---|
5149 | 5419 | "0929 FIND node DID " |
---|
5150 | | - "Data: x%p x%x x%x x%x %p\n", |
---|
| 5420 | + "Data: x%px x%x x%x x%x x%x x%px\n", |
---|
5151 | 5421 | ndlp, ndlp->nlp_DID, |
---|
5152 | | - ndlp->nlp_flag, data1, |
---|
| 5422 | + ndlp->nlp_flag, data1, ndlp->nlp_rpi, |
---|
5153 | 5423 | ndlp->active_rrqs_xri_bitmap); |
---|
5154 | 5424 | return ndlp; |
---|
5155 | 5425 | } |
---|
.. | .. |
---|
5175 | 5445 | } |
---|
5176 | 5446 | |
---|
5177 | 5447 | struct lpfc_nodelist * |
---|
| 5448 | +lpfc_findnode_mapped(struct lpfc_vport *vport) |
---|
| 5449 | +{ |
---|
| 5450 | + struct Scsi_Host *shost = lpfc_shost_from_vport(vport); |
---|
| 5451 | + struct lpfc_nodelist *ndlp; |
---|
| 5452 | + uint32_t data1; |
---|
| 5453 | + unsigned long iflags; |
---|
| 5454 | + |
---|
| 5455 | + spin_lock_irqsave(shost->host_lock, iflags); |
---|
| 5456 | + |
---|
| 5457 | + list_for_each_entry(ndlp, &vport->fc_nodes, nlp_listp) { |
---|
| 5458 | + if (ndlp->nlp_state == NLP_STE_UNMAPPED_NODE || |
---|
| 5459 | + ndlp->nlp_state == NLP_STE_MAPPED_NODE) { |
---|
| 5460 | + data1 = (((uint32_t)ndlp->nlp_state << 24) | |
---|
| 5461 | + ((uint32_t)ndlp->nlp_xri << 16) | |
---|
| 5462 | + ((uint32_t)ndlp->nlp_type << 8) | |
---|
| 5463 | + ((uint32_t)ndlp->nlp_rpi & 0xff)); |
---|
| 5464 | + spin_unlock_irqrestore(shost->host_lock, iflags); |
---|
| 5465 | + lpfc_printf_vlog(vport, KERN_INFO, LOG_NODE, |
---|
| 5466 | + "2025 FIND node DID " |
---|
| 5467 | + "Data: x%px x%x x%x x%x x%px\n", |
---|
| 5468 | + ndlp, ndlp->nlp_DID, |
---|
| 5469 | + ndlp->nlp_flag, data1, |
---|
| 5470 | + ndlp->active_rrqs_xri_bitmap); |
---|
| 5471 | + return ndlp; |
---|
| 5472 | + } |
---|
| 5473 | + } |
---|
| 5474 | + spin_unlock_irqrestore(shost->host_lock, iflags); |
---|
| 5475 | + |
---|
| 5476 | + /* FIND node did <did> NOT FOUND */ |
---|
| 5477 | + lpfc_printf_vlog(vport, KERN_INFO, LOG_NODE, |
---|
| 5478 | + "2026 FIND mapped did NOT FOUND.\n"); |
---|
| 5479 | + return NULL; |
---|
| 5480 | +} |
---|
| 5481 | + |
---|
| 5482 | +struct lpfc_nodelist * |
---|
5178 | 5483 | lpfc_setup_disc_node(struct lpfc_vport *vport, uint32_t did) |
---|
5179 | 5484 | { |
---|
5180 | 5485 | struct Scsi_Host *shost = lpfc_shost_from_vport(vport); |
---|
.. | .. |
---|
5191 | 5496 | if (!ndlp) |
---|
5192 | 5497 | return NULL; |
---|
5193 | 5498 | lpfc_nlp_set_state(vport, ndlp, NLP_STE_NPR_NODE); |
---|
| 5499 | + |
---|
| 5500 | + lpfc_printf_vlog(vport, KERN_INFO, LOG_DISCOVERY, |
---|
| 5501 | + "6453 Setup New Node 2B_DISC x%x " |
---|
| 5502 | + "Data:x%x x%x x%x\n", |
---|
| 5503 | + ndlp->nlp_DID, ndlp->nlp_flag, |
---|
| 5504 | + ndlp->nlp_state, vport->fc_flag); |
---|
| 5505 | + |
---|
5194 | 5506 | spin_lock_irq(shost->host_lock); |
---|
5195 | 5507 | ndlp->nlp_flag |= NLP_NPR_2B_DISC; |
---|
5196 | 5508 | spin_unlock_irq(shost->host_lock); |
---|
.. | .. |
---|
5199 | 5511 | if (vport->phba->nvmet_support) |
---|
5200 | 5512 | return NULL; |
---|
5201 | 5513 | ndlp = lpfc_enable_node(vport, ndlp, NLP_STE_NPR_NODE); |
---|
5202 | | - if (!ndlp) |
---|
| 5514 | + if (!ndlp) { |
---|
| 5515 | + lpfc_printf_vlog(vport, KERN_WARNING, LOG_SLI, |
---|
| 5516 | + "0014 Could not enable ndlp\n"); |
---|
5203 | 5517 | return NULL; |
---|
| 5518 | + } |
---|
| 5519 | + lpfc_printf_vlog(vport, KERN_INFO, LOG_DISCOVERY, |
---|
| 5520 | + "6454 Setup Enabled Node 2B_DISC x%x " |
---|
| 5521 | + "Data:x%x x%x x%x\n", |
---|
| 5522 | + ndlp->nlp_DID, ndlp->nlp_flag, |
---|
| 5523 | + ndlp->nlp_state, vport->fc_flag); |
---|
| 5524 | + |
---|
5204 | 5525 | spin_lock_irq(shost->host_lock); |
---|
5205 | 5526 | ndlp->nlp_flag |= NLP_NPR_2B_DISC; |
---|
5206 | 5527 | spin_unlock_irq(shost->host_lock); |
---|
.. | .. |
---|
5219 | 5540 | * delay timeout is not needed. |
---|
5220 | 5541 | */ |
---|
5221 | 5542 | lpfc_cancel_retry_delay_tmo(vport, ndlp); |
---|
| 5543 | + |
---|
| 5544 | + lpfc_printf_vlog(vport, KERN_INFO, LOG_DISCOVERY, |
---|
| 5545 | + "6455 Setup RSCN Node 2B_DISC x%x " |
---|
| 5546 | + "Data:x%x x%x x%x\n", |
---|
| 5547 | + ndlp->nlp_DID, ndlp->nlp_flag, |
---|
| 5548 | + ndlp->nlp_state, vport->fc_flag); |
---|
5222 | 5549 | |
---|
5223 | 5550 | /* NVME Target mode waits until rport is known to be |
---|
5224 | 5551 | * impacted by the RSCN before it transitions. No |
---|
.. | .. |
---|
5242 | 5569 | spin_lock_irq(shost->host_lock); |
---|
5243 | 5570 | ndlp->nlp_flag |= NLP_NPR_2B_DISC; |
---|
5244 | 5571 | spin_unlock_irq(shost->host_lock); |
---|
5245 | | - } else |
---|
| 5572 | + } else { |
---|
| 5573 | + lpfc_printf_vlog(vport, KERN_INFO, LOG_DISCOVERY, |
---|
| 5574 | + "6456 Skip Setup RSCN Node x%x " |
---|
| 5575 | + "Data:x%x x%x x%x\n", |
---|
| 5576 | + ndlp->nlp_DID, ndlp->nlp_flag, |
---|
| 5577 | + ndlp->nlp_state, vport->fc_flag); |
---|
5246 | 5578 | ndlp = NULL; |
---|
| 5579 | + } |
---|
5247 | 5580 | } else { |
---|
| 5581 | + lpfc_printf_vlog(vport, KERN_INFO, LOG_DISCOVERY, |
---|
| 5582 | + "6457 Setup Active Node 2B_DISC x%x " |
---|
| 5583 | + "Data:x%x x%x x%x\n", |
---|
| 5584 | + ndlp->nlp_DID, ndlp->nlp_flag, |
---|
| 5585 | + ndlp->nlp_state, vport->fc_flag); |
---|
| 5586 | + |
---|
5248 | 5587 | /* If the initiator received a PLOGI from this NPort or if the |
---|
5249 | 5588 | * initiator is already in the process of discovery on it, |
---|
5250 | 5589 | * there's no need to try to discover it again. |
---|
.. | .. |
---|
5396 | 5735 | |
---|
5397 | 5736 | /* Start Discovery state <hba_state> */ |
---|
5398 | 5737 | lpfc_printf_vlog(vport, KERN_INFO, LOG_DISCOVERY, |
---|
5399 | | - "0202 Start Discovery hba state x%x " |
---|
5400 | | - "Data: x%x x%x x%x\n", |
---|
| 5738 | + "0202 Start Discovery port state x%x " |
---|
| 5739 | + "flg x%x Data: x%x x%x x%x\n", |
---|
5401 | 5740 | vport->port_state, vport->fc_flag, vport->fc_plogi_cnt, |
---|
5402 | | - vport->fc_adisc_cnt); |
---|
| 5741 | + vport->fc_adisc_cnt, vport->fc_npr_cnt); |
---|
5403 | 5742 | |
---|
5404 | 5743 | /* First do ADISCs - if any */ |
---|
5405 | 5744 | num_sent = lpfc_els_disc_adisc(vport); |
---|
.. | .. |
---|
5471 | 5810 | lpfc_free_tx(struct lpfc_hba *phba, struct lpfc_nodelist *ndlp) |
---|
5472 | 5811 | { |
---|
5473 | 5812 | LIST_HEAD(completions); |
---|
5474 | | - struct lpfc_sli *psli; |
---|
5475 | 5813 | IOCB_t *icmd; |
---|
5476 | 5814 | struct lpfc_iocbq *iocb, *next_iocb; |
---|
5477 | 5815 | struct lpfc_sli_ring *pring; |
---|
5478 | 5816 | |
---|
5479 | | - psli = &phba->sli; |
---|
5480 | 5817 | pring = lpfc_phba_elsring(phba); |
---|
5481 | 5818 | if (unlikely(!pring)) |
---|
5482 | 5819 | return; |
---|
.. | .. |
---|
5641 | 5978 | case LPFC_FLOGI: |
---|
5642 | 5979 | /* port_state is identically LPFC_FLOGI while waiting for FLOGI cmpl */ |
---|
5643 | 5980 | /* Initial FLOGI timeout */ |
---|
5644 | | - lpfc_printf_vlog(vport, KERN_ERR, LOG_DISCOVERY, |
---|
| 5981 | + lpfc_printf_vlog(vport, KERN_ERR, |
---|
| 5982 | + LOG_TRACE_EVENT, |
---|
5645 | 5983 | "0222 Initial %s timeout\n", |
---|
5646 | 5984 | vport->vpi ? "FDISC" : "FLOGI"); |
---|
5647 | 5985 | |
---|
.. | .. |
---|
5659 | 5997 | case LPFC_FABRIC_CFG_LINK: |
---|
5660 | 5998 | /* hba_state is identically LPFC_FABRIC_CFG_LINK while waiting for |
---|
5661 | 5999 | NameServer login */ |
---|
5662 | | - lpfc_printf_vlog(vport, KERN_ERR, LOG_DISCOVERY, |
---|
| 6000 | + lpfc_printf_vlog(vport, KERN_ERR, |
---|
| 6001 | + LOG_TRACE_EVENT, |
---|
5663 | 6002 | "0223 Timeout while waiting for " |
---|
5664 | 6003 | "NameServer login\n"); |
---|
5665 | 6004 | /* Next look for NameServer ndlp */ |
---|
.. | .. |
---|
5672 | 6011 | |
---|
5673 | 6012 | case LPFC_NS_QRY: |
---|
5674 | 6013 | /* Check for wait for NameServer Rsp timeout */ |
---|
5675 | | - lpfc_printf_vlog(vport, KERN_ERR, LOG_DISCOVERY, |
---|
| 6014 | + lpfc_printf_vlog(vport, KERN_ERR, |
---|
| 6015 | + LOG_TRACE_EVENT, |
---|
5676 | 6016 | "0224 NameServer Query timeout " |
---|
5677 | 6017 | "Data: x%x x%x\n", |
---|
5678 | 6018 | vport->fc_ns_retry, LPFC_MAX_NS_RETRY); |
---|
.. | .. |
---|
5705 | 6045 | /* Setup and issue mailbox INITIALIZE LINK command */ |
---|
5706 | 6046 | initlinkmbox = mempool_alloc(phba->mbox_mem_pool, GFP_KERNEL); |
---|
5707 | 6047 | if (!initlinkmbox) { |
---|
5708 | | - lpfc_printf_vlog(vport, KERN_ERR, LOG_DISCOVERY, |
---|
| 6048 | + lpfc_printf_vlog(vport, KERN_ERR, |
---|
| 6049 | + LOG_TRACE_EVENT, |
---|
5709 | 6050 | "0206 Device Discovery " |
---|
5710 | 6051 | "completion error\n"); |
---|
5711 | 6052 | phba->link_state = LPFC_HBA_ERROR; |
---|
.. | .. |
---|
5727 | 6068 | |
---|
5728 | 6069 | case LPFC_DISC_AUTH: |
---|
5729 | 6070 | /* Node Authentication timeout */ |
---|
5730 | | - lpfc_printf_vlog(vport, KERN_ERR, LOG_DISCOVERY, |
---|
| 6071 | + lpfc_printf_vlog(vport, KERN_ERR, |
---|
| 6072 | + LOG_TRACE_EVENT, |
---|
5731 | 6073 | "0227 Node Authentication timeout\n"); |
---|
5732 | 6074 | lpfc_disc_flush_list(vport); |
---|
5733 | 6075 | |
---|
.. | .. |
---|
5747 | 6089 | |
---|
5748 | 6090 | case LPFC_VPORT_READY: |
---|
5749 | 6091 | if (vport->fc_flag & FC_RSCN_MODE) { |
---|
5750 | | - lpfc_printf_vlog(vport, KERN_ERR, LOG_DISCOVERY, |
---|
| 6092 | + lpfc_printf_vlog(vport, KERN_ERR, |
---|
| 6093 | + LOG_TRACE_EVENT, |
---|
5751 | 6094 | "0231 RSCN timeout Data: x%x " |
---|
5752 | 6095 | "x%x\n", |
---|
5753 | 6096 | vport->fc_ns_retry, LPFC_MAX_NS_RETRY); |
---|
.. | .. |
---|
5761 | 6104 | break; |
---|
5762 | 6105 | |
---|
5763 | 6106 | default: |
---|
5764 | | - lpfc_printf_vlog(vport, KERN_ERR, LOG_DISCOVERY, |
---|
| 6107 | + lpfc_printf_vlog(vport, KERN_ERR, |
---|
| 6108 | + LOG_TRACE_EVENT, |
---|
5765 | 6109 | "0273 Unexpected discovery timeout, " |
---|
5766 | 6110 | "vport State x%x\n", vport->port_state); |
---|
5767 | 6111 | break; |
---|
.. | .. |
---|
5770 | 6114 | switch (phba->link_state) { |
---|
5771 | 6115 | case LPFC_CLEAR_LA: |
---|
5772 | 6116 | /* CLEAR LA timeout */ |
---|
5773 | | - lpfc_printf_vlog(vport, KERN_ERR, LOG_DISCOVERY, |
---|
| 6117 | + lpfc_printf_vlog(vport, KERN_ERR, |
---|
| 6118 | + LOG_TRACE_EVENT, |
---|
5774 | 6119 | "0228 CLEAR LA timeout\n"); |
---|
5775 | 6120 | clrlaerr = 1; |
---|
5776 | 6121 | break; |
---|
5777 | 6122 | |
---|
5778 | 6123 | case LPFC_LINK_UP: |
---|
5779 | 6124 | lpfc_issue_clear_la(phba, vport); |
---|
5780 | | - /* Drop thru */ |
---|
| 6125 | + fallthrough; |
---|
5781 | 6126 | case LPFC_LINK_UNKNOWN: |
---|
5782 | 6127 | case LPFC_WARM_START: |
---|
5783 | 6128 | case LPFC_INIT_START: |
---|
5784 | 6129 | case LPFC_INIT_MBX_CMDS: |
---|
5785 | 6130 | case LPFC_LINK_DOWN: |
---|
5786 | 6131 | case LPFC_HBA_ERROR: |
---|
5787 | | - lpfc_printf_vlog(vport, KERN_ERR, LOG_DISCOVERY, |
---|
| 6132 | + lpfc_printf_vlog(vport, KERN_ERR, |
---|
| 6133 | + LOG_TRACE_EVENT, |
---|
5788 | 6134 | "0230 Unexpected timeout, hba link " |
---|
5789 | 6135 | "state x%x\n", phba->link_state); |
---|
5790 | 6136 | clrlaerr = 1; |
---|
.. | .. |
---|
5817 | 6163 | lpfc_mbx_cmpl_fdmi_reg_login(struct lpfc_hba *phba, LPFC_MBOXQ_t *pmb) |
---|
5818 | 6164 | { |
---|
5819 | 6165 | MAILBOX_t *mb = &pmb->u.mb; |
---|
5820 | | - struct lpfc_dmabuf *mp = (struct lpfc_dmabuf *) (pmb->context1); |
---|
5821 | | - struct lpfc_nodelist *ndlp = (struct lpfc_nodelist *) pmb->context2; |
---|
| 6166 | + struct lpfc_dmabuf *mp = (struct lpfc_dmabuf *)(pmb->ctx_buf); |
---|
| 6167 | + struct lpfc_nodelist *ndlp = (struct lpfc_nodelist *)pmb->ctx_ndlp; |
---|
5822 | 6168 | struct lpfc_vport *vport = pmb->vport; |
---|
5823 | 6169 | |
---|
5824 | | - pmb->context1 = NULL; |
---|
5825 | | - pmb->context2 = NULL; |
---|
| 6170 | + pmb->ctx_buf = NULL; |
---|
| 6171 | + pmb->ctx_ndlp = NULL; |
---|
5826 | 6172 | |
---|
5827 | 6173 | if (phba->sli_rev < LPFC_SLI_REV4) |
---|
5828 | 6174 | ndlp->nlp_rpi = mb->un.varWords[0]; |
---|
5829 | 6175 | ndlp->nlp_flag |= NLP_RPI_REGISTERED; |
---|
5830 | 6176 | ndlp->nlp_type |= NLP_FABRIC; |
---|
5831 | 6177 | lpfc_nlp_set_state(vport, ndlp, NLP_STE_UNMAPPED_NODE); |
---|
5832 | | - lpfc_printf_vlog(vport, KERN_INFO, LOG_SLI, |
---|
5833 | | - "0004 rpi:%x DID:%x flg:%x %d map:%x %p\n", |
---|
| 6178 | + lpfc_printf_vlog(vport, KERN_INFO, LOG_NODE | LOG_DISCOVERY, |
---|
| 6179 | + "0004 rpi:%x DID:%x flg:%x %d map:%x x%px\n", |
---|
5834 | 6180 | ndlp->nlp_rpi, ndlp->nlp_DID, ndlp->nlp_flag, |
---|
5835 | 6181 | kref_read(&ndlp->kref), |
---|
5836 | 6182 | ndlp->nlp_usg_map, ndlp); |
---|
.. | .. |
---|
5884 | 6230 | list_for_each_entry(ndlp, &vport->fc_nodes, nlp_listp) { |
---|
5885 | 6231 | if (filter(ndlp, param)) { |
---|
5886 | 6232 | lpfc_printf_vlog(vport, KERN_INFO, LOG_NODE, |
---|
5887 | | - "3185 FIND node filter %p DID " |
---|
5888 | | - "ndlp %p did x%x flg x%x st x%x " |
---|
| 6233 | + "3185 FIND node filter %ps DID " |
---|
| 6234 | + "ndlp x%px did x%x flg x%x st x%x " |
---|
5889 | 6235 | "xri x%x type x%x rpi x%x\n", |
---|
5890 | 6236 | filter, ndlp, ndlp->nlp_DID, |
---|
5891 | 6237 | ndlp->nlp_flag, ndlp->nlp_state, |
---|
.. | .. |
---|
5895 | 6241 | } |
---|
5896 | 6242 | } |
---|
5897 | 6243 | lpfc_printf_vlog(vport, KERN_INFO, LOG_NODE, |
---|
5898 | | - "3186 FIND node filter %p NOT FOUND.\n", filter); |
---|
| 6244 | + "3186 FIND node filter %ps NOT FOUND.\n", filter); |
---|
5899 | 6245 | return NULL; |
---|
5900 | 6246 | } |
---|
5901 | 6247 | |
---|
.. | .. |
---|
5935 | 6281 | { |
---|
5936 | 6282 | struct Scsi_Host *shost = lpfc_shost_from_vport(vport); |
---|
5937 | 6283 | struct lpfc_nodelist *ndlp; |
---|
| 6284 | + unsigned long flags; |
---|
5938 | 6285 | |
---|
5939 | | - spin_lock_irq(shost->host_lock); |
---|
| 6286 | + spin_lock_irqsave(shost->host_lock, flags); |
---|
5940 | 6287 | ndlp = __lpfc_findnode_rpi(vport, rpi); |
---|
5941 | | - spin_unlock_irq(shost->host_lock); |
---|
| 6288 | + spin_unlock_irqrestore(shost->host_lock, flags); |
---|
5942 | 6289 | return ndlp; |
---|
5943 | 6290 | } |
---|
5944 | 6291 | |
---|
.. | .. |
---|
5974 | 6321 | } |
---|
5975 | 6322 | |
---|
5976 | 6323 | if (i >= phba->max_vpi) { |
---|
5977 | | - lpfc_printf_log(phba, KERN_ERR, LOG_ELS, |
---|
5978 | | - "2936 Could not find Vport mapped " |
---|
5979 | | - "to vpi %d\n", vpi); |
---|
| 6324 | + lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, |
---|
| 6325 | + "2936 Could not find Vport mapped " |
---|
| 6326 | + "to vpi %d\n", vpi); |
---|
5980 | 6327 | return NULL; |
---|
5981 | 6328 | } |
---|
5982 | 6329 | } |
---|
5983 | 6330 | |
---|
5984 | | - spin_lock_irqsave(&phba->hbalock, flags); |
---|
| 6331 | + spin_lock_irqsave(&phba->port_list_lock, flags); |
---|
5985 | 6332 | list_for_each_entry(vport, &phba->port_list, listentry) { |
---|
5986 | 6333 | if (vport->vpi == i) { |
---|
5987 | | - spin_unlock_irqrestore(&phba->hbalock, flags); |
---|
| 6334 | + spin_unlock_irqrestore(&phba->port_list_lock, flags); |
---|
5988 | 6335 | return vport; |
---|
5989 | 6336 | } |
---|
5990 | 6337 | } |
---|
5991 | | - spin_unlock_irqrestore(&phba->hbalock, flags); |
---|
| 6338 | + spin_unlock_irqrestore(&phba->port_list_lock, flags); |
---|
5992 | 6339 | return NULL; |
---|
5993 | 6340 | } |
---|
5994 | 6341 | |
---|
.. | .. |
---|
6017 | 6364 | INIT_LIST_HEAD(&ndlp->nlp_listp); |
---|
6018 | 6365 | if (vport->phba->sli_rev == LPFC_SLI_REV4) { |
---|
6019 | 6366 | ndlp->nlp_rpi = rpi; |
---|
6020 | | - lpfc_printf_vlog(vport, KERN_INFO, LOG_NODE, |
---|
6021 | | - "0007 rpi:%x DID:%x flg:%x refcnt:%d " |
---|
6022 | | - "map:%x %p\n", ndlp->nlp_rpi, ndlp->nlp_DID, |
---|
6023 | | - ndlp->nlp_flag, |
---|
6024 | | - kref_read(&ndlp->kref), |
---|
6025 | | - ndlp->nlp_usg_map, ndlp); |
---|
| 6367 | + lpfc_printf_vlog(vport, KERN_INFO, LOG_NODE | LOG_DISCOVERY, |
---|
| 6368 | + "0007 Init New ndlp x%px, rpi:x%x DID:%x " |
---|
| 6369 | + "flg:x%x refcnt:%d map:x%x\n", |
---|
| 6370 | + ndlp, ndlp->nlp_rpi, ndlp->nlp_DID, |
---|
| 6371 | + ndlp->nlp_flag, kref_read(&ndlp->kref), |
---|
| 6372 | + ndlp->nlp_usg_map); |
---|
6026 | 6373 | |
---|
6027 | 6374 | ndlp->active_rrqs_xri_bitmap = |
---|
6028 | 6375 | mempool_alloc(vport->phba->active_rrq_pool, |
---|
.. | .. |
---|
6057 | 6404 | ndlp->nlp_DID, ndlp->nlp_flag, ndlp->nlp_type); |
---|
6058 | 6405 | |
---|
6059 | 6406 | lpfc_printf_vlog(ndlp->vport, KERN_INFO, LOG_NODE, |
---|
6060 | | - "0279 lpfc_nlp_release: ndlp:x%p did %x " |
---|
| 6407 | + "0279 %s: ndlp:x%px did %x " |
---|
6061 | 6408 | "usgmap:x%x refcnt:%d rpi:%x\n", |
---|
| 6409 | + __func__, |
---|
6062 | 6410 | (void *)ndlp, ndlp->nlp_DID, ndlp->nlp_usg_map, |
---|
6063 | 6411 | kref_read(&ndlp->kref), ndlp->nlp_rpi); |
---|
6064 | 6412 | |
---|
.. | .. |
---|
6070 | 6418 | spin_lock_irqsave(&phba->ndlp_lock, flags); |
---|
6071 | 6419 | NLP_CLR_NODE_ACT(ndlp); |
---|
6072 | 6420 | spin_unlock_irqrestore(&phba->ndlp_lock, flags); |
---|
6073 | | - if (phba->sli_rev == LPFC_SLI_REV4) |
---|
6074 | | - lpfc_sli4_free_rpi(phba, ndlp->nlp_rpi); |
---|
6075 | 6421 | |
---|
6076 | 6422 | /* free ndlp memory for final ndlp release */ |
---|
6077 | 6423 | if (NLP_CHK_FREE_REQ(ndlp)) { |
---|
.. | .. |
---|
6107 | 6453 | if (!NLP_CHK_NODE_ACT(ndlp) || NLP_CHK_FREE_ACK(ndlp)) { |
---|
6108 | 6454 | spin_unlock_irqrestore(&phba->ndlp_lock, flags); |
---|
6109 | 6455 | lpfc_printf_vlog(ndlp->vport, KERN_WARNING, LOG_NODE, |
---|
6110 | | - "0276 lpfc_nlp_get: ndlp:x%p " |
---|
| 6456 | + "0276 %s: ndlp:x%px " |
---|
6111 | 6457 | "usgmap:x%x refcnt:%d\n", |
---|
6112 | | - (void *)ndlp, ndlp->nlp_usg_map, |
---|
| 6458 | + __func__, (void *)ndlp, ndlp->nlp_usg_map, |
---|
6113 | 6459 | kref_read(&ndlp->kref)); |
---|
6114 | 6460 | return NULL; |
---|
6115 | 6461 | } else |
---|
.. | .. |
---|
6135 | 6481 | return 1; |
---|
6136 | 6482 | |
---|
6137 | 6483 | lpfc_debugfs_disc_trc(ndlp->vport, LPFC_DISC_TRC_NODE, |
---|
6138 | | - "node put: did:x%x flg:x%x refcnt:x%x", |
---|
6139 | | - ndlp->nlp_DID, ndlp->nlp_flag, |
---|
6140 | | - kref_read(&ndlp->kref)); |
---|
| 6484 | + "node put: did:x%x flg:x%x refcnt:x%x", |
---|
| 6485 | + ndlp->nlp_DID, ndlp->nlp_flag, |
---|
| 6486 | + kref_read(&ndlp->kref)); |
---|
6141 | 6487 | phba = ndlp->phba; |
---|
6142 | 6488 | spin_lock_irqsave(&phba->ndlp_lock, flags); |
---|
6143 | 6489 | /* Check the ndlp memory free acknowledge flag to avoid the |
---|
.. | .. |
---|
6147 | 6493 | if (NLP_CHK_FREE_ACK(ndlp)) { |
---|
6148 | 6494 | spin_unlock_irqrestore(&phba->ndlp_lock, flags); |
---|
6149 | 6495 | lpfc_printf_vlog(ndlp->vport, KERN_WARNING, LOG_NODE, |
---|
6150 | | - "0274 lpfc_nlp_put: ndlp:x%p " |
---|
| 6496 | + "0274 %s: ndlp:x%px " |
---|
6151 | 6497 | "usgmap:x%x refcnt:%d\n", |
---|
6152 | | - (void *)ndlp, ndlp->nlp_usg_map, |
---|
| 6498 | + __func__, (void *)ndlp, ndlp->nlp_usg_map, |
---|
6153 | 6499 | kref_read(&ndlp->kref)); |
---|
6154 | 6500 | return 1; |
---|
6155 | 6501 | } |
---|
.. | .. |
---|
6160 | 6506 | if (NLP_CHK_IACT_REQ(ndlp)) { |
---|
6161 | 6507 | spin_unlock_irqrestore(&phba->ndlp_lock, flags); |
---|
6162 | 6508 | lpfc_printf_vlog(ndlp->vport, KERN_WARNING, LOG_NODE, |
---|
6163 | | - "0275 lpfc_nlp_put: ndlp:x%p " |
---|
| 6509 | + "0275 %s: ndlp:x%px " |
---|
6164 | 6510 | "usgmap:x%x refcnt:%d\n", |
---|
6165 | | - (void *)ndlp, ndlp->nlp_usg_map, |
---|
| 6511 | + __func__, (void *)ndlp, ndlp->nlp_usg_map, |
---|
6166 | 6512 | kref_read(&ndlp->kref)); |
---|
6167 | 6513 | return 1; |
---|
6168 | 6514 | } |
---|
.. | .. |
---|
6252 | 6598 | goto out; |
---|
6253 | 6599 | } else if (ndlp->nlp_flag & NLP_RPI_REGISTERED) { |
---|
6254 | 6600 | ret = 1; |
---|
6255 | | - lpfc_printf_log(phba, KERN_INFO, LOG_ELS, |
---|
| 6601 | + lpfc_printf_log(phba, KERN_INFO, |
---|
| 6602 | + LOG_NODE | LOG_DISCOVERY, |
---|
6256 | 6603 | "2624 RPI %x DID %x flag %x " |
---|
6257 | 6604 | "still logged in\n", |
---|
6258 | 6605 | ndlp->nlp_rpi, ndlp->nlp_DID, |
---|
.. | .. |
---|
6280 | 6627 | struct Scsi_Host *shost = lpfc_shost_from_vport(vport); |
---|
6281 | 6628 | |
---|
6282 | 6629 | if (mboxq->u.mb.mbxStatus) { |
---|
6283 | | - lpfc_printf_log(phba, KERN_ERR, LOG_DISCOVERY|LOG_MBOX, |
---|
6284 | | - "2555 UNREG_VFI mbxStatus error x%x " |
---|
6285 | | - "HBA state x%x\n", |
---|
6286 | | - mboxq->u.mb.mbxStatus, vport->port_state); |
---|
| 6630 | + lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, |
---|
| 6631 | + "2555 UNREG_VFI mbxStatus error x%x " |
---|
| 6632 | + "HBA state x%x\n", |
---|
| 6633 | + mboxq->u.mb.mbxStatus, vport->port_state); |
---|
6287 | 6634 | } |
---|
6288 | 6635 | spin_lock_irq(shost->host_lock); |
---|
6289 | 6636 | phba->pport->fc_flag &= ~FC_VFI_REGISTERED; |
---|
.. | .. |
---|
6305 | 6652 | struct lpfc_vport *vport = mboxq->vport; |
---|
6306 | 6653 | |
---|
6307 | 6654 | if (mboxq->u.mb.mbxStatus) { |
---|
6308 | | - lpfc_printf_log(phba, KERN_ERR, LOG_DISCOVERY|LOG_MBOX, |
---|
6309 | | - "2550 UNREG_FCFI mbxStatus error x%x " |
---|
6310 | | - "HBA state x%x\n", |
---|
6311 | | - mboxq->u.mb.mbxStatus, vport->port_state); |
---|
| 6655 | + lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, |
---|
| 6656 | + "2550 UNREG_FCFI mbxStatus error x%x " |
---|
| 6657 | + "HBA state x%x\n", |
---|
| 6658 | + mboxq->u.mb.mbxStatus, vport->port_state); |
---|
6312 | 6659 | } |
---|
6313 | 6660 | mempool_free(mboxq, phba->mbox_mem_pool); |
---|
6314 | 6661 | return; |
---|
.. | .. |
---|
6397 | 6744 | |
---|
6398 | 6745 | mbox = mempool_alloc(phba->mbox_mem_pool, GFP_KERNEL); |
---|
6399 | 6746 | if (!mbox) { |
---|
6400 | | - lpfc_printf_log(phba, KERN_ERR, LOG_DISCOVERY|LOG_MBOX, |
---|
| 6747 | + lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, |
---|
6401 | 6748 | "2551 UNREG_FCFI mbox allocation failed" |
---|
6402 | 6749 | "HBA state x%x\n", phba->pport->port_state); |
---|
6403 | 6750 | return -ENOMEM; |
---|
.. | .. |
---|
6408 | 6755 | rc = lpfc_sli_issue_mbox(phba, mbox, MBX_NOWAIT); |
---|
6409 | 6756 | |
---|
6410 | 6757 | if (rc == MBX_NOT_FINISHED) { |
---|
6411 | | - lpfc_printf_log(phba, KERN_ERR, LOG_SLI, |
---|
| 6758 | + lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, |
---|
6412 | 6759 | "2552 Unregister FCFI command failed rc x%x " |
---|
6413 | 6760 | "HBA state x%x\n", |
---|
6414 | 6761 | rc, phba->pport->port_state); |
---|
.. | .. |
---|
6432 | 6779 | /* Preparation for unregistering fcf */ |
---|
6433 | 6780 | rc = lpfc_unregister_fcf_prep(phba); |
---|
6434 | 6781 | if (rc) { |
---|
6435 | | - lpfc_printf_log(phba, KERN_ERR, LOG_DISCOVERY, |
---|
| 6782 | + lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, |
---|
6436 | 6783 | "2748 Failed to prepare for unregistering " |
---|
6437 | 6784 | "HBA's FCF record: rc=%d\n", rc); |
---|
6438 | 6785 | return; |
---|
.. | .. |
---|
6468 | 6815 | spin_lock_irq(&phba->hbalock); |
---|
6469 | 6816 | phba->fcf.fcf_flag &= ~FCF_INIT_DISC; |
---|
6470 | 6817 | spin_unlock_irq(&phba->hbalock); |
---|
6471 | | - lpfc_printf_log(phba, KERN_ERR, LOG_DISCOVERY|LOG_MBOX, |
---|
| 6818 | + lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, |
---|
6472 | 6819 | "2553 lpfc_unregister_unused_fcf failed " |
---|
6473 | 6820 | "to read FCF record HBA state x%x\n", |
---|
6474 | 6821 | phba->pport->port_state); |
---|
.. | .. |
---|
6490 | 6837 | /* Preparation for unregistering fcf */ |
---|
6491 | 6838 | rc = lpfc_unregister_fcf_prep(phba); |
---|
6492 | 6839 | if (rc) { |
---|
6493 | | - lpfc_printf_log(phba, KERN_ERR, LOG_DISCOVERY, |
---|
| 6840 | + lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, |
---|
6494 | 6841 | "2749 Failed to prepare for unregistering " |
---|
6495 | 6842 | "HBA's FCF record: rc=%d\n", rc); |
---|
6496 | 6843 | return; |
---|
.. | .. |
---|
6577 | 6924 | conn_entry = kzalloc(sizeof(struct lpfc_fcf_conn_entry), |
---|
6578 | 6925 | GFP_KERNEL); |
---|
6579 | 6926 | if (!conn_entry) { |
---|
6580 | | - lpfc_printf_log(phba, KERN_ERR, LOG_INIT, |
---|
6581 | | - "2566 Failed to allocate connection" |
---|
6582 | | - " table entry\n"); |
---|
| 6927 | + lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, |
---|
| 6928 | + "2566 Failed to allocate connection" |
---|
| 6929 | + " table entry\n"); |
---|
6583 | 6930 | return; |
---|
6584 | 6931 | } |
---|
6585 | 6932 | |
---|
.. | .. |
---|
6723 | 7070 | |
---|
6724 | 7071 | /* Check the region signature first */ |
---|
6725 | 7072 | if (memcmp(buff, LPFC_REGION23_SIGNATURE, 4)) { |
---|
6726 | | - lpfc_printf_log(phba, KERN_ERR, LOG_INIT, |
---|
| 7073 | + lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, |
---|
6727 | 7074 | "2567 Config region 23 has bad signature\n"); |
---|
6728 | 7075 | return; |
---|
6729 | 7076 | } |
---|
.. | .. |
---|
6732 | 7079 | |
---|
6733 | 7080 | /* Check the data structure version */ |
---|
6734 | 7081 | if (buff[offset] != LPFC_REGION23_VERSION) { |
---|
6735 | | - lpfc_printf_log(phba, KERN_ERR, LOG_INIT, |
---|
6736 | | - "2568 Config region 23 has bad version\n"); |
---|
| 7082 | + lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, |
---|
| 7083 | + "2568 Config region 23 has bad version\n"); |
---|
6737 | 7084 | return; |
---|
6738 | 7085 | } |
---|
6739 | 7086 | offset += 4; |
---|