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.

scsi: lpfc: vmid: Add QFPA and VMID timeout check in worker thread

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>

authored by

Gaurav Srivastava and committed by
Martin K. Petersen
0c4792c6 20397179

+43
+43
drivers/scsi/lpfc/lpfc_hbadisc.c
··· 73 73 static int lpfc_fcf_inuse(struct lpfc_hba *); 74 74 static void lpfc_mbx_cmpl_read_sparam(struct lpfc_hba *, LPFC_MBOXQ_t *); 75 75 static void lpfc_check_inactive_vmid(struct lpfc_hba *phba); 76 + static void lpfc_check_vmid_qfpa_issue(struct lpfc_hba *phba); 76 77 77 78 static int 78 79 lpfc_valid_xpt_node(struct lpfc_nodelist *ndlp) ··· 429 428 return fcf_inuse; 430 429 } 431 430 431 + static void lpfc_check_vmid_qfpa_issue(struct lpfc_hba *phba) 432 + { 433 + struct lpfc_vport *vport; 434 + struct lpfc_vport **vports; 435 + int i; 436 + 437 + vports = lpfc_create_vport_work_array(phba); 438 + if (!vports) 439 + return; 440 + 441 + for (i = 0; i <= phba->max_vports; i++) { 442 + if ((!vports[i]) && (i == 0)) 443 + vport = phba->pport; 444 + else 445 + vport = vports[i]; 446 + if (!vport) 447 + break; 448 + 449 + if (vport->vmid_flag & LPFC_VMID_ISSUE_QFPA) { 450 + if (!lpfc_issue_els_qfpa(vport)) 451 + vport->vmid_flag &= ~LPFC_VMID_ISSUE_QFPA; 452 + } 453 + } 454 + lpfc_destroy_vport_work_array(phba, vports); 455 + } 456 + 432 457 /** 433 458 * lpfc_sli4_post_dev_loss_tmo_handler - SLI4 post devloss timeout handler 434 459 * @phba: Pointer to hba context object. ··· 774 747 775 748 if (ha_copy & HA_LATT) 776 749 lpfc_handle_latt(phba); 750 + 751 + /* Handle VMID Events */ 752 + if (lpfc_is_vmid_enabled(phba)) { 753 + if (phba->pport->work_port_events & 754 + WORKER_CHECK_VMID_ISSUE_QFPA) { 755 + lpfc_check_vmid_qfpa_issue(phba); 756 + phba->pport->work_port_events &= 757 + ~WORKER_CHECK_VMID_ISSUE_QFPA; 758 + } 759 + if (phba->pport->work_port_events & 760 + WORKER_CHECK_INACTIVE_VMID) { 761 + lpfc_check_inactive_vmid(phba); 762 + phba->pport->work_port_events &= 763 + ~WORKER_CHECK_INACTIVE_VMID; 764 + } 765 + } 777 766 778 767 /* Process SLI4 events */ 779 768 if (phba->pci_dev_grp == LPFC_PCI_DEV_OC) {