23 #include <linux/pci.h>
24 #include <linux/slab.h>
27 #include <scsi/scsi.h>
55 static int lpfc_max_els_tries = 3;
92 if (lpfc_readl(phba->
HAregaddr, &ha_copy))
100 "0237 Pending Link Event during "
101 "Discovery: State x%x\n",
102 phba->
pport->port_state);
161 if (!lpfc_is_link_up(phba))
199 icmd = &elsiocb->
iocb;
206 if (!pcmd || !pcmd->
virt)
207 goto els_iocb_free_pcmb_exit;
209 INIT_LIST_HEAD(&pcmd->
list);
217 if (!prsp || !prsp->
virt)
218 goto els_iocb_free_prsp_exit;
219 INIT_LIST_HEAD(&prsp->
list);
228 if (!pbuflist || !pbuflist->
virt)
229 goto els_iocb_free_pbuf_exit;
231 INIT_LIST_HEAD(&pbuflist->
list);
247 icmd->
un.
xseq64.xmit_els_remoteID = did;
281 bpl->
tus.
f.bdeSize = cmdSize;
282 bpl->
tus.
f.bdeFlags = 0;
297 goto els_iocb_free_pbuf_exit;
301 elsiocb->
vport = vport;
310 "0116 Xmit ELS command x%x to remote "
311 "NPORT x%x I/O tag: x%x, port state: x%x\n",
312 elscmd, did, elsiocb->
iotag,
317 "0117 Xmit ELS response x%x to remote "
318 "NPORT x%x I/O tag: x%x, size: x%x\n",
324 els_iocb_free_pbuf_exit:
329 els_iocb_free_prsp_exit:
333 els_iocb_free_pcmb_exit:
412 goto fail_issue_reg_login;
417 fail_issue_reg_login:
431 "0249 Cannot issue Register Fabric login: Err %d\n", err);
476 goto fail_free_dmabuf;
482 goto fail_free_coherent;
488 mboxq->
vport = vport;
506 "0289 Issue Register VFI failed: Err %d\n", rc);
532 "2556 UNREG_VFI mbox allocation failed"
533 "HBA state x%x\n", phba->
pport->port_state);
538 mboxq->
vport = vport;
544 "2557 UNREG_VFI issue mbox failed rc x%x "
546 rc, phba->
pport->port_state);
551 shost = lpfc_shost_from_vport(vport);
580 uint8_t fabric_param_changed = 0;
588 fabric_param_changed = 1;
600 if (fabric_param_changed && !sp->
cmn.clean_address_bit &&
607 return fabric_param_changed;
635 struct Scsi_Host *shost = lpfc_shost_from_vport(vport);
646 if (sp->
cmn.edtovResolution)
662 if (sp->
cls1.classValid)
664 if (sp->
cls2.classValid)
666 if (sp->
cls3.classValid)
668 if (sp->
cls4.classValid)
671 sp->
cmn.bbRcvSizeLsb;
673 fabric_param_changed = lpfc_check_clean_addr_bit(vport, sp);
681 if (sp->
cmn.response_multiple_NPort) {
684 "1816 FLOGI NPIV supported, "
685 "response data 0x%x\n",
686 sp->
cmn.response_multiple_NPort);
689 spin_unlock_irq(&phba->
hbalock);
695 "1817 Fabric does not support NPIV "
696 "- configuring single port mode.\n");
699 spin_unlock_irq(&phba->
hbalock);
703 if (fabric_param_changed &&
767 "3135 Need register VFI: (x%x/%x)\n",
799 struct Scsi_Host *shost = lpfc_shost_from_vport(vport);
933 struct Scsi_Host *shost = lpfc_shost_from_vport(vport);
951 "FLOGI cmpl: status:x%x/x%x state:x%x",
963 goto stop_rr_fcf_flogi;
969 goto stop_rr_fcf_flogi;
974 "2611 FLOGI failed on FCF (x%x), "
975 "status:x%x/x%x, tmo:x%x, perform "
976 "roundrobin FCF failover\n",
977 phba->
fcf.current_rec.fcf_indx,
981 phba->
fcf.current_rec.fcf_indx);
991 "2858 FLOGI failure Status:x%x/x%x TMO:x%x\n",
996 if (lpfc_els_retry(phba, cmdiocb, rspiocb))
1001 "0100 FLOGI failure Status:x%x/x%x TMO:x%x\n",
1038 sp = prsp->virt +
sizeof(
uint32_t);
1042 "0101 FLOGI completes successfully "
1043 "Data: x%x x%x x%x x%x\n",
1045 sp->
cmn.w2.r_a_tov, sp->
cmn.edtovResolution);
1053 rc = lpfc_cmpl_els_flogi_fabric(vport, ndlp, sp, irsp);
1055 rc = lpfc_cmpl_els_flogi_nport(vport, ndlp, sp);
1059 "2831 FLOGI response with cleared Fabric "
1060 "bit fcf_index 0x%x "
1061 "Switch Name %02x%02x%02x%02x%02x%02x%02x%02x "
1063 "%02x%02x%02x%02x%02x%02x%02x%02x\n",
1064 phba->
fcf.current_rec.fcf_indx,
1065 phba->
fcf.current_rec.switch_name[0],
1066 phba->
fcf.current_rec.switch_name[1],
1067 phba->
fcf.current_rec.switch_name[2],
1068 phba->
fcf.current_rec.switch_name[3],
1069 phba->
fcf.current_rec.switch_name[4],
1070 phba->
fcf.current_rec.switch_name[5],
1071 phba->
fcf.current_rec.switch_name[6],
1072 phba->
fcf.current_rec.switch_name[7],
1073 phba->
fcf.current_rec.fabric_name[0],
1074 phba->
fcf.current_rec.fabric_name[1],
1075 phba->
fcf.current_rec.fabric_name[2],
1076 phba->
fcf.current_rec.fabric_name[3],
1077 phba->
fcf.current_rec.fabric_name[4],
1078 phba->
fcf.current_rec.fabric_name[5],
1079 phba->
fcf.current_rec.fabric_name[6],
1080 phba->
fcf.current_rec.fabric_name[7]);
1082 spin_lock_irq(&phba->
hbalock);
1085 spin_unlock_irq(&phba->
hbalock);
1093 "2769 FLOGI to FCF (x%x) "
1094 "completed successfully\n",
1095 phba->
fcf.current_rec.fcf_indx);
1096 spin_lock_irq(&phba->
hbalock);
1099 spin_unlock_irq(&phba->
hbalock);
1107 if (!lpfc_error_lost_link(irsp)) {
1171 icmd = &elsiocb->
iocb;
1181 sp->
cmn.e_d_tov = 0;
1182 sp->
cmn.w2.r_a_tov = 0;
1183 sp->
cmn.virtual_fabric_support = 0;
1184 sp->
cls1.classValid = 0;
1185 sp->
cls2.seqDelivery = 1;
1186 sp->
cls3.seqDelivery = 1;
1203 sp->
cmn.request_multiple_Nport = 1;
1208 sp->
cmn.request_multiple_Nport = 0;
1222 elsiocb->
iocb_cmpl = lpfc_cmpl_els_flogi;
1225 "Issue FLOGI: opt:x%x",
1228 rc = lpfc_issue_fabric_iocb(phba, elsiocb);
1260 "0201 Abort outstanding I/O on NPort x%x\n",
1269 spin_lock_irq(&phba->
hbalock);
1279 spin_unlock_irq(&phba->
hbalock);
1328 if (lpfc_issue_els_flogi(vport, ndlp, 0)) {
1377 if (lpfc_issue_els_fdisc(vport, ndlp, 0)) {
1408 "0232 Continue discovery with %d PLOGIs to go "
1409 "Data: x%x x%x x%x\n",
1485 "3178 PLOGI confirm: ndlp %p x%x: new_ndlp %p\n",
1486 ndlp, ndlp->
nlp_DID, new_ndlp);
1540 "3179 PLOGI confirm NEW: %x %x\n",
1544 rport = ndlp->
rport;
1547 if (rdata->
pnode == ndlp) {
1575 "3180 PLOGI confirm SWAP: %x %x\n",
1603 rport = ndlp->
rport;
1633 struct Scsi_Host *shost = lpfc_shost_from_vport(vport);
1676 irsp = &rspiocb->
iocb;
1678 "RRQ cmpl: status:x%x/x%x did:x%x",
1685 "2882 RRQ completes to NPort x%x "
1686 "with no ndlp. Data: x%x x%x x%x\n",
1695 "2880 RRQ completes to NPort x%x "
1696 "Data: x%x x%x x%x x%x x%x\n",
1706 (phba)->pport->cfg_log_verbose &
LOG_ELS)
1708 "2881 RRQ failure DID:%06X Status:x%x/x%x\n",
1743 struct Scsi_Host *shost = lpfc_shost_from_vport(vport);
1752 irsp = &rspiocb->
iocb;
1754 "PLOGI cmpl: status:x%x/x%x did:x%x",
1761 "0136 PLOGI completes to NPort x%x "
1762 "with no ndlp. Data: x%x x%x x%x\n",
1780 "0102 PLOGI completes to NPort x%x "
1781 "Data: x%x x%x x%x x%x x%x\n",
1798 if (lpfc_els_retry(phba, cmdiocb, rspiocb)) {
1811 (phba)->pport->cfg_log_verbose &
LOG_ELS)
1813 "2753 PLOGI failure DID:%06X Status:x%x/x%x\n",
1817 if (lpfc_error_lost_link(irsp))
1827 ndlp = lpfc_plogi_confirm_nport(phba, prsp->
virt, ndlp);
1898 icmd = &elsiocb->
iocb;
1912 sp->
cmn.altBbCredit = 1;
1921 "Issue PLOGI: did:x%x",
1925 elsiocb->
iocb_cmpl = lpfc_cmpl_els_plogi;
1953 struct Scsi_Host *shost = lpfc_shost_from_vport(vport);
1962 irsp = &(rspiocb->
iocb);
1969 "PRLI cmpl: status:x%x/x%x did:x%x",
1974 "0103 PRLI completes to NPort x%x "
1975 "Data: x%x x%x x%x x%x\n",
1986 if (lpfc_els_retry(phba, cmdiocb, rspiocb)) {
1992 "2754 PRLI failure DID:%06X Status:x%x/x%x\n",
1996 if (lpfc_error_lost_link(irsp))
2035 struct Scsi_Host *shost = lpfc_shost_from_vport(vport);
2049 icmd = &elsiocb->
iocb;
2058 npr = (
PRLI *) pcmd;
2063 if (phba->
vpd.
rev.feaLevelHigh >= 0x02) {
2076 "Issue PRLI: did:x%x",
2080 elsiocb->
iocb_cmpl = lpfc_cmpl_els_prli;
2135 struct Scsi_Host *shost = lpfc_shost_from_vport(vport);
2171 lpfc_rscn_disc(vport);
2192 "0210 Continue discovery with %d ADISCs to go "
2193 "Data: x%x x%x x%x\n",
2203 lpfc_adisc_done(vport);
2228 struct Scsi_Host *shost = lpfc_shost_from_vport(vport);
2236 irsp = &(rspiocb->
iocb);
2240 "ADISC cmpl: status:x%x/x%x did:x%x",
2253 "0104 ADISC completes to NPort x%x "
2254 "Data: x%x x%x x%x x%x x%x\n",
2267 if (lpfc_els_retry(phba, cmdiocb, rspiocb)) {
2279 "2755 ADISC failure DID:%06X Status:x%x/x%x\n",
2283 if (!lpfc_error_lost_link(irsp))
2323 struct Scsi_Host *shost = lpfc_shost_from_vport(vport);
2337 icmd = &elsiocb->
iocb;
2345 ap = (
ADISC *) pcmd;
2352 "Issue ADISC: did:x%x",
2356 elsiocb->
iocb_cmpl = lpfc_cmpl_els_adisc;
2389 struct Scsi_Host *shost = lpfc_shost_from_vport(vport);
2393 unsigned long flags;
2400 irsp = &(rspiocb->
iocb);
2406 "LOGO cmpl: status:x%x/x%x did:x%x",
2412 "0105 LOGO completes to NPort x%x "
2413 "Data: x%x x%x x%x x%x\n",
2435 if (lpfc_els_retry(phba, cmdiocb, rspiocb)) {
2442 "2756 LOGO failure DID:%06X Status:x%x/x%x\n",
2446 if (lpfc_error_lost_link(irsp)) {
2460 phba->
pport->fc_myDID = 0;
2483 spin_unlock_irqrestore(shost->
host_lock, flags);
2486 "3187 LOGO completes to NPort x%x: Start "
2487 "Recovery Data: x%x x%x x%x x%x\n",
2520 struct Scsi_Host *shost = lpfc_shost_from_vport(vport);
2541 icmd = &elsiocb->
iocb;
2552 "Issue LOGO: did:x%x",
2572 elsiocb->
iocb_cmpl = lpfc_cmpl_els_logo;
2612 irsp = &rspiocb->
iocb;
2615 "ELS cmd cmpl: status:x%x/x%x did:x%x",
2620 "0106 ELS cmd tag x%x completes Data: x%x x%x x%x\n",
2689 icmd = &elsiocb->
iocb;
2700 "Issue SCR: did:x%x",
2784 icmd = &elsiocb->
iocb;
2791 fp = (
FARP *) (pcmd);
2810 "Issue FARPR: did:x%x",
2847 struct Scsi_Host *shost = lpfc_shost_from_vport(vport);
2907 unsigned long flags;
2912 spin_unlock_irqrestore(&phba->
hbalock, flags);
2925 spin_unlock_irqrestore(&phba->
hbalock, flags);
2942 struct Scsi_Host *shost = lpfc_shost_from_vport(vport);
2968 lpfc_issue_els_flogi(vport, ndlp, retry);
2996 lpfc_issue_els_fdisc(vport, ndlp, retry);
3028 struct Scsi_Host *shost = lpfc_shost_from_vport(vport);
3034 int retry = 0, maxretry = lpfc_max_els_tries,
delay = 0;
3044 if (pcmd && pcmd->virt) {
3045 elscmd = (
uint32_t *) (pcmd->virt);
3061 "Retry ELS: wd7:x%x wd4:x%x did:x%x",
3084 phba->
pport->fc_myDID = 0;
3096 "0124 Retry illegal cmd x%x "
3097 "retry:x%x delay:x%x\n",
3098 cmd, cmdiocb->
retry, delay);
3102 if (cmdiocb->
retry > 2)
3109 if (cmdiocb->
retry > 100)
3145 switch (
stat.un.b.lsRjtRsnCode) {
3147 if (
stat.un.b.lsRjtRsnCodeExp ==
3156 if (
stat.un.b.lsRjtRsnCodeExp ==
3168 maxretry = lpfc_max_els_tries + 1;
3176 "0125 FDISC Failed (x%x). "
3177 "Fabric out of resources\n",
3178 stat.un.lsRjtError);
3192 if (cmdiocb->
retry >= 32)
3217 "0122 FDISC Failed (x%x). "
3218 "Fabric Detected Bad WWN\n",
3219 stat.un.lsRjtError);
3240 !lpfc_error_lost_link(irsp)) {
3245 if (cmdiocb->
retry >= 100)
3247 else if (cmdiocb->
retry >= 32)
3249 }
else if ((cmd ==
ELS_CMD_FDISC) && !lpfc_error_lost_link(irsp)) {
3257 if (maxretry && (cmdiocb->
retry >= maxretry)) {
3258 phba->
fc_stat.elsRetryExceeded++;
3270 "2849 Stop retry ELS command "
3271 "x%x to remote NPORT x%x, "
3272 "Data: x%x x%x\n", cmd, did,
3273 cmdiocb->
retry, delay);
3280 "0107 Retry ELS command x%x to remote "
3281 "NPORT x%x Data: x%x x%x\n",
3282 cmd, did, cmdiocb->
retry, delay);
3298 phba->
fc_stat.elsDelayRetry++;
3321 lpfc_issue_els_flogi(vport, ndlp, cmdiocb->
retry);
3324 lpfc_issue_els_fdisc(vport, ndlp, cmdiocb->
retry);
3354 "0137 No retry ELS command x%x to remote "
3355 "NPORT x%x: Out of Resources: Error:x%x/%x\n",
3361 "0108 No retry ELS command x%x to remote "
3362 "NPORT x%x Retried:%d Error:x%x/%x\n",
3389 if (!list_empty(&buf_ptr1->
list)) {
3485 spin_lock_irq(&phba->
hbalock);
3486 if (!list_empty(&buf_ptr->
list)) {
3490 INIT_LIST_HEAD(&buf_ptr1->
list);
3495 INIT_LIST_HEAD(&buf_ptr->
list);
3498 spin_unlock_irq(&phba->
hbalock);
3502 lpfc_els_free_data(phba, buf_ptr1);
3508 lpfc_els_free_bpl(phba, buf_ptr);
3539 irsp = &rspiocb->
iocb;
3541 "ACC LOGO cmpl: status:x%x/x%x did:x%x",
3545 "0109 ACC to LOGO completes to NPort x%x "
3546 "Data: x%x x%x x%x\n",
3644 struct Scsi_Host *shost = vport ? lpfc_shost_from_vport(vport) :
NULL;
3651 irsp = &rspiocb->
iocb;
3693 "ELS rsp cmpl: status:x%x/x%x did:x%x",
3698 "0110 ELS response tag x%x completes "
3699 "Data: x%x x%x x%x x%x x%x x%x x%x\n",
3712 mbox->
vport = vport;
3734 "0138 ELS rsp: Cannot issue reg_login for x%x "
3735 "Data: x%x x%x x%x\n",
3749 if (!lpfc_error_lost_link(irsp) &&
3823 struct Scsi_Host *shost = lpfc_shost_from_vport(vport);
3835 oldcmd = &oldiocb->
iocb;
3849 icmd = &elsiocb->
iocb;
3857 "Issue ACC: did:x%x flg:x%x",
3861 cmdsize = (
sizeof(
struct serv_parm) + sizeof(uint32_t));
3867 icmd = &elsiocb->
iocb;
3880 "Issue ACC PLOGI: did:x%x flg:x%x",
3890 icmd = &elsiocb->
iocb;
3896 sizeof(uint32_t) +
sizeof(
PRLO));
3898 els_pkt_ptr = (
ELS_PKT *) pcmd;
3902 "Issue ACC PRLO: did:x%x flg:x%x",
3910 "0128 Xmit ELS ACC response tag x%x, XRI: x%x, "
3911 "DID: x%x, nlp_flag: x%x nlp_state: x%x RPI: x%x "
3920 elsiocb->
iocb_cmpl = lpfc_cmpl_els_logo_acc;
3977 icmd = &elsiocb->
iocb;
3978 oldcmd = &oldiocb->
iocb;
3985 *((
uint32_t *) (pcmd)) = rejectError;
3992 "0129 Xmit ELS RJT x%x response tag x%x "
3993 "xri x%x, did x%x, nlp_flag x%x, nlp_state x%x, "
3995 rejectError, elsiocb->
iotag,
3999 "Issue LS_RJT: did:x%x flg:x%x err:x%x",
4050 icmd = &elsiocb->
iocb;
4051 oldcmd = &oldiocb->
iocb;
4057 "0130 Xmit ADISC ACC response iotag x%x xri: "
4058 "x%x, did x%x, nlp_flag x%x, nlp_state x%x rpi x%x\n",
4067 ap = (
ADISC *) (pcmd);
4074 "Issue ACC ADISC: did:x%x flg:x%x",
4129 icmd = &elsiocb->
iocb;
4130 oldcmd = &oldiocb->
iocb;
4136 "0131 Xmit PRLI ACC response tag x%x xri x%x, "
4137 "did x%x, nlp_flag x%x, nlp_state x%x, rpi x%x\n",
4149 npr = (
PRLI *) pcmd;
4156 (vpd->
rev.feaLevelHigh >= 0x02)) {
4171 "Issue ACC PRLI: did:x%x flg:x%x",
4235 icmd = &elsiocb->
iocb;
4236 oldcmd = &oldiocb->
iocb;
4242 "0132 Xmit RNID ACC response tag x%x xri x%x\n",
4249 rn = (
RNID *) (pcmd);
4273 "Issue ACC RNID: did:x%x flg:x%x",
4309 rrq = (
struct RRQ *)pcmd;
4311 rxid =
bf_get(rrq_rxid, rrq);
4314 "2883 Clear RRQ for SID:x%x OXID:x%x RXID:x%x"
4322 "Clear RRQ: did:x%x flg:x%x exchg:x%.08x",
4325 xri =
bf_get(rrq_oxid, rrq);
4374 "2876 Xmit ECHO ACC response tag x%x xri x%x\n",
4382 "Issue ACC ECHO: did:x%x flg:x%x",
4418 struct Scsi_Host *shost = lpfc_shost_from_vport(vport);
4446 if (sentadisc == 0) {
4476 struct Scsi_Host *shost = lpfc_shost_from_vport(vport);
4525 struct Scsi_Host *shost = lpfc_shost_from_vport(vport);
4571 struct Scsi_Host *shost = lpfc_shost_from_vport(vport);
4596 while (payload_len) {
4601 if ((ns_did.
un.
b.domain == rscn_did.
un.
b.domain)
4602 && (ns_did.
un.
b.area == rscn_did.
un.
b.area)
4603 && (ns_did.
un.
b.id == rscn_did.
un.
b.id))
4604 goto return_did_out;
4607 if ((ns_did.
un.
b.domain == rscn_did.
un.
b.domain)
4608 && (ns_did.
un.
b.area == rscn_did.
un.
b.area))
4609 goto return_did_out;
4612 if (ns_did.
un.
b.domain == rscn_did.
un.
b.domain)
4613 goto return_did_out;
4616 goto return_did_out;
4641 lpfc_rscn_recovery_check(
struct lpfc_vport *vport)
4667 lpfc_send_rscn_event(
struct lpfc_vport *vport,
4671 struct Scsi_Host *shost = lpfc_shost_from_vport(vport);
4682 if (!rscn_event_data) {
4684 "0147 Failed to allocate memory for RSCN event\n");
4695 (
char *)rscn_event_data,
4698 kfree(rscn_event_data);
4727 struct Scsi_Host *shost = lpfc_shost_from_vport(vport);
4734 int rscn_id = 0, hba_id = 0;
4737 icmd = &cmdiocb->
iocb;
4745 "0214 RSCN received Data: x%x x%x x%x x%x\n",
4746 vport->
fc_flag, payload_len, *lp,
4750 lpfc_send_rscn_event(vport, cmdiocb);
4752 for (i = 0; i < payload_len/
sizeof(
uint32_t); i++)
4761 "RCV RSCN ignore: did:x%x/ste:x%x flg:x%x",
4783 if (rscn_id == hba_id) {
4787 "Data: x%x x%x x%x x%x\n",
4791 "RCV RSCN vport: did:x%x/ste:x%x flg:x%x",
4820 "RCV RSCN defer: did:x%x/ste:x%x flg:x%x",
4849 "0235 Deferred RSCN "
4850 "Data: x%x x%x x%x\n",
4858 "0234 ReDiscovery RSCN "
4859 "Data: x%x x%x x%x\n",
4868 lpfc_rscn_recovery_check(vport);
4875 "RCV RSCN: did:x%x/ste:x%x flg:x%x",
4893 lpfc_rscn_recovery_check(vport);
4930 "0215 RSCN processed Data: x%x x%x x%x x%x\n",
5014 struct Scsi_Host *shost = lpfc_shost_from_vport(vport);
5039 "0113 An FLOGI ELS command x%x was "
5040 "received from DID x%x in Loop Mode\n",
5065 mbox->
vport = vport;
5068 lpfc_set_loopback_flag(phba);
5079 }
else if (rc > 0) {
5111 stat.un.b.lsRjtRsvd0 = 0;
5114 stat.un.b.vendorUnique = 0;
5148 mbox->
vport = vport;
5188 icmd = &cmdiocb->
iocb;
5202 lpfc_els_rsp_rnid_acc(vport, rn->
Format, cmdiocb, ndlp);
5206 stat.un.b.lsRjtRsvd0 = 0;
5209 stat.un.b.vendorUnique = 0;
5236 lpfc_els_rsp_echo_acc(vport, pcmd, cmdiocb, ndlp);
5260 stat.un.b.lsRjtRsvd0 = 0;
5263 stat.un.b.vendorUnique = 0;
5290 lpfc_els_clear_rrq(vport, cmdiocb, ndlp);
5340 lpfc_max_els_tries, ndlp,
5351 icmd = &elsiocb->iocb;
5358 rls_rsp = (
struct RLS_RSP *)pcmd;
5369 "2874 Xmit ELS RLS ACC response tag x%x xri x%x, "
5370 "did x%x, nlp_flag x%x, nlp_state x%x, rpi x%x\n",
5371 elsiocb->iotag, elsiocb->iocb.ulpContext,
5374 elsiocb->iocb_cmpl = lpfc_cmpl_els_rsp;
5429 lpfc_max_els_tries, ndlp,
5438 icmd = &elsiocb->
iocb;
5464 "0118 Xmit ELS RPS ACC response tag x%x xri x%x, "
5465 "did x%x, nlp_flag x%x, nlp_state x%x, rpi x%x\n",
5513 mbox->
context1 = (
void *)((
unsigned long)
5517 mbox->
vport = vport;
5531 stat.un.b.lsRjtRsvd0 = 0;
5534 stat.un.b.vendorUnique = 0;
5579 lpfc_max_els_tries, ndlp,
5593 rtv_rsp = (
struct RTV_RSP *)pcmd;
5599 bf_set(qtov_rttov, rtv_rsp, 0);
5604 "2875 Xmit ELS RTV ACC response tag x%x xri x%x, "
5605 "did x%x, nlp_flag x%x, nlp_state x%x, rpi x%x, "
5606 "Data: x%x x%x x%x\n",
5607 elsiocb->iotag, elsiocb->iocb.ulpContext,
5611 elsiocb->iocb_cmpl = lpfc_cmpl_els_rsp;
5619 stat.un.b.lsRjtRsvd0 = 0;
5622 stat.un.b.vendorUnique = 0;
5676 mbox->
context1 = (
void *)((
unsigned long)
5680 mbox->
vport = vport;
5696 stat.un.b.lsRjtRsvd0 = 0;
5699 stat.un.b.vendorUnique = 0;
5722 struct RRQ *els_rrq;
5730 if (ndlp != rrq->
ndlp)
5736 cmdsize = (
sizeof(
uint32_t) +
sizeof(
struct RRQ));
5742 icmd = &elsiocb->
iocb;
5748 els_rrq = (
struct RRQ *) pcmd;
5758 "Issue RRQ: did:x%x",
5789 return lpfc_issue_els_rrq(rrq->
vport, ndlp,
5830 icmd = &elsiocb->
iocb;
5831 oldcmd = &oldiocb->
iocb;
5851 "0120 Xmit ELS RPL ACC response tag x%x "
5852 "xri x%x, did x%x, nlp_flag x%x, nlp_state x%x, "
5897 stat.un.b.lsRjtRsvd0 = 0;
5900 stat.un.b.vendorUnique = 0;
5909 rpl = (
RPL *) (lp + 1);
5913 if ((rpl->
index == 0) &&
5920 lpfc_els_rsp_rpl_acc(vport, cmdsize, cmdiocb, ndlp);
5959 icmd = &cmdiocb->
iocb;
5968 "0601 FARP-REQ received from DID x%x\n", did);
6002 lpfc_issue_els_farpr(vport, did, 0);
6031 icmd = &cmdiocb->
iocb;
6039 "0600 FARP-RSP received from DID x%x\n", did);
6077 if ((vport == phba->
pport) &&
6092 "3138 Need register VFI: (x%x/%x)\n",
6117 unsigned long iflag;
6159 spin_lock_irq(&phba->
hbalock);
6160 list_splice_init(&pring->
txcmplq, &txcmplq_completions);
6161 spin_unlock_irq(&phba->
hbalock);
6171 if (piocb->
vport != vport)
6191 remote_ID = 0xffffffff;
6202 spin_lock_irq(&phba->
hbalock);
6203 list_splice(&txcmplq_completions, &pring->
txcmplq);
6204 spin_unlock_irq(&phba->
hbalock);
6208 "0127 ELS timeout Data: x%x x%x x%x "
6209 "x%x\n", els_command,
6211 spin_lock_irq(&phba->
hbalock);
6212 list_del_init(&piocb->
dlist);
6214 spin_unlock_irq(&phba->
hbalock);
6250 lpfc_fabric_abort_vport(vport);
6252 spin_lock_irq(&phba->
hbalock);
6267 if (piocb->
vport != vport)
6270 list_move_tail(&piocb->
list, &completions);
6279 if (piocb->
vport != vport)
6284 spin_unlock_irq(&phba->
hbalock);
6319 spin_lock_irq(&phba->
hbalock);
6330 list_move_tail(&piocb->
list, &completions);
6338 spin_unlock_irq(&phba->
hbalock);
6362 struct Scsi_Host *shost = lpfc_shost_from_vport(vport);
6388 sizeof(lsrjt_event),
6389 (
char *)&lsrjt_event,
6406 sizeof(fabric_event),
6407 (
char *)&fabric_event,
6424 lpfc_send_els_event(
struct lpfc_vport *vport,
6430 struct Scsi_Host *shost = lpfc_shost_from_vport(vport);
6436 "0148 Failed to allocate memory "
6437 "for LOGO event\n");
6440 els_data = &logo_data->
header;
6446 "0149 Failed to allocate memory "
6519 if (!vport || !(elsiocb->
context2))
6531 "RCV Unsol ELS: status:x%x/x%x did:x%x",
6582 elsiocb->
vport = vport;
6589 "0112 ELS command x%x received from NPORT x%x "
6594 "RCV PLOGI: did:x%x/ste:x%x flg:x%x",
6598 ndlp = lpfc_plogi_confirm_nport(phba, payload, ndlp);
6600 lpfc_send_els_event(vport, ndlp, payload);
6619 shost = lpfc_shost_from_vport(vport);
6630 "RCV FLOGI: did:x%x/ste:x%x flg:x%x",
6634 lpfc_els_rcv_flogi(vport, elsiocb, ndlp);
6640 "RCV LOGO: did:x%x/ste:x%x flg:x%x",
6644 lpfc_send_els_event(vport, ndlp, payload);
6653 "RCV PRLO: did:x%x/ste:x%x flg:x%x",
6657 lpfc_send_els_event(vport, ndlp, payload);
6666 lpfc_els_rcv_rscn(vport, elsiocb, ndlp);
6672 "RCV ADISC: did:x%x/ste:x%x flg:x%x",
6675 lpfc_send_els_event(vport, ndlp, payload);
6686 "RCV PDISC: did:x%x/ste:x%x flg:x%x",
6699 "RCV FARPR: did:x%x/ste:x%x flg:x%x",
6703 lpfc_els_rcv_farpr(vport, elsiocb, ndlp);
6707 "RCV FARP: did:x%x/ste:x%x flg:x%x",
6711 lpfc_els_rcv_farp(vport, elsiocb, ndlp);
6715 "RCV FAN: did:x%x/ste:x%x flg:x%x",
6719 lpfc_els_rcv_fan(vport, elsiocb, ndlp);
6723 "RCV PRLI: did:x%x/ste:x%x flg:x%x",
6735 "RCV LIRR: did:x%x/ste:x%x flg:x%x",
6739 lpfc_els_rcv_lirr(vport, elsiocb, ndlp);
6745 "RCV RLS: did:x%x/ste:x%x flg:x%x",
6749 lpfc_els_rcv_rls(vport, elsiocb, ndlp);
6755 "RCV RPS: did:x%x/ste:x%x flg:x%x",
6759 lpfc_els_rcv_rps(vport, elsiocb, ndlp);
6765 "RCV RPL: did:x%x/ste:x%x flg:x%x",
6769 lpfc_els_rcv_rpl(vport, elsiocb, ndlp);
6775 "RCV RNID: did:x%x/ste:x%x flg:x%x",
6779 lpfc_els_rcv_rnid(vport, elsiocb, ndlp);
6785 "RCV RTV: did:x%x/ste:x%x flg:x%x",
6788 lpfc_els_rcv_rtv(vport, elsiocb, ndlp);
6794 "RCV RRQ: did:x%x/ste:x%x flg:x%x",
6798 lpfc_els_rcv_rrq(vport, elsiocb, ndlp);
6804 "RCV ECHO: did:x%x/ste:x%x flg:x%x",
6808 lpfc_els_rcv_echo(vport, elsiocb, ndlp);
6814 "RCV ELS cmd: cmd:x%x did:x%x/ste:x%x",
6822 "0115 Unknown ELS command x%x "
6823 "received from NPORT x%x\n", cmd, did);
6832 stat.un.b.lsRjtRsnCode = rjt_err;
6845 "0111 Dropping received ELS cmd "
6846 "Data: x%x x%x x%x\n",
6893 vport = phba->
pport;
6917 lpfc_els_unsol_buffer(phba, pring, vport, elsiocb);
6931 lpfc_els_unsol_buffer(phba, pring, vport, elsiocb);
6957 struct Scsi_Host *shost = lpfc_shost_from_vport(vport);
6983 "0251 NameServer login: no memory\n");
6996 "0348 NameServer login: node freed\n");
7007 "0252 Cannot issue NameServer login\n");
7055 struct Scsi_Host *shost = lpfc_shost_from_vport(vport);
7066 "0915 Register VPI failed : Status: x%x"
7071 goto mbox_err_exit ;
7097 "2732 Failed to issue INIT_VPI"
7098 " mailbox command\n");
7123 if (vport == phba->
pport) {
7161 struct Scsi_Host *shost = lpfc_shost_from_vport(vport);
7167 mbox->
vport = vport;
7169 mbox->
mbox_cmpl = lpfc_cmpl_reg_new_vport;
7179 "0253 Register VPI: Can't send mbox\n");
7184 "0254 Register VPI: no memory\n");
7251 shost = lpfc_shost_from_vport(phba->
pport);
7271 lpfc_fabric_login_reqd(
struct lpfc_hba *phba,
7308 struct Scsi_Host *shost = lpfc_shost_from_vport(vport);
7319 "0123 FDISC completes. x%x/x%x prevDID: x%x\n",
7331 "FDISC cmpl: status:x%x/x%x prevdid:x%x",
7336 if (lpfc_fabric_login_reqd(phba, cmdiocb, rspiocb)) {
7342 if (lpfc_els_retry(phba, cmdiocb, rspiocb))
7346 "0126 FDISC failed. (x%x/x%x)\n",
7362 fabric_param_changed = lpfc_check_clean_addr_bit(vport, sp);
7367 if (fabric_param_changed &&
7464 "0255 Issue FDISC: no IOCB\n");
7468 icmd = &elsiocb->
iocb;
7487 sp->
cmn.e_d_tov = 0;
7488 sp->
cmn.w2.r_a_tov = 0;
7489 sp->
cmn.virtual_fabric_support = 0;
7490 sp->
cls1.classValid = 0;
7491 sp->
cls2.seqDelivery = 1;
7492 sp->
cls3.seqDelivery = 1;
7506 elsiocb->
iocb_cmpl = lpfc_cmpl_els_fdisc;
7509 "Issue FDISC: did:x%x",
7512 rc = lpfc_issue_fabric_iocb(phba, elsiocb);
7517 "0256 Issue FDISC: Cannot send IOCB\n");
7545 struct Scsi_Host *shost = lpfc_shost_from_vport(vport);
7548 irsp = &rspiocb->
iocb;
7550 "LOGO npiv cmpl: status:x%x/x%x did:x%x",
7561 "2928 NPIV LOGO completes to NPort x%x "
7562 "Data: x%x x%x x%x x%x\n",
7592 struct Scsi_Host *shost = lpfc_shost_from_vport(vport);
7605 icmd = &elsiocb->
iocb;
7616 "Issue LOGO npiv did:x%x flg:x%x",
7619 elsiocb->
iocb_cmpl = lpfc_cmpl_els_npiv_logo;
7649 unsigned long iflags;
7656 spin_unlock_irqrestore(&phba->
pport->work_port_lock, iflags);
7674 lpfc_resume_fabric_iocbs(
struct lpfc_hba *phba)
7677 unsigned long iflags;
7692 spin_unlock_irqrestore(&phba->
hbalock, iflags);
7695 iocb->
iocb_cmpl = lpfc_cmpl_fabric_iocb;
7699 "Fabric sched1: ste:x%x",
7700 iocb->
vport->port_state, 0, 0);
7735 lpfc_resume_fabric_iocbs(phba);
7749 lpfc_block_fabric_iocbs(
struct lpfc_hba *phba)
7787 lpfc_block_fabric_iocbs(phba);
7793 lpfc_block_fabric_iocbs(phba);
7797 stat.un.lsRjtError =
7801 lpfc_block_fabric_iocbs(phba);
7811 cmdiocb->
iocb_cmpl(phba, cmdiocb, rspiocb);
7816 lpfc_resume_fabric_iocbs(phba);
7847 unsigned long iflags;
7861 spin_unlock_irqrestore(&phba->
hbalock, iflags);
7864 iocb->
iocb_cmpl = lpfc_cmpl_fabric_iocb;
7868 "Fabric sched2: ste:x%x",
7869 iocb->
vport->port_state, 0, 0);
7882 spin_unlock_irqrestore(&phba->
hbalock, iflags);
7899 static void lpfc_fabric_abort_vport(
struct lpfc_vport *vport)
7905 spin_lock_irq(&phba->
hbalock);
7909 if (piocb->
vport != vport)
7912 list_move_tail(&piocb->
list, &completions);
7914 spin_unlock_irq(&phba->
hbalock);
7939 spin_lock_irq(&phba->
hbalock);
7944 list_move_tail(&piocb->
list, &completions);
7947 spin_unlock_irq(&phba->
hbalock);
7969 spin_lock_irq(&phba->
hbalock);
7971 spin_unlock_irq(&phba->
hbalock);
7990 unsigned long iflag = 0;
7993 spin_lock(&phba->
sli4_hba.abts_sgl_list_lock);
7996 if (sglq_entry->
ndlp && sglq_entry->
ndlp->vport == vport)
7999 spin_unlock(&phba->
sli4_hba.abts_sgl_list_lock);
8000 spin_unlock_irqrestore(&phba->
hbalock, iflag);
8021 unsigned long iflag = 0;
8026 spin_lock(&phba->
sli4_hba.abts_sgl_list_lock);
8031 ndlp = sglq_entry->
ndlp;
8036 spin_unlock(&phba->
sli4_hba.abts_sgl_list_lock);
8037 spin_unlock_irqrestore(&phba->
hbalock, iflag);
8048 spin_unlock(&phba->
sli4_hba.abts_sgl_list_lock);
8051 spin_unlock_irqrestore(&phba->
hbalock, iflag);
8055 if (!sglq_entry || (sglq_entry->
sli4_xritag != xri)) {
8056 spin_unlock_irqrestore(&phba->
hbalock, iflag);
8060 spin_unlock_irqrestore(&phba->
hbalock, iflag);
8079 unsigned long flags = 0;
8081 shost = lpfc_shost_from_vport(vport);
8085 LOG_SLI,
"3093 No rport recovery needed. "
8086 "rport in state 0x%x\n", ndlp->
nlp_state);
8090 "3094 Start rport recovery on shost id 0x%x "
8091 "fc_id 0x%06x vpi 0x%x rpi 0x%x state 0x%x "
8102 spin_unlock_irqrestore(shost->
host_lock, flags);