lpfc: Update lpfc to revision 12.8.0.3
Subsystems (2)
cover lpfc: Update lpfc to revision 12.8.0.3
Update lpfc to revision 12.8.0.3
Patch set contains several small fixes.
The patches were cut against Martin's 5.9/scsi-queue tree
James Smart (8):
lpfc: Fix FCoE speed reporting
lpfc: Fix no message shown for lpfc_hdw_queue out of range value
lpfc: Fix RSCN timeout due to incorrect gidft counter
lpfc: Fix oops when unloading driver while running mds diags
lpfc: Fix retry of PRLI when status indicates its unsupported
lpfc: Fix validation of bsg reply lengths
lpfc: Fix lun loss after cable pull
lpfc: Update lpfc version to 12.8.0.3
drivers/scsi/lpfc/lpfc_attr.c | 26 +++++++++++++++++++++++--- drivers/scsi/lpfc/lpfc_bsg.c | 21 ++++++++------------- drivers/scsi/lpfc/lpfc_ct.c | 22 ++++++++++++++++------ drivers/scsi/lpfc/lpfc_els.c | 10 +++++++--- drivers/scsi/lpfc/lpfc_init.c | 18 +++++++++++++++--- drivers/scsi/lpfc/lpfc_nportdisc.c | 8 +++++++- drivers/scsi/lpfc/lpfc_sli.c | 11 +++++++++-- drivers/scsi/lpfc/lpfc_version.h | 2 +- 8 files changed, 86 insertions(+), 32 deletions(-)
Signature · 1 line
2.26.2
PATCH 1/8 lpfc: Fix FCoE speed reporting
Current Link speed was shown as "unknown" in sysfs for FCoE ports In this scenario, the port was working in 20G speed, which happens to not be a speed handled by the driver.
Add support for all possible link speeds that could get reported from port_speed field in link state ACQE.
Additionally, as supported_speeds can't be manipulated via the fcoe driver on a converged ethernet port (it must be managed by the nic function), don't fill out the supported_speeds field for the fc host object in sysfs.
Revise debug logging to report Link speed mgmt valuess.
--- drivers/scsi/lpfc/lpfc_attr.c | 6 ++++++ drivers/scsi/lpfc/lpfc_init.c | 15 +++++++++++++-- 2 files changed, 19 insertions(+), 2 deletions(-)
drivers/scsi/lpfc/lpfc_attr.c +6 -0
@@ -6679,9 +6679,15 @@ lpfc_get_host_speed(struct Scsi_Host *shost) } }else if (lpfc_is_link_up (phba) && (phba->hba_flag &HBA_FCOE_MODE )) {switch (phba->fc_linkspeed) { +case LPFC_ASYNC_LINK_SPEED_1GBPS : +fc_host_speed (shost) =FC_PORTSPEED_1GBIT ; +break ;case LPFC_ASYNC_LINK_SPEED_10GBPS :fc_host_speed (shost) =FC_PORTSPEED_10GBIT ;break ; +case LPFC_ASYNC_LINK_SPEED_20GBPS : +fc_host_speed (shost) =FC_PORTSPEED_20GBIT ; +break ;case LPFC_ASYNC_LINK_SPEED_25GBPS :fc_host_speed (shost) =FC_PORTSPEED_25GBIT ;break ;
drivers/scsi/lpfc/lpfc_init.c +13 -2
@@ -4577,6 +4577,13 @@ static void lpfc_host_supported_speeds_set(struct Scsi_Host *shost)struct lpfc_hba *phba = vport->phba;fc_host_supported_speeds (shost) =0 ; +/* +* Avoid reporting supported link speed for FCoE as it can't be +* controlled via FCoE. +*/ +if (phba->hba_flag &HBA_FCOE_MODE ) +return ; +if (phba->lmt & LMT_128Gb)fc_host_supported_speeds (shost) |=FC_PORTSPEED_128GBIT ;if (phba->lmt & LMT_64Gb)
@@ -4910,6 +4917,9 @@ lpfc_sli4_port_speed_parse(struct lpfc_hba *phba, uint32_t evt_code,case LPFC_ASYNC_LINK_SPEED_40GBPS : port_speed =40000 ;break ; +case LPFC_ASYNC_LINK_SPEED_100GBPS : + port_speed =100000 ; +break ;default : port_speed =0 ; }
@@ -8589,7 +8599,7 @@ lpfc_sli4_read_config(struct lpfc_hba *phba)"VPI(B:%d M:%d) " "VFI(B:%d M:%d) " "RPI(B:%d M:%d) " -"FCFI:%d EQ:%d CQ:%d WQ:%d RQ:%d\n" , +"FCFI:%d EQ:%d CQ:%d WQ:%d RQ:%d lmt:x%x\n" , phba->sli4_hba.extents_in_use, phba->sli4_hba.max_cfg_param.xri_base, phba->sli4_hba.max_cfg_param.max_xri,
@@ -8603,7 +8613,8 @@ lpfc_sli4_read_config(struct lpfc_hba *phba) phba->sli4_hba.max_cfg_param.max_eq, phba->sli4_hba.max_cfg_param.max_cq, phba->sli4_hba.max_cfg_param.max_wq, - phba->sli4_hba.max_cfg_param.max_rq); + phba->sli4_hba.max_cfg_param.max_rq, + phba->lmt);/* * Calculate queue resources based on how
Signature · 1 line
2.26.2
PATCH 2/8 lpfc: Fix no message shown for lpfc_hdw_queue out of range value
In reply to James SmartIf module parameters override the default configuration settings for hardware queues or irqs, the driver was not notifying the change from defaults.
Revise such that any changes will result in a kernel log message.
--- drivers/scsi/lpfc/lpfc_attr.c | 20 +++++++++++++++++--- drivers/scsi/lpfc/lpfc_init.c | 3 ++- 2 files changed, 19 insertions(+), 4 deletions(-)
drivers/scsi/lpfc/lpfc_attr.c +17 -3
@@ -7412,12 +7412,26 @@ lpfc_get_cfgparam(struct lpfc_hba *phba)void lpfc_nvme_mod_param_dep (struct lpfc_hba *phba) { -if (phba->cfg_hdw_queue > phba->sli4_hba.num_present_cpu) +int logit =0 ; + +if (phba->cfg_hdw_queue > phba->sli4_hba.num_present_cpu) { phba->cfg_hdw_queue = phba->sli4_hba.num_present_cpu; -if (phba->cfg_irq_chann > phba->sli4_hba.num_present_cpu) + logit =1 ; + } +if (phba->cfg_irq_chann > phba->sli4_hba.num_present_cpu) { phba->cfg_irq_chann = phba->sli4_hba.num_present_cpu; -if (phba->cfg_irq_chann > phba->cfg_hdw_queue) + logit =1 ; + } +if (phba->cfg_irq_chann > phba->cfg_hdw_queue) { phba->cfg_irq_chann = phba->cfg_hdw_queue; + logit =1 ; + } +if (logit) +lpfc_printf_log (phba,KERN_ERR ,LOG_SLI , +"2006 Reducing Queues - CPU limitation: " +"IRQ %d HDWQ %d\n" , + phba->cfg_irq_chann, + phba->cfg_hdw_queue);if (phba->cfg_enable_fc4_type &LPFC_ENABLE_NVME && phba->nvmet_support) {
drivers/scsi/lpfc/lpfc_init.c +2 -1
@@ -8637,7 +8637,8 @@ lpfc_sli4_read_config(struct lpfc_hba *phba)if ((phba->cfg_irq_chann > qmin) || (phba->cfg_hdw_queue > qmin)) { lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, - "2005 Reducing Queues: " + "2005 Reducing Queues - " + "FW resource limitation: " "WQ %d CQ %d EQ %d: min %d: " "IRQ %d HDWQ %d\n", phba->sli4_hba.max_cfg_param.max_wq,
Signature · 1 line
2.26.2
PATCH 3/8 lpfc: Fix RSCN timeout due to incorrect gidft counter
In reply to James SmartIn configs with a large number of initiators in the same zone (>250), RSCN timeouts are seen when creating or deleting vports.
lpfc 0000:07:00.1: 5:(0):0231 RSCN timeout Data: x0 x3
During RSCN processing driver issues GID_FT command to nameserver. A counter for number of simultaneous GID_FT commands is maintained (an unsigned value). The counter is incremented when the GID_FT is issued. If the GID_FT command fails for some reason the driver retries the GID_FT from the completion call back. But the counter was decremented before the retry was issued. When the second GID_FT completes, the callback again tries to decrement the counter, possibly wrapping to a very large non-zero value, which causes the RSCN cleanup code to not execute. Thus the RSCN timeout failure.
Do not decrement the counter on a retry. Also add defensive checks to ensure the counter is not decremented if already zero.
--- drivers/scsi/lpfc/lpfc_ct.c | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-)
drivers/scsi/lpfc/lpfc_ct.c +16 -6
@@ -713,7 +713,8 @@ lpfc_cmpl_ct_cmd_gid_ft(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb,/* This is a GID_FT completing so the gidft_inp counter was * incremented before the GID_FT was issued to the wire. */ - vport->gidft_inp--; +if (vport->gidft_inp) + vport->gidft_inp--;/* * Skip processing the NS response
@@ -741,11 +742,14 @@ lpfc_cmpl_ct_cmd_gid_ft(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb, goto out;/* CT command is being retried */ - vport->gidft_inp--; rc =lpfc_ns_cmd (vport,SLI_CTNS_GID_FT , vport->fc_ns_retry, type);if (rc ==0 ) goto out; +else {/* Unable to send NS cmd */ +if (vport->gidft_inp) + vport->gidft_inp--; + } }if (vport->fc_flag &FC_RSCN_MODE )lpfc_els_flush_rscn (vport);
@@ -825,7 +829,8 @@ lpfc_cmpl_ct_cmd_gid_ft(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb, (uint32_t ) CTrsp->ReasonCode, (uint32_t) CTrsp->Explanation); } - vport->gidft_inp--; +if (vport->gidft_inp) + vport->gidft_inp--; } lpfc_printf_vlog(vport, KERN_INFO, LOG_DISCOVERY,
@@ -918,7 +923,8 @@ lpfc_cmpl_ct_cmd_gid_pt(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb,/* This is a GID_PT completing so the gidft_inp counter was * incremented before the GID_PT was issued to the wire. */ - vport->gidft_inp--; +if (vport->gidft_inp) + vport->gidft_inp--;/* * Skip processing the NS response
@@ -942,11 +948,14 @@ lpfc_cmpl_ct_cmd_gid_pt(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb, vport->fc_ns_retry++;/* CT command is being retried */ - vport->gidft_inp--; rc =lpfc_ns_cmd (vport,SLI_CTNS_GID_PT , vport->fc_ns_retry,GID_PT_N_PORT );if (rc ==0 ) goto out; +else {/* Unable to send NS cmd */ +if (vport->gidft_inp) + vport->gidft_inp--; + } }if (vport->fc_flag &FC_RSCN_MODE )lpfc_els_flush_rscn (vport);
@@ -1027,7 +1036,8 @@ lpfc_cmpl_ct_cmd_gid_pt(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb, (uint32_t )CTrsp->ReasonCode, (uint32_t)CTrsp->Explanation); } - vport->gidft_inp--; +if (vport->gidft_inp) + vport->gidft_inp--; } lpfc_printf_vlog(vport, KERN_INFO, LOG_DISCOVERY,
Signature · 1 line
2.26.2
PATCH 4/8 lpfc: Fix oops when unloading driver while running mds diags
In reply to James SmartWhile mds diagnostic tests are running, if the driver is requested to be unloaded, oops or hangs are observed. The driver doesn't terminate the processing of diag frames when the unload is started. As such: oops may be seen for __lpfc_sli_release_iocbq_s4 because ring memory is referenced that was already freed; or hangs see in lpfc_nvme_wait_for_io_drain as ios no longer complete.
If unloading, don't process diag frames. Just clean them up.
--- drivers/scsi/lpfc/lpfc_sli.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-)
drivers/scsi/lpfc/lpfc_sli.c +9 -2
@@ -13650,7 +13650,11 @@ lpfc_sli4_sp_handle_rcqe(struct lpfc_hba *phba, struct lpfc_rcqe *rcqe) fc_hdr->fh_r_ctl == FC_RCTL_DD_UNSOL_DATA) {spin_unlock_irqrestore (&phba->hbalock, iflags);/* Handle MDS Loopback frames */ -lpfc_sli4_handle_mds_loopback (phba->pport, dma_buf); +if (!(phba->pport->load_flag &FC_UNLOADING )) +lpfc_sli4_handle_mds_loopback (phba->pport, + dma_buf); +else +lpfc_in_buf_free (phba, &dma_buf->dbuf);break ; }
@@ -18363,7 +18367,10 @@ lpfc_sli4_handle_received_buffer(struct lpfc_hba *phba, fc_hdr->fh_r_ctl == FC_RCTL_DD_UNSOL_DATA) { vport = phba->pport;/* Handle MDS Loopback frames */ -lpfc_sli4_handle_mds_loopback (vport, dmabuf); +if (!(phba->pport->load_flag &FC_UNLOADING )) +lpfc_sli4_handle_mds_loopback (vport, dmabuf); +else +lpfc_in_buf_free (phba, &dmabuf->dbuf);return ; }
Signature · 1 line
2.26.2
PATCH 5/8 lpfc: Fix retry of PRLI when status indicates its unsupported
In reply to James SmartWith port bounce/address swaps and timing between initiator GID queries vs remote port FC4 support registrations, the driver may be in a situation where it sends PRLIs for both FCP and NVME even though the target may not support one of the protocols. In this case, the remote port will reject the PRLI and usually indicate it does not support the request. However, the driver currently ignores the status of the failure and immediately retries the PRLI, which is pointless. In the case of this one remote port, the reception of the PRLI retry caused it to decide to send a LOGO. The LOGO restarted the process and the same results happened. It made the remote port undiscoverable to either protocol.
Add logic to detect the non-support status and not attempt the retry of the PRLI.
--- drivers/scsi/lpfc/lpfc_els.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-)
drivers/scsi/lpfc/lpfc_els.c +7 -3
@@ -3937,10 +3937,14 @@ lpfc_els_retry(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb,case LSRJT_UNABLE_TPC :/* The driver has a VALID PLOGI but the rport has * rejected the PRLI - can't do it now. Delay -* for 1 second and try again - don't care about -* the explanation. +* for 1 second and try again. +* +* However, if explanation is REQ_UNSUPPORTED there's +* no point to retry PRLI. */ -if (cmd ==ELS_CMD_PRLI || cmd ==ELS_CMD_NVMEPRLI ) { +if ((cmd ==ELS_CMD_PRLI || cmd ==ELS_CMD_NVMEPRLI ) && + stat.un.b.lsRjtRsnCodeExp != +LSEXP_REQ_UNSUPPORTED ) { delay =1000 ; maxretry = lpfc_max_els_tries +1 ; retry =1 ;
Signature · 1 line
2.26.2
PATCH 6/8 lpfc: Fix validation of bsg reply lengths
In reply to James SmartThere are a couple of code areas which validate sufficient reply buffer length, but the checks are using the request elements rather than the reply elements.
Rework to validate using the reply structures.
--- drivers/scsi/lpfc/lpfc_bsg.c | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-)
drivers/scsi/lpfc/lpfc_bsg.c +8 -13
@@ -2494,13 +2494,12 @@ lpfc_sli4_bsg_link_diag_test(struct bsg_job *job) diag_status_reply = (struct diag_status *) bsg_reply->reply_data.vendor_reply.vendor_rsp; -if (job->reply_len < -sizeof (struct fc_bsg_request ) +sizeof (struct diag_status )) { +if (job->reply_len <sizeof (*bsg_reply) +sizeof (*diag_status_reply)) {lpfc_printf_log (phba,KERN_WARNING ,LOG_LIBDFC ,"3012 Received Run link diag test reply " "below minimum size (%d): reply_len:%d\n" , - (int )(sizeof (struct fc_bsg_request ) + -sizeof (struct diag_status )), + (int )(sizeof (*bsg_reply) + +sizeof (*diag_status_reply)), job->reply_len); rc = -EINVAL ; goto job_error;
@@ -3418,8 +3417,7 @@ lpfc_bsg_get_dfc_rev(struct bsg_job *job) event_reply = (struct get_mgmt_rev_reply *) bsg_reply->reply_data.vendor_reply.vendor_rsp; -if (job->reply_len < -sizeof (struct fc_bsg_request ) +sizeof (struct get_mgmt_rev_reply )) { +if (job->reply_len <sizeof (*bsg_reply) +sizeof (*event_reply)) {lpfc_printf_log (phba,KERN_WARNING ,LOG_LIBDFC ,"2741 Received GET_DFC_REV reply below " "minimum size\n" );
@@ -5202,8 +5200,8 @@ lpfc_menlo_cmd(struct bsg_job *job) goto no_dd_data; } -if (job->reply_len < -sizeof (struct fc_bsg_request ) +sizeof (struct menlo_response )) { +if (job->reply_len <sizeof (*bsg_reply) + +sizeof (struct menlo_response )) {lpfc_printf_log (phba,KERN_WARNING ,LOG_LIBDFC ,"2785 Received MENLO_CMD reply below " "minimum size\n" );
@@ -5359,9 +5357,7 @@ lpfc_forced_link_speed(struct bsg_job *job) forced_reply = (struct forced_link_speed_support_reply *) bsg_reply->reply_data.vendor_reply.vendor_rsp; -if (job->reply_len < -sizeof (struct fc_bsg_request ) + -sizeof (struct forced_link_speed_support_reply )) { +if (job->reply_len <sizeof (*bsg_reply) +sizeof (*forced_reply)) {lpfc_printf_log (phba,KERN_WARNING ,LOG_LIBDFC ,"0049 Received FORCED_LINK_SPEED reply below " "minimum size\n" );
@@ -5715,8 +5711,7 @@ lpfc_get_trunk_info(struct bsg_job *job) event_reply = (struct lpfc_trunk_info *) bsg_reply->reply_data.vendor_reply.vendor_rsp; -if (job->reply_len < -sizeof (struct fc_bsg_request ) +sizeof (struct lpfc_trunk_info )) { +if (job->reply_len <sizeof (*bsg_reply) +sizeof (*event_reply)) {lpfc_printf_log (phba,KERN_WARNING ,LOG_LIBDFC ,"2728 Received GET TRUNK _INFO reply below " "minimum size\n" );
Signature · 1 line
2.26.2
PATCH 7/8 lpfc: Fix lun loss after cable pull
In reply to James SmartOn devices that support FCP sequence error recovery, which attempts to preserve the devices login across link bounce, adisc is used for device validation. Turns out the device fc4 type is cleared as part of the link bounce, but the ADISC handling doesn't restore the FC4 support as it normally would with a PRLI. This caused situations where the device wasn't reregistered with the transport thus scan logic and lun discovery never kicked in.
In the ADISC completion handling, reset the fc4 type so that transport port reregistration occurs with the remote port.
--- drivers/scsi/lpfc/lpfc_nportdisc.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-)
drivers/scsi/lpfc/lpfc_nportdisc.c +7 -1
@@ -1745,7 +1745,13 @@ lpfc_cmpl_adisc_adisc_issue(struct lpfc_vport *vport, } } -if (ndlp->nlp_type &NLP_FCP_TARGET ) { +if (ndlp->nlp_type &NLP_FCP_TARGET ) + ndlp->nlp_fc4_type |=NLP_FC4_FCP ; + +if (ndlp->nlp_type &NLP_NVME_TARGET ) + ndlp->nlp_fc4_type |=NLP_FC4_NVME ; + +if (ndlp->nlp_type & (NLP_FCP_TARGET |NLP_NVME_TARGET )) { ndlp->nlp_prev_state =NLP_STE_ADISC_ISSUE ;lpfc_nlp_set_state (vport, ndlp,NLP_STE_MAPPED_NODE ); }else {
Signature · 1 line
2.26.2
PATCH 8/8 lpfc: Update lpfc version to 12.8.0.3
In reply to James SmartUpdate lpfc version to 12.8.0.3
---
--- drivers/scsi/lpfc/lpfc_version.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/scsi/lpfc/lpfc_version.h +1 -1
@@ -20,7 +20,7 @@* included with this package. * *******************************************************************/ -#define LPFC_DRIVER_VERSION "12.8.0.2" +#define LPFC_DRIVER_VERSION "12.8.0.3"#define LPFC_DRIVER_NAME "lpfc"/* Used for SLI 2/3 */
Signature · 1 line
2.26.2
Martin K. Petersen
AppliedQuoted 16 lines · James Smart
Update lpfc to revision 12.8.0.3
Patch set contains several small fixes.
The patches were cut against Martin's 5.9/scsi-queue tree
James Smart (8):
lpfc: Fix FCoE speed reporting
lpfc: Fix no message shown forlpfc_hdw_queueout of range value
lpfc: Fix RSCN timeout due to incorrect gidft counter
lpfc: Fix oops when unloading driver while running mds diags
lpfc: Fix retry of PRLI when status indicates its unsupported
lpfc: Fix validation of bsg reply lengths
lpfc: Fix lun loss after cable pull
lpfc: Update lpfc version to 12.8.0.3
Quoted 1 line
[...]
Applied to 5.9/scsi-queue, thanks!
[1/8] scsi: lpfc: Fix FCoE speed reporting
https://git.kernel.org/mkp/scsi/c/a1e4d3d8aef9 [2/8] scsi: lpfc: Fix no message shown for lpfc_hdw_queue out of range value https://git.kernel.org/mkp/scsi/c/9e3e365a92d3 [3/8] scsi: lpfc: Fix RSCN timeout due to incorrect gidft counter https://git.kernel.org/mkp/scsi/c/8ccd6926db7d [4/8] scsi: lpfc: Fix oops when unloading driver while running mds diags https://git.kernel.org/mkp/scsi/c/24411fcd6fe7 [5/8] scsi: lpfc: Fix retry of PRLI when status indicates its unsupported https://git.kernel.org/mkp/scsi/c/678768da9880 [6/8] scsi: lpfc: Fix validation of bsg reply lengths https://git.kernel.org/mkp/scsi/c/feb3cc57fb63 [7/8] scsi: lpfc: Fix LUN loss after cable pull https://git.kernel.org/mkp/scsi/c/00081c5ca4d5 [8/8] scsi: lpfc: Update lpfc version to 12.8.0.3 https://git.kernel.org/mkp/scsi/c/7e0e8be3a1fd
Signature · 1 line
Martin K. Petersen Oracle Linux Engineering