Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge patch series "Update lpfc to revision 14.4.0.5"

Justin Tee <justintee8345@gmail.com> says:

Update lpfc to revision 14.4.0.5

This patch set contains bug fixes related to HBA state clean ups, FCP
discovery on older adapters, kref imbalances, log message improvements,
and support for a new diagnostic loopback testing mode.

The patches were cut against Martin's 6.12/scsi-queue tree.

Link: https://lore.kernel.org/r/20240912232447.45607-1-justintee8345@gmail.com
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>

+226 -99
+3
drivers/scsi/lpfc/lpfc_bsg.c
··· 3208 3208 cmdiocbq->num_bdes = num_bde; 3209 3209 cmdiocbq->cmd_flag |= LPFC_IO_LIBDFC; 3210 3210 cmdiocbq->cmd_flag |= LPFC_IO_LOOPBACK; 3211 + if (phba->cfg_vmid_app_header) 3212 + cmdiocbq->cmd_flag |= LPFC_IO_VMID; 3213 + 3211 3214 cmdiocbq->vport = phba->pport; 3212 3215 cmdiocbq->cmd_cmpl = NULL; 3213 3216 cmdiocbq->bpl_dmabuf = txbmp;
+17 -5
drivers/scsi/lpfc/lpfc_ct.c
··· 1572 1572 } 1573 1573 } 1574 1574 } else 1575 - lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT, 1576 - "3065 GFT_ID failed x%08x\n", ulp_status); 1575 + lpfc_vlog_msg(vport, KERN_WARNING, LOG_DISCOVERY, 1576 + "3065 GFT_ID status x%08x\n", ulp_status); 1577 1577 1578 1578 out: 1579 1579 lpfc_ct_free_iocb(phba, cmdiocb); ··· 1647 1647 } 1648 1648 1649 1649 out: 1650 + /* If the caller wanted a synchronous DA_ID completion, signal the 1651 + * wait obj and clear flag to reset the vport. 1652 + */ 1653 + if (ndlp->save_flags & NLP_WAIT_FOR_DA_ID) { 1654 + if (ndlp->da_id_waitq) 1655 + wake_up(ndlp->da_id_waitq); 1656 + } 1657 + 1658 + spin_lock_irq(&ndlp->lock); 1659 + ndlp->save_flags &= ~NLP_WAIT_FOR_DA_ID; 1660 + spin_unlock_irq(&ndlp->lock); 1661 + 1650 1662 lpfc_ct_free_iocb(phba, cmdiocb); 1651 1663 lpfc_nlp_put(ndlp); 1652 1664 return; ··· 2258 2246 } 2259 2247 2260 2248 lpfc_printf_vlog(vport, KERN_INFO, LOG_DISCOVERY, 2261 - "0229 FDMI cmd %04x failed, latt = %d " 2249 + "0229 FDMI cmd %04x latt = %d " 2262 2250 "ulp_status: x%x, rid x%x\n", 2263 2251 be16_to_cpu(fdmi_cmd), latt, ulp_status, 2264 2252 ulp_word4); ··· 2275 2263 /* Check for a CT LS_RJT response */ 2276 2264 cmd = be16_to_cpu(fdmi_cmd); 2277 2265 if (be16_to_cpu(fdmi_rsp) == SLI_CT_RESPONSE_FS_RJT) { 2278 - /* FDMI rsp failed */ 2266 + /* Log FDMI reject */ 2279 2267 lpfc_printf_vlog(vport, KERN_INFO, LOG_DISCOVERY | LOG_ELS, 2280 - "0220 FDMI cmd failed FS_RJT Data: x%x", cmd); 2268 + "0220 FDMI cmd FS_RJT Data: x%x", cmd); 2281 2269 2282 2270 /* Should we fallback to FDMI-2 / FDMI-1 ? */ 2283 2271 switch (cmd) {
+7
drivers/scsi/lpfc/lpfc_disc.h
··· 90 90 NLP_IN_RECOV_POST_DEV_LOSS = 0x1, 91 91 /* wait for outstanding LOGO to cmpl */ 92 92 NLP_WAIT_FOR_LOGO = 0x2, 93 + /* wait for outstanding DA_ID to finish */ 94 + NLP_WAIT_FOR_DA_ID = 0x4 93 95 }; 94 96 95 97 struct lpfc_nodelist { ··· 161 159 uint32_t nvme_fb_size; /* NVME target's supported byte cnt */ 162 160 #define NVME_FB_BIT_SHIFT 9 /* PRLI Rsp first burst in 512B units. */ 163 161 uint32_t nlp_defer_did; 162 + 163 + /* These wait objects are NPIV specific. These IOs must complete 164 + * synchronously. 165 + */ 164 166 wait_queue_head_t *logo_waitq; 167 + wait_queue_head_t *da_id_waitq; 165 168 }; 166 169 167 170 struct lpfc_node_rrq {
+63 -69
drivers/scsi/lpfc/lpfc_els.c
··· 979 979 phba->fcoe_cvl_eventtag_attn = 980 980 phba->fcoe_cvl_eventtag; 981 981 lpfc_printf_log(phba, KERN_WARNING, LOG_FIP | LOG_ELS, 982 - "2611 FLOGI failed on FCF (x%x), " 982 + "2611 FLOGI FCF (x%x), " 983 983 "status:x%x/x%x, tmo:x%x, perform " 984 984 "roundrobin FCF failover\n", 985 985 phba->fcf.current_rec.fcf_indx, ··· 997 997 if (!(ulp_status == IOSTAT_LOCAL_REJECT && 998 998 ((ulp_word4 & IOERR_PARAM_MASK) == 999 999 IOERR_LOOP_OPEN_FAILURE))) 1000 - lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT, 1001 - "2858 FLOGI failure Status:x%x/x%x TMO" 1002 - ":x%x Data x%lx x%x\n", 1003 - ulp_status, ulp_word4, tmo, 1004 - phba->hba_flag, phba->fcf.fcf_flag); 1000 + lpfc_vlog_msg(vport, KERN_WARNING, LOG_ELS, 1001 + "2858 FLOGI Status:x%x/x%x TMO" 1002 + ":x%x Data x%lx x%x\n", 1003 + ulp_status, ulp_word4, tmo, 1004 + phba->hba_flag, phba->fcf.fcf_flag); 1005 1005 1006 1006 /* Check for retry */ 1007 1007 if (lpfc_els_retry(phba, cmdiocb, rspiocb)) { ··· 1023 1023 lpfc_nlp_put(ndlp); 1024 1024 1025 1025 lpfc_printf_vlog(vport, KERN_WARNING, LOG_ELS, 1026 - "0150 FLOGI failure Status:x%x/x%x " 1026 + "0150 FLOGI Status:x%x/x%x " 1027 1027 "xri x%x TMO:x%x refcnt %d\n", 1028 1028 ulp_status, ulp_word4, cmdiocb->sli4_xritag, 1029 1029 tmo, kref_read(&ndlp->kref)); ··· 1032 1032 if (!(ulp_status == IOSTAT_LOCAL_REJECT && 1033 1033 ((ulp_word4 & IOERR_PARAM_MASK) == 1034 1034 IOERR_LOOP_OPEN_FAILURE))) { 1035 - /* FLOGI failure */ 1036 - lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT, 1037 - "0100 FLOGI failure Status:x%x/x%x " 1038 - "TMO:x%x\n", 1039 - ulp_status, ulp_word4, tmo); 1035 + /* Warn FLOGI status */ 1036 + lpfc_vlog_msg(vport, KERN_WARNING, LOG_ELS, 1037 + "0100 FLOGI Status:x%x/x%x " 1038 + "TMO:x%x\n", 1039 + ulp_status, ulp_word4, tmo); 1040 1040 goto flogifail; 1041 1041 } 1042 1042 ··· 1964 1964 1965 1965 if (ulp_status) { 1966 1966 /* Check for retry */ 1967 - /* RRQ failed Don't print the vport to vport rjts */ 1967 + /* Warn RRQ status Don't print the vport to vport rjts */ 1968 1968 if (ulp_status != IOSTAT_LS_RJT || 1969 1969 (((ulp_word4) >> 16 != LSRJT_INVALID_CMD) && 1970 1970 ((ulp_word4) >> 16 != LSRJT_UNABLE_TPC)) || 1971 1971 (phba)->pport->cfg_log_verbose & LOG_ELS) 1972 - lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT, 1973 - "2881 RRQ failure DID:%06X Status:" 1974 - "x%x/x%x\n", 1975 - ndlp->nlp_DID, ulp_status, 1976 - ulp_word4); 1972 + lpfc_vlog_msg(vport, KERN_WARNING, LOG_ELS, 1973 + "2881 RRQ DID:%06X Status:" 1974 + "x%x/x%x\n", 1975 + ndlp->nlp_DID, ulp_status, 1976 + ulp_word4); 1977 1977 } 1978 1978 1979 1979 lpfc_clr_rrq_active(phba, rrq->xritag, rrq); ··· 2077 2077 } 2078 2078 goto out; 2079 2079 } 2080 - /* PLOGI failed Don't print the vport to vport rjts */ 2080 + /* Warn PLOGI status Don't print the vport to vport rjts */ 2081 2081 if (ulp_status != IOSTAT_LS_RJT || 2082 2082 (((ulp_word4) >> 16 != LSRJT_INVALID_CMD) && 2083 2083 ((ulp_word4) >> 16 != LSRJT_UNABLE_TPC)) || 2084 2084 (phba)->pport->cfg_log_verbose & LOG_ELS) 2085 - lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT, 2086 - "2753 PLOGI failure DID:%06X " 2087 - "Status:x%x/x%x\n", 2088 - ndlp->nlp_DID, ulp_status, 2089 - ulp_word4); 2085 + lpfc_vlog_msg(vport, KERN_WARNING, LOG_ELS, 2086 + "2753 PLOGI DID:%06X " 2087 + "Status:x%x/x%x\n", 2088 + ndlp->nlp_DID, ulp_status, 2089 + ulp_word4); 2090 2090 2091 2091 /* Do not call DSM for lpfc_els_abort'ed ELS cmds */ 2092 2092 if (!lpfc_error_lost_link(vport, ulp_status, ulp_word4)) ··· 2323 2323 struct lpfc_vport *vport = cmdiocb->vport; 2324 2324 struct lpfc_nodelist *ndlp; 2325 2325 char *mode; 2326 - u32 loglevel; 2327 2326 u32 ulp_status; 2328 2327 u32 ulp_word4; 2329 2328 bool release_node = false; ··· 2371 2372 * could be expected. 2372 2373 */ 2373 2374 if (test_bit(FC_FABRIC, &vport->fc_flag) || 2374 - vport->cfg_enable_fc4_type != LPFC_ENABLE_BOTH) { 2375 - mode = KERN_ERR; 2376 - loglevel = LOG_TRACE_EVENT; 2377 - } else { 2375 + vport->cfg_enable_fc4_type != LPFC_ENABLE_BOTH) 2376 + mode = KERN_WARNING; 2377 + else 2378 2378 mode = KERN_INFO; 2379 - loglevel = LOG_ELS; 2380 - } 2381 2379 2382 - /* PRLI failed */ 2383 - lpfc_printf_vlog(vport, mode, loglevel, 2384 - "2754 PRLI failure DID:%06X Status:x%x/x%x, " 2380 + /* Warn PRLI status */ 2381 + lpfc_printf_vlog(vport, mode, LOG_ELS, 2382 + "2754 PRLI DID:%06X Status:x%x/x%x, " 2385 2383 "data: x%x x%x x%x\n", 2386 2384 ndlp->nlp_DID, ulp_status, 2387 2385 ulp_word4, ndlp->nlp_state, ··· 2850 2854 } 2851 2855 goto out; 2852 2856 } 2853 - /* ADISC failed */ 2854 - lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT, 2855 - "2755 ADISC failure DID:%06X Status:x%x/x%x\n", 2856 - ndlp->nlp_DID, ulp_status, 2857 - ulp_word4); 2857 + /* Warn ADISC status */ 2858 + lpfc_vlog_msg(vport, KERN_WARNING, LOG_ELS, 2859 + "2755 ADISC DID:%06X Status:x%x/x%x\n", 2860 + ndlp->nlp_DID, ulp_status, 2861 + ulp_word4); 2858 2862 lpfc_disc_state_machine(vport, ndlp, cmdiocb, 2859 2863 NLP_EVT_CMPL_ADISC); 2860 2864 ··· 3041 3045 * discovery. The PLOGI will retry. 3042 3046 */ 3043 3047 if (ulp_status) { 3044 - /* LOGO failed */ 3045 - lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT, 3046 - "2756 LOGO failure, No Retry DID:%06X " 3047 - "Status:x%x/x%x\n", 3048 - ndlp->nlp_DID, ulp_status, 3049 - ulp_word4); 3048 + /* Warn LOGO status */ 3049 + lpfc_vlog_msg(vport, KERN_WARNING, LOG_ELS, 3050 + "2756 LOGO, No Retry DID:%06X " 3051 + "Status:x%x/x%x\n", 3052 + ndlp->nlp_DID, ulp_status, 3053 + ulp_word4); 3050 3054 3051 3055 if (lpfc_error_lost_link(vport, ulp_status, ulp_word4)) 3052 3056 skip_recovery = 1; ··· 4833 4837 if ((phba->sli3_options & LPFC_SLI3_NPIV_ENABLED) && 4834 4838 (cmd == ELS_CMD_FDISC) && 4835 4839 (stat.un.b.lsRjtRsnCodeExp == LSEXP_OUT_OF_RESOURCE)){ 4836 - lpfc_printf_vlog(vport, KERN_ERR, 4837 - LOG_TRACE_EVENT, 4838 - "0125 FDISC Failed (x%x). " 4839 - "Fabric out of resources\n", 4840 - stat.un.lsRjtError); 4840 + lpfc_vlog_msg(vport, KERN_WARNING, LOG_ELS, 4841 + "0125 FDISC (x%x). " 4842 + "Fabric out of resources\n", 4843 + stat.un.lsRjtError); 4841 4844 lpfc_vport_set_state(vport, 4842 4845 FC_VPORT_NO_FABRIC_RSCS); 4843 4846 } ··· 4872 4877 LSEXP_NOTHING_MORE) { 4873 4878 vport->fc_sparam.cmn.bbRcvSizeMsb &= 0xf; 4874 4879 retry = 1; 4875 - lpfc_printf_vlog(vport, KERN_ERR, 4876 - LOG_TRACE_EVENT, 4877 - "0820 FLOGI Failed (x%x). " 4878 - "BBCredit Not Supported\n", 4879 - stat.un.lsRjtError); 4880 + lpfc_vlog_msg(vport, KERN_WARNING, LOG_ELS, 4881 + "0820 FLOGI (x%x). " 4882 + "BBCredit Not Supported\n", 4883 + stat.un.lsRjtError); 4880 4884 } 4881 4885 break; 4882 4886 ··· 4885 4891 ((stat.un.b.lsRjtRsnCodeExp == LSEXP_INVALID_PNAME) || 4886 4892 (stat.un.b.lsRjtRsnCodeExp == LSEXP_INVALID_NPORT_ID)) 4887 4893 ) { 4888 - lpfc_printf_vlog(vport, KERN_ERR, 4889 - LOG_TRACE_EVENT, 4890 - "0122 FDISC Failed (x%x). " 4891 - "Fabric Detected Bad WWN\n", 4892 - stat.un.lsRjtError); 4894 + lpfc_vlog_msg(vport, KERN_WARNING, LOG_ELS, 4895 + "0122 FDISC (x%x). " 4896 + "Fabric Detected Bad WWN\n", 4897 + stat.un.lsRjtError); 4893 4898 lpfc_vport_set_state(vport, 4894 4899 FC_VPORT_FABRIC_REJ_WWN); 4895 4900 } ··· 5348 5355 u32 ulp_status, ulp_word4, tmo, did, iotag; 5349 5356 5350 5357 if (!vport) { 5351 - lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, 5352 - "3177 ELS response failed\n"); 5358 + lpfc_printf_log(phba, KERN_WARNING, LOG_ELS, 5359 + "3177 null vport in ELS rsp\n"); 5353 5360 goto out; 5354 5361 } 5355 5362 if (cmdiocb->context_un.mbox) ··· 9651 9658 if (piocb->cmd_flag & LPFC_DRIVER_ABORTED && !mbx_tmo_err) 9652 9659 continue; 9653 9660 9654 - /* On the ELS ring we can have ELS_REQUESTs or 9655 - * GEN_REQUESTs waiting for a response. 9661 + /* On the ELS ring we can have ELS_REQUESTs, ELS_RSPs, 9662 + * or GEN_REQUESTs waiting for a CQE response. 9656 9663 */ 9657 9664 ulp_command = get_job_cmnd(phba, piocb); 9658 - if (ulp_command == CMD_ELS_REQUEST64_CR) { 9665 + if (ulp_command == CMD_ELS_REQUEST64_WQE || 9666 + ulp_command == CMD_XMIT_ELS_RSP64_WQE) { 9659 9667 list_add_tail(&piocb->dlist, &abort_list); 9660 9668 9661 9669 /* If the link is down when flushing ELS commands ··· 11321 11327 /* Check for retry */ 11322 11328 if (lpfc_els_retry(phba, cmdiocb, rspiocb)) 11323 11329 goto out; 11324 - /* FDISC failed */ 11325 - lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT, 11326 - "0126 FDISC failed. (x%x/x%x)\n", 11327 - ulp_status, ulp_word4); 11330 + /* Warn FDISC status */ 11331 + lpfc_vlog_msg(vport, KERN_WARNING, LOG_ELS, 11332 + "0126 FDISC cmpl status: x%x/x%x)\n", 11333 + ulp_status, ulp_word4); 11328 11334 goto fdisc_failed; 11329 11335 } 11330 11336
+4 -6
drivers/scsi/lpfc/lpfc_hbadisc.c
··· 527 527 * the following lpfc_nlp_put is necessary after fabric node is 528 528 * recovered. 529 529 */ 530 + spin_lock_irqsave(&ndlp->lock, iflags); 531 + ndlp->nlp_flag &= ~NLP_IN_DEV_LOSS; 532 + spin_unlock_irqrestore(&ndlp->lock, iflags); 530 533 if (recovering) { 531 534 lpfc_printf_vlog(vport, KERN_INFO, 532 535 LOG_DISCOVERY | LOG_NODE, ··· 542 539 spin_lock_irqsave(&ndlp->lock, iflags); 543 540 ndlp->save_flags |= NLP_IN_RECOV_POST_DEV_LOSS; 544 541 spin_unlock_irqrestore(&ndlp->lock, iflags); 542 + return fcf_inuse; 545 543 } else if (ndlp->nlp_state == NLP_STE_UNMAPPED_NODE) { 546 544 /* Fabric node fully recovered before this dev_loss_tmo 547 545 * queue work is processed. Thus, ignore the ··· 556 552 ndlp->nlp_DID, kref_read(&ndlp->kref), 557 553 ndlp, ndlp->nlp_flag, 558 554 vport->port_state); 559 - spin_lock_irqsave(&ndlp->lock, iflags); 560 - ndlp->nlp_flag &= ~NLP_IN_DEV_LOSS; 561 - spin_unlock_irqrestore(&ndlp->lock, iflags); 562 555 return fcf_inuse; 563 556 } 564 557 565 - spin_lock_irqsave(&ndlp->lock, iflags); 566 - ndlp->nlp_flag &= ~NLP_IN_DEV_LOSS; 567 - spin_unlock_irqrestore(&ndlp->lock, iflags); 568 558 lpfc_nlp_put(ndlp); 569 559 return fcf_inuse; 570 560 }
+21
drivers/scsi/lpfc/lpfc_hw.h
··· 562 562 #include <uapi/scsi/fc/fc_els.h> 563 563 564 564 /* 565 + * Application Header 566 + */ 567 + struct fc_app_header { 568 + uint32_t dst_app_id; 569 + uint32_t src_app_id; 570 + #define LOOPBACK_SRC_APPID 0x4321 571 + uint32_t word2; 572 + uint32_t word3; 573 + }; 574 + 575 + /* 576 + * dfctl optional header definition 577 + */ 578 + enum lpfc_fc_dfctl { 579 + LPFC_FC_NO_DEVICE_HEADER, 580 + LPFC_FC_16B_DEVICE_HEADER, 581 + LPFC_FC_32B_DEVICE_HEADER, 582 + LPFC_FC_64B_DEVICE_HEADER, 583 + }; 584 + 585 + /* 565 586 * Extended Link Service LS_COMMAND codes (Payload Word 0) 566 587 */ 567 588 #ifdef __BIG_ENDIAN_BITFIELD
+3
drivers/scsi/lpfc/lpfc_hw4.h
··· 4847 4847 #define cmd_buff_len_SHIFT 16 4848 4848 #define cmd_buff_len_MASK 0x00000ffff 4849 4849 #define cmd_buff_len_WORD word3 4850 + /* Note: payload_offset_len field depends on ASIC support */ 4850 4851 #define payload_offset_len_SHIFT 0 4851 4852 #define payload_offset_len_MASK 0x0000ffff 4852 4853 #define payload_offset_len_WORD word3 ··· 4864 4863 #define cmd_buff_len_SHIFT 16 4865 4864 #define cmd_buff_len_MASK 0x00000ffff 4866 4865 #define cmd_buff_len_WORD word3 4866 + /* Note: payload_offset_len field depends on ASIC support */ 4867 4867 #define payload_offset_len_SHIFT 0 4868 4868 #define payload_offset_len_MASK 0x0000ffff 4869 4869 #define payload_offset_len_WORD word3 ··· 4881 4879 #define cmd_buff_len_SHIFT 16 4882 4880 #define cmd_buff_len_MASK 0x00000ffff 4883 4881 #define cmd_buff_len_WORD word3 4882 + /* Note: payload_offset_len field depends on ASIC support */ 4884 4883 #define payload_offset_len_SHIFT 0 4885 4884 #define payload_offset_len_MASK 0x0000ffff 4886 4885 #define payload_offset_len_WORD word3
+27 -5
drivers/scsi/lpfc/lpfc_init.c
··· 4699 4699 uint64_t wwn; 4700 4700 bool use_no_reset_hba = false; 4701 4701 int rc; 4702 + u8 if_type; 4702 4703 4703 4704 if (lpfc_no_hba_reset_cnt) { 4704 4705 if (phba->sli_rev < LPFC_SLI_REV4 && ··· 4774 4773 shost->max_id = LPFC_MAX_TARGET; 4775 4774 shost->max_lun = vport->cfg_max_luns; 4776 4775 shost->this_id = -1; 4777 - if (phba->sli_rev == LPFC_SLI_REV4) 4778 - shost->max_cmd_len = LPFC_FCP_CDB_LEN_32; 4779 - else 4776 + 4777 + /* Set max_cmd_len applicable to ASIC support */ 4778 + if (phba->sli_rev == LPFC_SLI_REV4) { 4779 + if_type = bf_get(lpfc_sli_intf_if_type, 4780 + &phba->sli4_hba.sli_intf); 4781 + switch (if_type) { 4782 + case LPFC_SLI_INTF_IF_TYPE_2: 4783 + fallthrough; 4784 + case LPFC_SLI_INTF_IF_TYPE_6: 4785 + shost->max_cmd_len = LPFC_FCP_CDB_LEN_32; 4786 + break; 4787 + default: 4788 + shost->max_cmd_len = LPFC_FCP_CDB_LEN; 4789 + break; 4790 + } 4791 + } else { 4780 4792 shost->max_cmd_len = LPFC_FCP_CDB_LEN; 4793 + } 4781 4794 4782 4795 if (phba->sli_rev == LPFC_SLI_REV4) { 4783 4796 if (!phba->cfg_fcp_mq_threshold || ··· 10451 10436 struct lpfc_vector_map_info *cpup; 10452 10437 struct lpfc_vector_map_info *eqcpup; 10453 10438 struct lpfc_eq_intr_info *eqi; 10439 + u32 wqesize; 10454 10440 10455 10441 /* 10456 10442 * Create HBA Record arrays. ··· 10671 10655 * Create ELS Work Queues 10672 10656 */ 10673 10657 10674 - /* Create slow-path ELS Work Queue */ 10658 + /* 10659 + * Create slow-path ELS Work Queue. 10660 + * Increase the ELS WQ size when WQEs contain an embedded cdb 10661 + */ 10662 + wqesize = (phba->fcp_embed_io) ? 10663 + LPFC_WQE128_SIZE : phba->sli4_hba.wq_esize; 10664 + 10675 10665 qdesc = lpfc_sli4_queue_alloc(phba, LPFC_DEFAULT_PAGE_SIZE, 10676 - phba->sli4_hba.wq_esize, 10666 + wqesize, 10677 10667 phba->sli4_hba.wq_ecount, cpu); 10678 10668 if (!qdesc) { 10679 10669 lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
+1 -1
drivers/scsi/lpfc/lpfc_scsi.c
··· 4760 4760 4761 4761 /* Word 3 */ 4762 4762 bf_set(payload_offset_len, &wqe->fcp_icmd, 4763 - sizeof(struct fcp_cmnd32) + sizeof(struct fcp_rsp)); 4763 + sizeof(struct fcp_cmnd) + sizeof(struct fcp_rsp)); 4764 4764 4765 4765 /* Word 6 */ 4766 4766 bf_set(wqe_ctxt_tag, &wqe->generic.wqe_com,
+43 -5
drivers/scsi/lpfc/lpfc_sli.c
··· 1940 1940 atot = atomic_xchg(&phba->cgn_sync_alarm_cnt, 0); 1941 1941 wtot = atomic_xchg(&phba->cgn_sync_warn_cnt, 0); 1942 1942 1943 + spin_lock_irqsave(&phba->hbalock, iflags); 1944 + 1943 1945 /* ONLY Managed mode will send the CMF_SYNC_WQE to the HBA */ 1944 1946 if (phba->cmf_active_mode != LPFC_CFG_MANAGED || 1945 - phba->link_state == LPFC_LINK_DOWN) 1946 - return 0; 1947 + phba->link_state < LPFC_LINK_UP) { 1948 + ret_val = 0; 1949 + goto out_unlock; 1950 + } 1947 1951 1948 - spin_lock_irqsave(&phba->hbalock, iflags); 1949 1952 sync_buf = __lpfc_sli_get_iocbq(phba); 1950 1953 if (!sync_buf) { 1951 1954 lpfc_printf_log(phba, KERN_ERR, LOG_CGN_MGMT, ··· 11093 11090 /* Word 9 */ 11094 11091 bf_set(wqe_rcvoxid, &wqe->xmit_sequence.wqe_com, ox_id); 11095 11092 11096 - /* Word 12 */ 11097 - if (cmdiocbq->cmd_flag & (LPFC_IO_LIBDFC | LPFC_IO_LOOPBACK)) 11093 + if (cmdiocbq->cmd_flag & (LPFC_IO_LIBDFC | LPFC_IO_LOOPBACK)) { 11094 + /* Word 10 */ 11095 + if (cmdiocbq->cmd_flag & LPFC_IO_VMID) { 11096 + bf_set(wqe_appid, &wqe->xmit_sequence.wqe_com, 1); 11097 + bf_set(wqe_wqes, &wqe->xmit_sequence.wqe_com, 1); 11098 + wqe->words[31] = LOOPBACK_SRC_APPID; 11099 + } 11100 + 11101 + /* Word 12 */ 11098 11102 wqe->xmit_sequence.xmit_len = full_size; 11103 + } 11099 11104 else 11100 11105 wqe->xmit_sequence.xmit_len = 11101 11106 wqe->xmit_sequence.bde.tus.f.bdeSize; ··· 18442 18431 { 18443 18432 /* make rctl_names static to save stack space */ 18444 18433 struct fc_vft_header *fc_vft_hdr; 18434 + struct fc_app_header *fc_app_hdr; 18445 18435 uint32_t *header = (uint32_t *) fc_hdr; 18446 18436 18447 18437 #define FC_RCTL_MDS_DIAGS 0xF4 ··· 18496 18484 case FC_TYPE_ILS: 18497 18485 default: 18498 18486 goto drop; 18487 + } 18488 + 18489 + if (unlikely(phba->link_flag == LS_LOOPBACK_MODE && 18490 + phba->cfg_vmid_app_header)) { 18491 + /* Application header is 16B device header */ 18492 + if (fc_hdr->fh_df_ctl & LPFC_FC_16B_DEVICE_HEADER) { 18493 + fc_app_hdr = (struct fc_app_header *) (fc_hdr + 1); 18494 + if (be32_to_cpu(fc_app_hdr->src_app_id) != 18495 + LOOPBACK_SRC_APPID) { 18496 + lpfc_printf_log(phba, KERN_WARNING, 18497 + LOG_ELS | LOG_LIBDFC, 18498 + "1932 Loopback src app id " 18499 + "not matched, app_id:x%x\n", 18500 + be32_to_cpu(fc_app_hdr->src_app_id)); 18501 + 18502 + goto drop; 18503 + } 18504 + } else { 18505 + lpfc_printf_log(phba, KERN_WARNING, 18506 + LOG_ELS | LOG_LIBDFC, 18507 + "1933 Loopback df_ctl bit not set, " 18508 + "df_ctl:x%x\n", 18509 + fc_hdr->fh_df_ctl); 18510 + 18511 + goto drop; 18512 + } 18499 18513 } 18500 18514 18501 18515 lpfc_printf_log(phba, KERN_INFO, LOG_ELS,
+1 -1
drivers/scsi/lpfc/lpfc_version.h
··· 20 20 * included with this package. * 21 21 *******************************************************************/ 22 22 23 - #define LPFC_DRIVER_VERSION "14.4.0.4" 23 + #define LPFC_DRIVER_VERSION "14.4.0.5" 24 24 #define LPFC_DRIVER_NAME "lpfc" 25 25 26 26 /* Used for SLI 2/3 */
+36 -7
drivers/scsi/lpfc/lpfc_vport.c
··· 626 626 struct Scsi_Host *shost = lpfc_shost_from_vport(vport); 627 627 struct lpfc_hba *phba = vport->phba; 628 628 int rc; 629 + DECLARE_WAIT_QUEUE_HEAD_ONSTACK(waitq); 629 630 630 631 if (vport->port_type == LPFC_PHYSICAL_PORT) { 631 632 lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT, ··· 680 679 if (!ndlp) 681 680 goto skip_logo; 682 681 682 + /* Send the DA_ID and Fabric LOGO to cleanup the NPIV fabric entries. */ 683 683 if (ndlp && ndlp->nlp_state == NLP_STE_UNMAPPED_NODE && 684 684 phba->link_state >= LPFC_LINK_UP && 685 685 phba->fc_topology != LPFC_TOPOLOGY_LOOP) { 686 686 if (vport->cfg_enable_da_id) { 687 - /* Send DA_ID and wait for a completion. */ 687 + /* Send DA_ID and wait for a completion. This is best 688 + * effort. If the DA_ID fails, likely the fabric will 689 + * "leak" NportIDs but at least the driver issued the 690 + * command. 691 + */ 692 + ndlp = lpfc_findnode_did(vport, NameServer_DID); 693 + if (!ndlp) 694 + goto issue_logo; 695 + 696 + spin_lock_irq(&ndlp->lock); 697 + ndlp->da_id_waitq = &waitq; 698 + ndlp->save_flags |= NLP_WAIT_FOR_DA_ID; 699 + spin_unlock_irq(&ndlp->lock); 700 + 688 701 rc = lpfc_ns_cmd(vport, SLI_CTNS_DA_ID, 0, 0); 689 - if (rc) { 690 - lpfc_printf_log(vport->phba, KERN_WARNING, 691 - LOG_VPORT, 692 - "1829 CT command failed to " 693 - "delete objects on fabric, " 694 - "rc %d\n", rc); 702 + if (!rc) { 703 + wait_event_timeout(waitq, 704 + !(ndlp->save_flags & NLP_WAIT_FOR_DA_ID), 705 + msecs_to_jiffies(phba->fc_ratov * 2000)); 695 706 } 707 + 708 + lpfc_printf_vlog(vport, KERN_INFO, LOG_VPORT | LOG_ELS, 709 + "1829 DA_ID issue status %d. " 710 + "SFlag x%x NState x%x, NFlag x%x " 711 + "Rpi x%x\n", 712 + rc, ndlp->save_flags, ndlp->nlp_state, 713 + ndlp->nlp_flag, ndlp->nlp_rpi); 714 + 715 + /* Remove the waitq and save_flags. It no 716 + * longer matters if the wake happened. 717 + */ 718 + spin_lock_irq(&ndlp->lock); 719 + ndlp->da_id_waitq = NULL; 720 + ndlp->save_flags &= ~NLP_WAIT_FOR_DA_ID; 721 + spin_unlock_irq(&ndlp->lock); 696 722 } 697 723 724 + issue_logo: 698 725 /* 699 726 * If the vpi is not registered, then a valid FDISC doesn't 700 727 * exist and there is no need for a ELS LOGO. Just cleanup