Commit dae0bb3e authored by Martin K. Petersen's avatar Martin K. Petersen
Browse files

Merge patch series "lpfc: Update lpfc to revision 14.2.0.10"

Justin Tee <justintee8345@gmail.com> says:

Update lpfc to revision 14.2.0.10

This patch set contains fixes for bugs, kernel test robot, and introduces
new attention type event handling.

Link: https://lore.kernel.org/r/20230109233317.54737-1-justintee8345@gmail.com


Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parents e63d2ea8 191b5a38
Loading
Loading
Loading
Loading
+1 −3
Original line number Diff line number Diff line
/*******************************************************************
 * This file is part of the Emulex Linux Device Driver for         *
 * Fibre Channel Host Bus Adapters.                                *
 * Copyright (C) 2017-2022 Broadcom. All Rights Reserved. The term *
 * Copyright (C) 2017-2023 Broadcom. All Rights Reserved. The term *
 * “Broadcom” refers to Broadcom Inc. and/or its subsidiaries.     *
 * Copyright (C) 2004-2016 Emulex.  All rights reserved.           *
 * EMULEX and SLI are trademarks of Emulex.                        *
@@ -1592,8 +1592,6 @@ struct lpfc_hba {
	struct timer_list cpuhp_poll_timer;
	struct list_head poll_list;	/* slowpath eq polling list */
#define LPFC_POLL_HB	1		/* slowpath heartbeat */
#define LPFC_POLL_FASTPATH	0	/* called from fastpath */
#define LPFC_POLL_SLOWPATH	1	/* called from slowpath */

	char os_host_name[MAXHOSTNAMELEN];

+25 −38
Original line number Diff line number Diff line
/*******************************************************************
 * This file is part of the Emulex Linux Device Driver for         *
 * Fibre Channel Host Bus Adapters.                                *
 * Copyright (C) 2017-2022 Broadcom. All Rights Reserved. The term *
 * Copyright (C) 2017-2023 Broadcom. All Rights Reserved. The term *
 * “Broadcom” refers to Broadcom Inc. and/or its subsidiaries.  *
 * Copyright (C) 2004-2016 Emulex.  All rights reserved.           *
 * EMULEX and SLI are trademarks of Emulex.                        *
@@ -1905,8 +1905,7 @@ lpfc_xcvr_data_show(struct device *dev, struct device_attribute *attr,
		goto out_free_rdp;
	}

	strncpy(chbuf, &rdp_context->page_a0[SSF_VENDOR_NAME], 16);
	chbuf[16] = 0;
	strscpy(chbuf, &rdp_context->page_a0[SSF_VENDOR_NAME], 16);

	len = scnprintf(buf, PAGE_SIZE - len, "VendorName:\t%s\n", chbuf);
	len += scnprintf(buf + len, PAGE_SIZE - len,
@@ -1914,17 +1913,13 @@ lpfc_xcvr_data_show(struct device *dev, struct device_attribute *attr,
			 (uint8_t)rdp_context->page_a0[SSF_VENDOR_OUI],
			 (uint8_t)rdp_context->page_a0[SSF_VENDOR_OUI + 1],
			 (uint8_t)rdp_context->page_a0[SSF_VENDOR_OUI + 2]);
	strncpy(chbuf, &rdp_context->page_a0[SSF_VENDOR_PN], 16);
	chbuf[16] = 0;
	strscpy(chbuf, &rdp_context->page_a0[SSF_VENDOR_PN], 16);
	len += scnprintf(buf + len, PAGE_SIZE - len, "VendorPN:\t%s\n", chbuf);
	strncpy(chbuf, &rdp_context->page_a0[SSF_VENDOR_SN], 16);
	chbuf[16] = 0;
	strscpy(chbuf, &rdp_context->page_a0[SSF_VENDOR_SN], 16);
	len += scnprintf(buf + len, PAGE_SIZE - len, "VendorSN:\t%s\n", chbuf);
	strncpy(chbuf, &rdp_context->page_a0[SSF_VENDOR_REV], 4);
	chbuf[4] = 0;
	strscpy(chbuf, &rdp_context->page_a0[SSF_VENDOR_REV], 4);
	len += scnprintf(buf + len, PAGE_SIZE - len, "VendorRev:\t%s\n", chbuf);
	strncpy(chbuf, &rdp_context->page_a0[SSF_DATE_CODE], 8);
	chbuf[8] = 0;
	strscpy(chbuf, &rdp_context->page_a0[SSF_DATE_CODE], 8);
	len += scnprintf(buf + len, PAGE_SIZE - len, "DateCode:\t%s\n", chbuf);
	len += scnprintf(buf + len, PAGE_SIZE - len, "Identifier:\t%xh\n",
			 (uint8_t)rdp_context->page_a0[SSF_IDENTIFIER]);
@@ -1942,30 +1937,22 @@ lpfc_xcvr_data_show(struct device *dev, struct device_attribute *attr,

	len += scnprintf(buf + len, PAGE_SIZE - len, "Speeds: \t");
	if (*(uint8_t *)trasn_code_byte7 == 0) {
			len += scnprintf(buf + len, PAGE_SIZE - len,
					 "Unknown\n");
		len += scnprintf(buf + len, PAGE_SIZE - len, "Unknown\n");
	} else {
		if (trasn_code_byte7->fc_sp_100MB)
				len += scnprintf(buf + len, PAGE_SIZE - len,
						 "1 ");
			len += scnprintf(buf + len, PAGE_SIZE - len, "1 ");
		if (trasn_code_byte7->fc_sp_200mb)
				len += scnprintf(buf + len, PAGE_SIZE - len,
						 "2 ");
			len += scnprintf(buf + len, PAGE_SIZE - len, "2 ");
		if (trasn_code_byte7->fc_sp_400MB)
				len += scnprintf(buf + len, PAGE_SIZE - len,
						 "4 ");
			len += scnprintf(buf + len, PAGE_SIZE - len, "4 ");
		if (trasn_code_byte7->fc_sp_800MB)
				len += scnprintf(buf + len, PAGE_SIZE - len,
						 "8 ");
			len += scnprintf(buf + len, PAGE_SIZE - len, "8 ");
		if (trasn_code_byte7->fc_sp_1600MB)
				len += scnprintf(buf + len, PAGE_SIZE - len,
						 "16 ");
			len += scnprintf(buf + len, PAGE_SIZE - len, "16 ");
		if (trasn_code_byte7->fc_sp_3200MB)
				len += scnprintf(buf + len, PAGE_SIZE - len,
						 "32 ");
			len += scnprintf(buf + len, PAGE_SIZE - len, "32 ");
		if (trasn_code_byte7->speed_chk_ecc)
				len += scnprintf(buf + len, PAGE_SIZE - len,
						 "64 ");
			len += scnprintf(buf + len, PAGE_SIZE - len, "64 ");
		len += scnprintf(buf + len, PAGE_SIZE - len, "GB\n");
	}
	temperature = (rdp_context->page_a2[SFF_TEMPERATURE_B1] << 8 |
+2 −2
Original line number Diff line number Diff line
/*******************************************************************
 * This file is part of the Emulex Linux Device Driver for         *
 * Fibre Channel Host Bus Adapters.                                *
 * Copyright (C) 2017-2022 Broadcom. All Rights Reserved. The term *
 * Copyright (C) 2017-2023 Broadcom. All Rights Reserved. The term *
 * “Broadcom” refers to Broadcom Inc. and/or its subsidiaries.     *
 * Copyright (C) 2004-2016 Emulex.  All rights reserved.           *
 * EMULEX and SLI are trademarks of Emulex.                        *
@@ -253,7 +253,6 @@ int lpfc_read_object(struct lpfc_hba *phba, char *s, uint32_t *datap,
		     uint32_t len);

void lpfc_sli4_cleanup_poll_list(struct lpfc_hba *phba);
int lpfc_sli4_poll_eq(struct lpfc_queue *q, uint8_t path);
void lpfc_sli4_poll_hbtimer(struct timer_list *t);
void lpfc_sli4_start_polling(struct lpfc_queue *q);
void lpfc_sli4_stop_polling(struct lpfc_queue *q);
@@ -684,6 +683,7 @@ int lpfc_vmid_get_appid(struct lpfc_vport *vport, char *uuid,
			union lpfc_vmid_io_tag *tag);
void lpfc_vmid_vport_cleanup(struct lpfc_vport *vport);
int lpfc_issue_els_qfpa(struct lpfc_vport *vport);
void lpfc_reinit_vmid(struct lpfc_vport *vport);

void lpfc_sli_rpi_release(struct lpfc_vport *vport,
			  struct lpfc_nodelist *ndlp);
+30 −3
Original line number Diff line number Diff line
/*******************************************************************
 * This file is part of the Emulex Linux Device Driver for         *
 * Fibre Channel Host Bus Adapters.                                *
 * Copyright (C) 2017-2022 Broadcom. All Rights Reserved. The term *
 * Copyright (C) 2017-2023 Broadcom. All Rights Reserved. The term *
 * “Broadcom” refers to Broadcom Inc. and/or its subsidiaries.     *
 * Copyright (C) 2004-2016 Emulex.  All rights reserved.           *
 * EMULEX and SLI are trademarks of Emulex.                        *
@@ -1123,6 +1123,9 @@ lpfc_cmpl_els_flogi(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb,
	if (sp->cmn.priority_tagging)
		vport->phba->pport->vmid_flag |= (LPFC_VMID_ISSUE_QFPA |
						  LPFC_VMID_TYPE_PRIO);
	/* reinitialize the VMID datastructure before returning */
	if (lpfc_is_vmid_enabled(phba))
		lpfc_reinit_vmid(vport);

	/*
	 * Address a timing race with dev_loss.  If dev_loss is active on
@@ -2373,15 +2376,30 @@ lpfc_cmpl_els_prli(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb,
		/* PRLI failed */
		lpfc_printf_vlog(vport, mode, loglevel,
				 "2754 PRLI failure DID:%06X Status:x%x/x%x, "
				 "data: x%x\n",
				 "data: x%x x%x\n",
				 ndlp->nlp_DID, ulp_status,
				 ulp_word4, ndlp->fc4_prli_sent);
				 ulp_word4, ndlp->nlp_state,
				 ndlp->fc4_prli_sent);

		/* Do not call DSM for lpfc_els_abort'ed ELS cmds */
		if (!lpfc_error_lost_link(ulp_status, ulp_word4))
			lpfc_disc_state_machine(vport, ndlp, cmdiocb,
						NLP_EVT_CMPL_PRLI);

		/* The following condition catches an inflight transition
		 * mismatch typically caused by an RSCN. Skip any
		 * processing to allow recovery.
		 */
		if (ndlp->nlp_state >= NLP_STE_PLOGI_ISSUE &&
		    ndlp->nlp_state <= NLP_STE_REG_LOGIN_ISSUE) {
			lpfc_printf_vlog(vport, KERN_WARNING, LOG_NODE,
					 "2784 PRLI cmpl: state mismatch "
					 "DID x%06x nstate x%x nflag x%x\n",
					 ndlp->nlp_DID, ndlp->nlp_state,
					 ndlp->nlp_flag);
				goto out;
		}

		/*
		 * For P2P topology, retain the node so that PLOGI can be
		 * attempted on it again.
@@ -4673,6 +4691,15 @@ lpfc_els_retry(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb,
				/* the nameserver fails */
				maxretry = 0;
				delay = 100;
			} else if (cmd == ELS_CMD_PRLI &&
				   ndlp->nlp_state != NLP_STE_PRLI_ISSUE) {
				/* State-command disagreement.  The PRLI was
				 * failed with an invalid rpi meaning there
				 * some unexpected state change.  Don't retry.
				 */
				maxretry = 0;
				retry = 0;
				break;
			}
			retry = 1;
			break;
+1 −16
Original line number Diff line number Diff line
/*******************************************************************
 * This file is part of the Emulex Linux Device Driver for         *
 * Fibre Channel Host Bus Adapters.                                *
 * Copyright (C) 2017-2022 Broadcom. All Rights Reserved. The term *
 * Copyright (C) 2017-2023 Broadcom. All Rights Reserved. The term *
 * “Broadcom” refers to Broadcom Inc. and/or its subsidiaries.     *
 * Copyright (C) 2004-2016 Emulex.  All rights reserved.           *
 * EMULEX and SLI are trademarks of Emulex.                        *
@@ -1129,21 +1129,6 @@ lpfc_cleanup_rpis(struct lpfc_vport *vport, int remove)
	struct lpfc_nodelist *ndlp, *next_ndlp;

	list_for_each_entry_safe(ndlp, next_ndlp, &vport->fc_nodes, nlp_listp) {
		if (ndlp->nlp_state == NLP_STE_UNUSED_NODE) {
			/* It's possible the FLOGI to the fabric node never
			 * successfully completed and never registered with the
			 * transport.  In this case there is no way to clean up
			 * the node.
			 */
			if (ndlp->nlp_DID == Fabric_DID) {
				if (ndlp->nlp_prev_state ==
				    NLP_STE_UNUSED_NODE &&
				    !ndlp->fc4_xpt_flags)
					lpfc_nlp_put(ndlp);
			}
			continue;
		}

		if ((phba->sli3_options & LPFC_SLI3_VPORT_TEARDOWN) ||
		    ((vport->port_type == LPFC_NPIV_PORT) &&
		     ((ndlp->nlp_DID == NameServer_DID) ||
Loading