Skip to content

Commit

Permalink
scsi: lpfc: vmid: Add QFPA and VMID timeout check in worker thread
Browse files Browse the repository at this point in the history
Add a periodic check for issuing of QFPA command and VMID timeout in the
worker thread. The inactivity timeout check is added via the timer
function.

Link: https://lore.kernel.org/r/20210608043556.274139-13-muneendra.kumar@broadcom.com
Reviewed-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Gaurav Srivastava <gaurav.srivastava@broadcom.com>
Signed-off-by: James Smart <jsmart2021@gmail.com>
Signed-off-by: Muneendra Kumar <muneendra.kumar@broadcom.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
  • Loading branch information
Gaurav Srivastava authored and Martin K. Petersen committed Jun 10, 2021
1 parent 2039717 commit 0c4792c
Showing 1 changed file with 43 additions and 0 deletions.
43 changes: 43 additions & 0 deletions drivers/scsi/lpfc/lpfc_hbadisc.c
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ static void lpfc_unregister_fcfi_cmpl(struct lpfc_hba *, LPFC_MBOXQ_t *);
static int lpfc_fcf_inuse(struct lpfc_hba *);
static void lpfc_mbx_cmpl_read_sparam(struct lpfc_hba *, LPFC_MBOXQ_t *);
static void lpfc_check_inactive_vmid(struct lpfc_hba *phba);
static void lpfc_check_vmid_qfpa_issue(struct lpfc_hba *phba);

static int
lpfc_valid_xpt_node(struct lpfc_nodelist *ndlp)
Expand Down Expand Up @@ -428,6 +429,32 @@ lpfc_dev_loss_tmo_handler(struct lpfc_nodelist *ndlp)
return fcf_inuse;
}

static void lpfc_check_vmid_qfpa_issue(struct lpfc_hba *phba)
{
struct lpfc_vport *vport;
struct lpfc_vport **vports;
int i;

vports = lpfc_create_vport_work_array(phba);
if (!vports)
return;

for (i = 0; i <= phba->max_vports; i++) {
if ((!vports[i]) && (i == 0))
vport = phba->pport;
else
vport = vports[i];
if (!vport)
break;

if (vport->vmid_flag & LPFC_VMID_ISSUE_QFPA) {
if (!lpfc_issue_els_qfpa(vport))
vport->vmid_flag &= ~LPFC_VMID_ISSUE_QFPA;
}
}
lpfc_destroy_vport_work_array(phba, vports);
}

/**
* lpfc_sli4_post_dev_loss_tmo_handler - SLI4 post devloss timeout handler
* @phba: Pointer to hba context object.
Expand Down Expand Up @@ -748,6 +775,22 @@ lpfc_work_done(struct lpfc_hba *phba)
if (ha_copy & HA_LATT)
lpfc_handle_latt(phba);

/* Handle VMID Events */
if (lpfc_is_vmid_enabled(phba)) {
if (phba->pport->work_port_events &
WORKER_CHECK_VMID_ISSUE_QFPA) {
lpfc_check_vmid_qfpa_issue(phba);
phba->pport->work_port_events &=
~WORKER_CHECK_VMID_ISSUE_QFPA;
}
if (phba->pport->work_port_events &
WORKER_CHECK_INACTIVE_VMID) {
lpfc_check_inactive_vmid(phba);
phba->pport->work_port_events &=
~WORKER_CHECK_INACTIVE_VMID;
}
}

/* Process SLI4 events */
if (phba->pci_dev_grp == LPFC_PCI_DEV_OC) {
if (phba->hba_flag & HBA_RRQ_ACTIVE)
Expand Down

0 comments on commit 0c4792c

Please sign in to comment.