diff mbox series

[v5,14/16] lpfc: vmid: Adding qfpa and vmid timeout check in worker thread

Message ID 1608096586-21656-15-git-send-email-muneendra.kumar@broadcom.com
State New
Headers show
Series [v5,01/16] cgroup: Added cgroup_get_from_id | expand

Commit Message

Muneendra Kumar Dec. 16, 2020, 5:29 a.m. UTC
From: Gaurav Srivastava <gaurav.srivastava@broadcom.com>

This patch add the periodic check for issuing of qfpa command and vmid
timeout in the worker thread. The inactivity timeout check is added via
the timer function.

Signed-off-by: Gaurav Srivastava  <gaurav.srivastava@broadcom.com>
Signed-off-by: James Smart <jsmart2021@gmail.com>

---
v5:
No change

v4:
No change

v3:
No change

v2:
Ported the patch on top of 5.10/scsi-queue
---
 drivers/scsi/lpfc/lpfc_hbadisc.c | 42 ++++++++++++++++++++++++++++++++
 1 file changed, 42 insertions(+)

Comments

kernel test robot Dec. 16, 2020, 6:31 p.m. UTC | #1
Hi Muneendra,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on scsi/for-next]
[also build test WARNING on mkp-scsi/for-next next-20201215]
[cannot apply to cgroup/for-next v5.10]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url:    https://github.com/0day-ci/linux/commits/Muneendra/blkcg-Support-to-track-FC-storage-blk-io-traffic/20201216-202913
base:   https://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi.git for-next
config: ia64-allmodconfig (attached as .config)
compiler: ia64-linux-gcc (GCC) 9.3.0
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # https://github.com/0day-ci/linux/commit/4bfc0dd58345c1a8eaf5c00475ca1b0472a0ba44
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Muneendra/blkcg-Support-to-track-FC-storage-blk-io-traffic/20201216-202913
        git checkout 4bfc0dd58345c1a8eaf5c00475ca1b0472a0ba44
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=ia64 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

All warnings (new ones prefixed by >>):

   drivers/scsi/lpfc/lpfc_hbadisc.c:318:6: warning: no previous prototype for 'lpfc_check_inactive_vmid' [-Wmissing-prototypes]
     318 | void lpfc_check_inactive_vmid(struct lpfc_hba *phba)
         |      ^~~~~~~~~~~~~~~~~~~~~~~~
>> drivers/scsi/lpfc/lpfc_hbadisc.c:431:6: warning: no previous prototype for 'lpfc_check_vmid_qfpa_issue' [-Wmissing-prototypes]
     431 | void lpfc_check_vmid_qfpa_issue(struct lpfc_hba *phba)
         |      ^~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/scsi/lpfc/lpfc_hbadisc.c: In function 'lpfc_check_vmid_qfpa_issue':
>> drivers/scsi/lpfc/lpfc_hbadisc.c:435:9: warning: variable 'ret' set but not used [-Wunused-but-set-variable]
     435 |  int i, ret;
         |         ^~~

Kconfig warnings: (for reference only)
   WARNING: unmet direct dependencies detected for FRAME_POINTER
   Depends on DEBUG_KERNEL && (M68K || UML || SUPERH) || ARCH_WANT_FRAME_POINTERS
   Selected by
   - FAULT_INJECTION_STACKTRACE_FILTER && FAULT_INJECTION_DEBUG_FS && STACKTRACE_SUPPORT && !X86_64 && !MIPS && !PPC && !S390 && !MICROBLAZE && !ARM && !ARC && !X86


vim +/lpfc_check_vmid_qfpa_issue +431 drivers/scsi/lpfc/lpfc_hbadisc.c

   430	
 > 431	void lpfc_check_vmid_qfpa_issue(struct lpfc_hba *phba)
   432	{
   433		struct lpfc_vport *vport;
   434		struct lpfc_vport **vports;
 > 435		int i, ret;
   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				ret = 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	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
diff mbox series

Patch

diff --git a/drivers/scsi/lpfc/lpfc_hbadisc.c b/drivers/scsi/lpfc/lpfc_hbadisc.c
index be71f3a47c95..3b36710cd47e 100644
--- a/drivers/scsi/lpfc/lpfc_hbadisc.c
+++ b/drivers/scsi/lpfc/lpfc_hbadisc.c
@@ -428,6 +428,32 @@  lpfc_dev_loss_tmo_handler(struct lpfc_nodelist *ndlp)
 	return fcf_inuse;
 }
 
+void lpfc_check_vmid_qfpa_issue(struct lpfc_hba *phba)
+{
+	struct lpfc_vport *vport;
+	struct lpfc_vport **vports;
+	int i, ret;
+
+	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) {
+			ret = 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.
@@ -748,6 +774,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)