lpfc_debugfs_cpucheck_data(struct lpfc_vport *vport, char *buf, int size)
 {
        struct lpfc_hba   *phba = vport->phba;
-       int i;
+       struct lpfc_sli4_hdw_queue *qp;
+       int i, j;
        int len = 0;
-       uint32_t tot_xmt = 0;
-       uint32_t tot_rcv = 0;
-       uint32_t tot_cmpl = 0;
-       uint32_t tot_ccmpl = 0;
+       uint32_t tot_xmt;
+       uint32_t tot_rcv;
+       uint32_t tot_cmpl;
 
-       if (phba->nvmet_support == 0) {
-               /* NVME Initiator */
-               len += snprintf(buf + len, PAGE_SIZE - len,
-                               "CPUcheck %s\n",
-                               (phba->cpucheck_on & LPFC_CHECK_NVME_IO ?
-                                       "Enabled" : "Disabled"));
-               for (i = 0; i < phba->sli4_hba.num_present_cpu; i++) {
-                       if (i >= LPFC_CHECK_CPU_CNT)
-                               break;
-                       len += snprintf(buf + len, PAGE_SIZE - len,
-                                       "%02d: xmit x%08x cmpl x%08x\n",
-                                       i, phba->cpucheck_xmt_io[i],
-                                       phba->cpucheck_cmpl_io[i]);
-                       tot_xmt += phba->cpucheck_xmt_io[i];
-                       tot_cmpl += phba->cpucheck_cmpl_io[i];
-               }
+       len += snprintf(buf + len, PAGE_SIZE - len,
+                       "CPUcheck %s ",
+                       (phba->cpucheck_on & LPFC_CHECK_NVME_IO ?
+                               "Enabled" : "Disabled"));
+       if (phba->nvmet_support) {
                len += snprintf(buf + len, PAGE_SIZE - len,
-                               "tot:xmit x%08x cmpl x%08x\n",
-                               tot_xmt, tot_cmpl);
-               return len;
+                               "%s\n",
+                               (phba->cpucheck_on & LPFC_CHECK_NVMET_RCV ?
+                                       "Rcv Enabled\n" : "Rcv Disabled\n"));
+       } else {
+               len += snprintf(buf + len, PAGE_SIZE - len, "\n");
        }
 
-       /* NVME Target */
-       len += snprintf(buf + len, PAGE_SIZE - len,
-                       "CPUcheck %s ",
-                       (phba->cpucheck_on & LPFC_CHECK_NVMET_IO ?
-                               "IO Enabled - " : "IO Disabled - "));
-       len += snprintf(buf + len, PAGE_SIZE - len,
-                       "%s\n",
-                       (phba->cpucheck_on & LPFC_CHECK_NVMET_RCV ?
-                               "Rcv Enabled\n" : "Rcv Disabled\n"));
-       for (i = 0; i < phba->sli4_hba.num_present_cpu; i++) {
-               if (i >= LPFC_CHECK_CPU_CNT)
-                       break;
+       for (i = 0; i < phba->cfg_hdw_queue; i++) {
+               qp = &phba->sli4_hba.hdwq[i];
+
+               tot_rcv = 0;
+               tot_xmt = 0;
+               tot_cmpl = 0;
+               for (j = 0; j < LPFC_CHECK_CPU_CNT; j++) {
+                       tot_xmt += qp->cpucheck_xmt_io[j];
+                       tot_cmpl += qp->cpucheck_cmpl_io[j];
+                       if (phba->nvmet_support)
+                               tot_rcv += qp->cpucheck_rcv_io[j];
+               }
+
+               /* Only display Hardware Qs with something */
+               if (!tot_xmt && !tot_cmpl && !tot_rcv)
+                       continue;
+
+               len += snprintf(buf + len, PAGE_SIZE - len,
+                               "HDWQ %03d: ", i);
+               for (j = 0; j < LPFC_CHECK_CPU_CNT; j++) {
+                       /* Only display non-zero counters */
+                       if (!qp->cpucheck_xmt_io[j] &&
+                           !qp->cpucheck_cmpl_io[j] &&
+                           !qp->cpucheck_rcv_io[j])
+                               continue;
+                       if (phba->nvmet_support) {
+                               len += snprintf(buf + len, PAGE_SIZE - len,
+                                               "CPU %03d: %x/%x/%x ", j,
+                                               qp->cpucheck_rcv_io[j],
+                                               qp->cpucheck_xmt_io[j],
+                                               qp->cpucheck_cmpl_io[j]);
+                       } else {
+                               len += snprintf(buf + len, PAGE_SIZE - len,
+                                               "CPU %03d: %x/%x ", j,
+                                               qp->cpucheck_xmt_io[j],
+                                               qp->cpucheck_cmpl_io[j]);
+                       }
+               }
                len += snprintf(buf + len, PAGE_SIZE - len,
-                               "%02d: xmit x%08x ccmpl x%08x "
-                               "cmpl x%08x rcv x%08x\n",
-                               i, phba->cpucheck_xmt_io[i],
-                               phba->cpucheck_ccmpl_io[i],
-                               phba->cpucheck_cmpl_io[i],
-                               phba->cpucheck_rcv_io[i]);
-               tot_xmt += phba->cpucheck_xmt_io[i];
-               tot_rcv += phba->cpucheck_rcv_io[i];
-               tot_cmpl += phba->cpucheck_cmpl_io[i];
-               tot_ccmpl += phba->cpucheck_ccmpl_io[i];
+                               "Total: %x\n", tot_xmt);
        }
-       len += snprintf(buf + len, PAGE_SIZE - len,
-                       "tot:xmit x%08x ccmpl x%08x cmpl x%08x rcv x%08x\n",
-                       tot_xmt, tot_ccmpl, tot_cmpl, tot_rcv);
        return len;
 }
 
        struct lpfc_debug *debug = file->private_data;
        struct lpfc_vport *vport = (struct lpfc_vport *)debug->i_private;
        struct lpfc_hba   *phba = vport->phba;
+       struct lpfc_sli4_hdw_queue *qp;
        char mybuf[64];
        char *pbuf;
-       int i;
+       int i, j;
 
        if (nbytes > 64)
                nbytes = 64;
                return strlen(pbuf);
        } else if ((strncmp(pbuf, "zero",
                   sizeof("zero") - 1) == 0)) {
-               for (i = 0; i < phba->sli4_hba.num_present_cpu; i++) {
-                       if (i >= LPFC_CHECK_CPU_CNT)
-                               break;
-                       phba->cpucheck_rcv_io[i] = 0;
-                       phba->cpucheck_xmt_io[i] = 0;
-                       phba->cpucheck_cmpl_io[i] = 0;
-                       phba->cpucheck_ccmpl_io[i] = 0;
+               for (i = 0; i < phba->cfg_hdw_queue; i++) {
+                       qp = &phba->sli4_hba.hdwq[i];
+
+                       for (j = 0; j < LPFC_CHECK_CPU_CNT; j++) {
+                               qp->cpucheck_rcv_io[j] = 0;
+                               qp->cpucheck_xmt_io[j] = 0;
+                               qp->cpucheck_cmpl_io[j] = 0;
+                       }
                }
                return strlen(pbuf);
        }
                /* Setup hbqinfo */
                snprintf(name, sizeof(name), "hbqinfo");
                phba->debug_hbqinfo =
-                       debugfs_create_file(name, S_IFREG|S_IRUGO|S_IWUSR,
-                                phba->hba_debugfs_root,
-                                phba, &lpfc_debugfs_op_hbqinfo);
+                       debugfs_create_file(name, S_IFREG | 0644,
+                                           phba->hba_debugfs_root,
+                                           phba, &lpfc_debugfs_op_hbqinfo);
 
                /* Setup hdwqinfo */
                snprintf(name, sizeof(name), "hdwqinfo");
                                            phba, &lpfc_debugfs_op_hdwqinfo);
                if (!phba->debug_hdwqinfo) {
                        lpfc_printf_vlog(vport, KERN_ERR, LOG_INIT,
-                                        "0411 Cant create debugfs hdwqinfo\n");
+                                        "0511 Cant create debugfs hdwqinfo\n");
                        goto debug_failed;
                }
 
 
        struct lpfc_nvme_fcpreq_priv *freqpriv;
        struct lpfc_nvme_lport *lport;
        struct lpfc_nvme_ctrl_stat *cstat;
-       uint32_t code, status, idx;
+       uint32_t code, status, idx, cpu;
        uint16_t cid, sqhd, data;
        uint32_t *ptr;
 
                lpfc_nvme_ktime(phba, lpfc_ncmd);
        }
        if (phba->cpucheck_on & LPFC_CHECK_NVME_IO) {
-               if (lpfc_ncmd->cpu != smp_processor_id())
-                       lpfc_printf_vlog(vport, KERN_ERR, LOG_NVME_IOERR,
-                                        "6701 CPU Check cmpl: "
-                                        "cpu %d expect %d\n",
-                                        smp_processor_id(), lpfc_ncmd->cpu);
-               if (lpfc_ncmd->cpu < LPFC_CHECK_CPU_CNT)
-                       phba->cpucheck_cmpl_io[lpfc_ncmd->cpu]++;
+               idx = lpfc_ncmd->cur_iocbq.hba_wqidx;
+               cpu = smp_processor_id();
+               if (cpu < LPFC_CHECK_CPU_CNT) {
+                       if (lpfc_ncmd->cpu != cpu)
+                               lpfc_printf_vlog(vport,
+                                                KERN_INFO, LOG_NVME_IOERR,
+                                                "6701 CPU Check cmpl: "
+                                                "cpu %d expect %d\n",
+                                                cpu, lpfc_ncmd->cpu);
+                       phba->sli4_hba.hdwq[idx].cpucheck_cmpl_io[cpu]++;
+               }
        }
 #endif
 
 {
        int ret = 0;
        int expedite = 0;
-       int idx;
+       int idx, cpu;
        struct lpfc_nvme_lport *lport;
        struct lpfc_nvme_ctrl_stat *cstat;
        struct lpfc_vport *vport;
                lpfc_ncmd->ts_cmd_wqput = ktime_get_ns();
 
        if (phba->cpucheck_on & LPFC_CHECK_NVME_IO) {
-               lpfc_ncmd->cpu = smp_processor_id();
-               if (lpfc_ncmd->cpu != lpfc_queue_info->index) {
-                       /* Check for admin queue */
-                       if (lpfc_queue_info->qidx) {
+               cpu = smp_processor_id();
+               if (cpu < LPFC_CHECK_CPU_CNT) {
+                       lpfc_ncmd->cpu = cpu;
+                       if (idx != cpu)
                                lpfc_printf_vlog(vport,
-                                                KERN_ERR, LOG_NVME_IOERR,
+                                                KERN_INFO, LOG_NVME_IOERR,
                                                "6702 CPU Check cmd: "
                                                "cpu %d wq %d\n",
                                                lpfc_ncmd->cpu,
                                                lpfc_queue_info->index);
-                       }
-                       lpfc_ncmd->cpu = lpfc_queue_info->index;
+                       phba->sli4_hba.hdwq[idx].cpucheck_xmt_io[cpu]++;
                }
-               if (lpfc_ncmd->cpu < LPFC_CHECK_CPU_CNT)
-                       phba->cpucheck_xmt_io[lpfc_ncmd->cpu]++;
        }
 #endif
        return 0;
 
                                        ktime_get_ns();
                        }
                }
-               if (phba->cpucheck_on & LPFC_CHECK_NVMET_IO) {
-                       id = smp_processor_id();
-                       if (ctxp->cpu != id)
-                               lpfc_printf_log(phba, KERN_ERR, LOG_NVME_IOERR,
-                                               "6703 CPU Check cmpl: "
-                                               "cpu %d expect %d\n",
-                                               id, ctxp->cpu);
-                       if (ctxp->cpu < LPFC_CHECK_CPU_CNT)
-                               phba->cpucheck_cmpl_io[id]++;
-               }
 #endif
                rsp->done(rsp);
 #ifdef CONFIG_SCSI_LPFC_DEBUG_FS
                        ctxp->ts_isr_data = cmdwqe->isr_timestamp;
                        ctxp->ts_data_nvme = ktime_get_ns();
                }
-               if (phba->cpucheck_on & LPFC_CHECK_NVMET_IO) {
-                       id = smp_processor_id();
+#endif
+               rsp->done(rsp);
+       }
+#ifdef CONFIG_SCSI_LPFC_DEBUG_FS
+       if (phba->cpucheck_on & LPFC_CHECK_NVMET_IO) {
+               id = smp_processor_id();
+               if (id < LPFC_CHECK_CPU_CNT) {
                        if (ctxp->cpu != id)
-                               lpfc_printf_log(phba, KERN_ERR, LOG_NVME_IOERR,
+                               lpfc_printf_log(phba, KERN_INFO, LOG_NVME_IOERR,
                                                "6704 CPU Check cmdcmpl: "
                                                "cpu %d expect %d\n",
                                                id, ctxp->cpu);
-                       if (ctxp->cpu < LPFC_CHECK_CPU_CNT)
-                               phba->cpucheck_ccmpl_io[id]++;
+                       phba->sli4_hba.hdwq[rsp->hwqid].cpucheck_cmpl_io[id]++;
                }
-#endif
-               rsp->done(rsp);
        }
+#endif
 }
 
 static int
        }
        if (phba->cpucheck_on & LPFC_CHECK_NVMET_IO) {
                int id = smp_processor_id();
-               ctxp->cpu = id;
-               if (id < LPFC_CHECK_CPU_CNT)
-                       phba->cpucheck_xmt_io[id]++;
-               if (rsp->hwqid != id) {
-                       lpfc_printf_log(phba, KERN_ERR, LOG_NVME_IOERR,
-                                       "6705 CPU Check OP: "
-                                       "cpu %d expect %d\n",
-                                       id, rsp->hwqid);
-                       ctxp->cpu = rsp->hwqid;
+               if (id < LPFC_CHECK_CPU_CNT) {
+                       if (rsp->hwqid != id)
+                               lpfc_printf_log(phba, KERN_INFO, LOG_NVME_IOERR,
+                                               "6705 CPU Check OP: "
+                                               "cpu %d expect %d\n",
+                                               id, rsp->hwqid);
+                       phba->sli4_hba.hdwq[rsp->hwqid].cpucheck_xmt_io[id]++;
                }
+               ctxp->cpu = id; /* Setup cpu for cmpl check */
        }
 #endif
 
        uint32_t size, oxid, sid, rc, qno;
        unsigned long iflag;
        int current_cpu;
-#ifdef CONFIG_SCSI_LPFC_DEBUG_FS
-       uint32_t id;
-#endif
 
        if (!IS_ENABLED(CONFIG_NVME_TARGET_FC))
                return;
 
 #ifdef CONFIG_SCSI_LPFC_DEBUG_FS
        if (phba->cpucheck_on & LPFC_CHECK_NVMET_RCV) {
-               id = smp_processor_id();
-               if (id < LPFC_CHECK_CPU_CNT)
-                       phba->cpucheck_rcv_io[id]++;
+               if (current_cpu < LPFC_CHECK_CPU_CNT) {
+                       if (idx != current_cpu)
+                               lpfc_printf_log(phba, KERN_INFO, LOG_NVME_IOERR,
+                                               "6703 CPU Check rcv: "
+                                               "cpu %d expect %d\n",
+                                               current_cpu, idx);
+                       phba->sli4_hba.hdwq[idx].cpucheck_rcv_io[current_cpu]++;
+               }
        }
 #endif