diff mbox series

[v8,net-next,03/12] octeontx2-af: add debugfs entries for CPT block

Message ID 20201019114157.4347-4-schalla@marvell.com
State Superseded
Headers show
Series Add Support for Marvell OcteonTX2 | expand

Commit Message

Srujana Challa Oct. 19, 2020, 11:41 a.m. UTC
Add entries to debugfs at /sys/kernel/debug/octeontx2/cpt.

cpt_pc: dump cpt performance HW registers.
Usage:
cat /sys/kernel/debug/octeontx2/cpt/cpt_pc

cpt_ae_sts: show cpt asymmetric engines current state
Usage:
cat /sys/kernel/debug/octeontx2/cpt/cpt_ae_sts

cpt_se_sts: show cpt symmetric engines current state
Usage:
cat /sys/kernel/debug/octeontx2/cpt/cpt_se_sts

cpt_engines_info: dump cpt engine control registers.
Usage:
cat /sys/kernel/debug/octeontx2/cpt/cpt_engines_info

cpt_lfs_info: dump cpt lfs control registers.
Usage:
cat /sys/kernel/debug/octeontx2/cpt/cpt_lfs_info

cpt_err_info: dump cpt error registers.
Usage:
cat /sys/kernel/debug/octeontx2/cpt/cpt_err_info

Signed-off-by: Suheil Chandran <schandran@marvell.com>
Signed-off-by: Srujana Challa <schalla@marvell.com>
---
 .../net/ethernet/marvell/octeontx2/af/rvu.h   |   1 +
 .../marvell/octeontx2/af/rvu_debugfs.c        | 304 ++++++++++++++++++
 2 files changed, 305 insertions(+)

Comments

kernel test robot Oct. 19, 2020, 6:46 p.m. UTC | #1
Hi Srujana,

I love your patch! Yet something to improve:

[auto build test ERROR on ipvs/master]
[also build test ERROR on linus/master v5.9 next-20201016]
[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/Srujana-Challa/octeontx2-af-add-debugfs-entries-for-CPT-block/20201019-195132
base:   https://git.kernel.org/pub/scm/linux/kernel/git/horms/ipvs.git master
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/4db4fc3ee5a5608c1ae16cc905c7ad97eecc9ded
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Srujana-Challa/octeontx2-af-add-debugfs-entries-for-CPT-block/20201019-195132
        git checkout 4db4fc3ee5a5608c1ae16cc905c7ad97eecc9ded
        # 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 errors (new ones prefixed by >>):

   drivers/net/ethernet/marvell/octeontx2/af/rvu_debugfs.c: In function 'rvu_dbg_cpt_ae_sts_display':
   drivers/net/ethernet/marvell/octeontx2/af/rvu_debugfs.c:1693:33: error: 'CPT_AF_CONSTANTS1' undeclared (first use in this function); did you mean 'CPT_AF_CONSTANTS0'?
    1693 |  reg = rvu_read64(rvu, blkaddr, CPT_AF_CONSTANTS1);
         |                                 ^~~~~~~~~~~~~~~~~
         |                                 CPT_AF_CONSTANTS0
   drivers/net/ethernet/marvell/octeontx2/af/rvu_debugfs.c:1693:33: note: each undeclared identifier is reported only once for each function it appears in
   drivers/net/ethernet/marvell/octeontx2/af/rvu_debugfs.c:1702:34: error: implicit declaration of function 'CPT_AF_EXEX_STS' [-Werror=implicit-function-declaration]
    1702 |   reg = rvu_read64(rvu, blkaddr, CPT_AF_EXEX_STS(e));
         |                                  ^~~~~~~~~~~~~~~
   drivers/net/ethernet/marvell/octeontx2/af/rvu_debugfs.c: In function 'rvu_dbg_cpt_se_sts_display':
   drivers/net/ethernet/marvell/octeontx2/af/rvu_debugfs.c:1730:33: error: 'CPT_AF_CONSTANTS1' undeclared (first use in this function); did you mean 'CPT_AF_CONSTANTS0'?
    1730 |  reg = rvu_read64(rvu, blkaddr, CPT_AF_CONSTANTS1);
         |                                 ^~~~~~~~~~~~~~~~~
         |                                 CPT_AF_CONSTANTS0
   drivers/net/ethernet/marvell/octeontx2/af/rvu_debugfs.c: In function 'rvu_dbg_cpt_ie_sts_display':
   drivers/net/ethernet/marvell/octeontx2/af/rvu_debugfs.c:1765:33: error: 'CPT_AF_CONSTANTS1' undeclared (first use in this function); did you mean 'CPT_AF_CONSTANTS0'?
    1765 |  reg = rvu_read64(rvu, blkaddr, CPT_AF_CONSTANTS1);
         |                                 ^~~~~~~~~~~~~~~~~
         |                                 CPT_AF_CONSTANTS0
   drivers/net/ethernet/marvell/octeontx2/af/rvu_debugfs.c: In function 'rvu_dbg_cpt_engines_info_display':
   drivers/net/ethernet/marvell/octeontx2/af/rvu_debugfs.c:1800:33: error: 'CPT_AF_CONSTANTS1' undeclared (first use in this function); did you mean 'CPT_AF_CONSTANTS0'?
    1800 |  reg = rvu_read64(rvu, blkaddr, CPT_AF_CONSTANTS1);
         |                                 ^~~~~~~~~~~~~~~~~
         |                                 CPT_AF_CONSTANTS0
   drivers/net/ethernet/marvell/octeontx2/af/rvu_debugfs.c:1809:34: error: implicit declaration of function 'CPT_AF_EXEX_CTL2' [-Werror=implicit-function-declaration]
    1809 |   reg = rvu_read64(rvu, blkaddr, CPT_AF_EXEX_CTL2(e));
         |                                  ^~~~~~~~~~~~~~~~
   drivers/net/ethernet/marvell/octeontx2/af/rvu_debugfs.c:1812:34: error: implicit declaration of function 'CPT_AF_EXEX_ACTIVE' [-Werror=implicit-function-declaration]
    1812 |   reg = rvu_read64(rvu, blkaddr, CPT_AF_EXEX_ACTIVE(e));
         |                                  ^~~~~~~~~~~~~~~~~~
   drivers/net/ethernet/marvell/octeontx2/af/rvu_debugfs.c:1815:34: error: implicit declaration of function 'CPT_AF_EXEX_CTL' [-Werror=implicit-function-declaration]
    1815 |   reg = rvu_read64(rvu, blkaddr, CPT_AF_EXEX_CTL(e));
         |                                  ^~~~~~~~~~~~~~~
   drivers/net/ethernet/marvell/octeontx2/af/rvu_debugfs.c: In function 'rvu_dbg_cpt_lfs_info_display':
   drivers/net/ethernet/marvell/octeontx2/af/rvu_debugfs.c:1844:34: error: implicit declaration of function 'CPT_AF_LFX_CTL'; did you mean 'CPT_AF_LF_RST'? [-Werror=implicit-function-declaration]
    1844 |   reg = rvu_read64(rvu, blkaddr, CPT_AF_LFX_CTL(lf));
         |                                  ^~~~~~~~~~~~~~
         |                                  CPT_AF_LF_RST
   drivers/net/ethernet/marvell/octeontx2/af/rvu_debugfs.c:1846:34: error: implicit declaration of function 'CPT_AF_LFX_CTL2'; did you mean 'CPT_AF_LF_RST'? [-Werror=implicit-function-declaration]
    1846 |   reg = rvu_read64(rvu, blkaddr, CPT_AF_LFX_CTL2(lf));
         |                                  ^~~~~~~~~~~~~~~
         |                                  CPT_AF_LF_RST
   drivers/net/ethernet/marvell/octeontx2/af/rvu_debugfs.c:1848:34: error: implicit declaration of function 'CPT_AF_LFX_PTR_CTL'; did you mean 'CPT_AF_LF_RST'? [-Werror=implicit-function-declaration]
    1848 |   reg = rvu_read64(rvu, blkaddr, CPT_AF_LFX_PTR_CTL(lf));
         |                                  ^~~~~~~~~~~~~~~~~~
         |                                  CPT_AF_LF_RST
   drivers/net/ethernet/marvell/octeontx2/af/rvu_debugfs.c: In function 'rvu_dbg_cpt_err_info_display':
   drivers/net/ethernet/marvell/octeontx2/af/rvu_debugfs.c:1870:34: error: implicit declaration of function 'CPT_AF_FLTX_INT'; did you mean 'CPT_AF_BLK_RST'? [-Werror=implicit-function-declaration]
    1870 |  reg0 = rvu_read64(rvu, blkaddr, CPT_AF_FLTX_INT(0));
         |                                  ^~~~~~~~~~~~~~~
         |                                  CPT_AF_BLK_RST
   drivers/net/ethernet/marvell/octeontx2/af/rvu_debugfs.c:1873:34: error: implicit declaration of function 'CPT_AF_PSNX_EXE' [-Werror=implicit-function-declaration]
    1873 |  reg0 = rvu_read64(rvu, blkaddr, CPT_AF_PSNX_EXE(0));
         |                                  ^~~~~~~~~~~~~~~
   drivers/net/ethernet/marvell/octeontx2/af/rvu_debugfs.c:1876:34: error: implicit declaration of function 'CPT_AF_PSNX_LF' [-Werror=implicit-function-declaration]
    1876 |  reg0 = rvu_read64(rvu, blkaddr, CPT_AF_PSNX_LF(0));
         |                                  ^~~~~~~~~~~~~~
   drivers/net/ethernet/marvell/octeontx2/af/rvu_debugfs.c:1878:34: error: 'CPT_AF_RVU_INT' undeclared (first use in this function); did you mean 'NPA_AF_RVU_INT'?
    1878 |  reg0 = rvu_read64(rvu, blkaddr, CPT_AF_RVU_INT);
         |                                  ^~~~~~~~~~~~~~
         |                                  NPA_AF_RVU_INT
   drivers/net/ethernet/marvell/octeontx2/af/rvu_debugfs.c:1880:34: error: 'CPT_AF_RAS_INT' undeclared (first use in this function); did you mean 'NPA_AF_RVU_INT'?
    1880 |  reg0 = rvu_read64(rvu, blkaddr, CPT_AF_RAS_INT);
         |                                  ^~~~~~~~~~~~~~
         |                                  NPA_AF_RVU_INT
   drivers/net/ethernet/marvell/octeontx2/af/rvu_debugfs.c:1882:34: error: 'CPT_AF_EXE_ERR_INFO' undeclared (first use in this function)
    1882 |  reg0 = rvu_read64(rvu, blkaddr, CPT_AF_EXE_ERR_INFO);
         |                                  ^~~~~~~~~~~~~~~~~~~
   drivers/net/ethernet/marvell/octeontx2/af/rvu_debugfs.c: In function 'rvu_dbg_cpt_pc_display':
>> drivers/net/ethernet/marvell/octeontx2/af/rvu_debugfs.c:1901:33: error: 'CPT_AF_INST_REQ_PC' undeclared (first use in this function)
    1901 |  reg = rvu_read64(rvu, blkaddr, CPT_AF_INST_REQ_PC);
         |                                 ^~~~~~~~~~~~~~~~~~
   drivers/net/ethernet/marvell/octeontx2/af/rvu_debugfs.c:1903:33: error: 'CPT_AF_INST_LATENCY_PC' undeclared (first use in this function)
    1903 |  reg = rvu_read64(rvu, blkaddr, CPT_AF_INST_LATENCY_PC);
         |                                 ^~~~~~~~~~~~~~~~~~~~~~
   drivers/net/ethernet/marvell/octeontx2/af/rvu_debugfs.c:1905:33: error: 'CPT_AF_RD_REQ_PC' undeclared (first use in this function)
    1905 |  reg = rvu_read64(rvu, blkaddr, CPT_AF_RD_REQ_PC);
         |                                 ^~~~~~~~~~~~~~~~
   drivers/net/ethernet/marvell/octeontx2/af/rvu_debugfs.c:1907:33: error: 'CPT_AF_RD_LATENCY_PC' undeclared (first use in this function)
    1907 |  reg = rvu_read64(rvu, blkaddr, CPT_AF_RD_LATENCY_PC);
         |                                 ^~~~~~~~~~~~~~~~~~~~
   drivers/net/ethernet/marvell/octeontx2/af/rvu_debugfs.c:1909:33: error: 'CPT_AF_RD_UC_PC' undeclared (first use in this function)
    1909 |  reg = rvu_read64(rvu, blkaddr, CPT_AF_RD_UC_PC);
         |                                 ^~~~~~~~~~~~~~~
   drivers/net/ethernet/marvell/octeontx2/af/rvu_debugfs.c:1911:33: error: 'CPT_AF_ACTIVE_CYCLES_PC' undeclared (first use in this function); did you mean 'NPA_AF_ACTIVE_CYCLES_PC'?
    1911 |  reg = rvu_read64(rvu, blkaddr, CPT_AF_ACTIVE_CYCLES_PC);
         |                                 ^~~~~~~~~~~~~~~~~~~~~~~
         |                                 NPA_AF_ACTIVE_CYCLES_PC
   drivers/net/ethernet/marvell/octeontx2/af/rvu_debugfs.c:1913:33: error: 'CPT_AF_CPTCLK_CNT' undeclared (first use in this function); did you mean 'CPT_AF_BLK_RST'?
    1913 |  reg = rvu_read64(rvu, blkaddr, CPT_AF_CPTCLK_CNT);
         |                                 ^~~~~~~~~~~~~~~~~
         |                                 CPT_AF_BLK_RST
   cc1: some warnings being treated as errors

vim +/CPT_AF_INST_REQ_PC +1901 drivers/net/ethernet/marvell/octeontx2/af/rvu_debugfs.c

  1889	
  1890	static int rvu_dbg_cpt_pc_display(struct seq_file *filp, void *unused)
  1891	{
  1892		struct rvu *rvu;
  1893		int blkaddr;
  1894		u64 reg;
  1895	
  1896		rvu = filp->private;
  1897		blkaddr = rvu_get_blkaddr(rvu, BLKTYPE_CPT, 0);
  1898		if (blkaddr < 0)
  1899			return -ENODEV;
  1900	
> 1901		reg = rvu_read64(rvu, blkaddr, CPT_AF_INST_REQ_PC);
  1902		seq_printf(filp, "CPT instruction requests   %llu\n", reg);
  1903		reg = rvu_read64(rvu, blkaddr, CPT_AF_INST_LATENCY_PC);
  1904		seq_printf(filp, "CPT instruction latency    %llu\n", reg);
  1905		reg = rvu_read64(rvu, blkaddr, CPT_AF_RD_REQ_PC);
  1906		seq_printf(filp, "CPT NCB read requests      %llu\n", reg);
  1907		reg = rvu_read64(rvu, blkaddr, CPT_AF_RD_LATENCY_PC);
  1908		seq_printf(filp, "CPT NCB read latency       %llu\n", reg);
  1909		reg = rvu_read64(rvu, blkaddr, CPT_AF_RD_UC_PC);
  1910		seq_printf(filp, "CPT read requests caused by UC fills   %llu\n", reg);
  1911		reg = rvu_read64(rvu, blkaddr, CPT_AF_ACTIVE_CYCLES_PC);
  1912		seq_printf(filp, "CPT active cycles pc       %llu\n", reg);
  1913		reg = rvu_read64(rvu, blkaddr, CPT_AF_CPTCLK_CNT);
  1914		seq_printf(filp, "CPT clock count pc         %llu\n", reg);
  1915	
  1916		return 0;
  1917	}
  1918	

---
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/net/ethernet/marvell/octeontx2/af/rvu.h b/drivers/net/ethernet/marvell/octeontx2/af/rvu.h
index c37e106d7006..ba18171c87d6 100644
--- a/drivers/net/ethernet/marvell/octeontx2/af/rvu.h
+++ b/drivers/net/ethernet/marvell/octeontx2/af/rvu.h
@@ -50,6 +50,7 @@  struct rvu_debugfs {
 	struct dentry *npa;
 	struct dentry *nix;
 	struct dentry *npc;
+	struct dentry *cpt;
 	struct dump_ctx npa_aura_ctx;
 	struct dump_ctx npa_pool_ctx;
 	struct dump_ctx nix_cq_ctx;
diff --git a/drivers/net/ethernet/marvell/octeontx2/af/rvu_debugfs.c b/drivers/net/ethernet/marvell/octeontx2/af/rvu_debugfs.c
index 77adad4adb1b..24354bfb4e94 100644
--- a/drivers/net/ethernet/marvell/octeontx2/af/rvu_debugfs.c
+++ b/drivers/net/ethernet/marvell/octeontx2/af/rvu_debugfs.c
@@ -1676,6 +1676,309 @@  static void rvu_dbg_npc_init(struct rvu *rvu)
 	debugfs_remove_recursive(rvu->rvu_dbg.npc);
 }
 
+/* CPT debugfs APIs */
+static int rvu_dbg_cpt_ae_sts_display(struct seq_file *filp, void *unused)
+{
+	struct rvu *rvu = filp->private;
+	u64 busy_sts = 0, free_sts = 0;
+	u32 e_min = 0, e_max = 0, e, i;
+	u16 max_ses, max_ies, max_aes;
+	int blkaddr;
+	u64 reg;
+
+	blkaddr = rvu_get_blkaddr(rvu, BLKTYPE_CPT, 0);
+	if (blkaddr < 0)
+		return -ENODEV;
+
+	reg = rvu_read64(rvu, blkaddr, CPT_AF_CONSTANTS1);
+	max_ses = reg & 0xffff;
+	max_ies = (reg >> 16) & 0xffff;
+	max_aes = (reg >> 32) & 0xffff;
+
+	e_min = max_ses + max_ies;
+	e_max = max_ses + max_ies + max_aes;
+
+	for (e = e_min, i = 0; e < e_max; e++, i++) {
+		reg = rvu_read64(rvu, blkaddr, CPT_AF_EXEX_STS(e));
+		if (reg & 0x1)
+			busy_sts |= 1ULL << i;
+
+		if (reg & 0x2)
+			free_sts |= 1ULL << i;
+	}
+	seq_printf(filp, "FREE STS : 0x%016llx\n", free_sts);
+	seq_printf(filp, "BUSY STS : 0x%016llx\n", busy_sts);
+
+	return 0;
+}
+
+RVU_DEBUG_SEQ_FOPS(cpt_ae_sts, cpt_ae_sts_display, NULL);
+
+static int rvu_dbg_cpt_se_sts_display(struct seq_file *filp, void *unused)
+{
+	struct rvu *rvu = filp->private;
+	u64 busy_sts = 0, free_sts = 0;
+	u32 e_min = 0, e_max = 0, e;
+	u16 max_ses;
+	int blkaddr;
+	u64 reg;
+
+	blkaddr = rvu_get_blkaddr(rvu, BLKTYPE_CPT, 0);
+	if (blkaddr < 0)
+		return -ENODEV;
+
+	reg = rvu_read64(rvu, blkaddr, CPT_AF_CONSTANTS1);
+	max_ses = reg & 0xffff;
+
+	e_min = 0;
+	e_max = max_ses;
+
+	for (e = e_min; e < e_max; e++) {
+		reg = rvu_read64(rvu, blkaddr, CPT_AF_EXEX_STS(e));
+		if (reg & 0x1)
+			busy_sts |= 1ULL << e;
+
+		if (reg & 0x2)
+			free_sts |= 1ULL << e;
+	}
+	seq_printf(filp, "FREE STS : 0x%016llx\n", free_sts);
+	seq_printf(filp, "BUSY STS : 0x%016llx\n", busy_sts);
+
+	return 0;
+}
+
+RVU_DEBUG_SEQ_FOPS(cpt_se_sts, cpt_se_sts_display, NULL);
+
+static int rvu_dbg_cpt_ie_sts_display(struct seq_file *filp, void *unused)
+{
+	struct rvu *rvu = filp->private;
+	u64 busy_sts = 0, free_sts = 0;
+	u32 e_min = 0, e_max = 0, e, i;
+	u16 max_ses, max_ies;
+	int blkaddr;
+	u64 reg;
+
+	blkaddr = rvu_get_blkaddr(rvu, BLKTYPE_CPT, 0);
+	if (blkaddr < 0)
+		return -ENODEV;
+
+	reg = rvu_read64(rvu, blkaddr, CPT_AF_CONSTANTS1);
+	max_ses = reg & 0xffff;
+	max_ies = (reg >> 16) & 0xffff;
+
+	e_min = max_ses;
+	e_max = max_ses + max_ies;
+
+	for (e = e_min, i = 0; e < e_max; e++, i++) {
+		reg = rvu_read64(rvu, blkaddr, CPT_AF_EXEX_STS(e));
+		if (reg & 0x1)
+			busy_sts |= 1ULL << i;
+
+		if (reg & 0x2)
+			free_sts |= 1ULL << i;
+	}
+	seq_printf(filp, "FREE STS : 0x%016llx\n", free_sts);
+	seq_printf(filp, "BUSY STS : 0x%016llx\n", busy_sts);
+
+	return 0;
+}
+
+RVU_DEBUG_SEQ_FOPS(cpt_ie_sts, cpt_ie_sts_display, NULL);
+
+static int rvu_dbg_cpt_engines_info_display(struct seq_file *filp, void *unused)
+{
+	struct rvu *rvu = filp->private;
+	u16 max_ses, max_ies, max_aes;
+	u32 e_max, e;
+	int blkaddr;
+	u64 reg;
+
+	blkaddr = rvu_get_blkaddr(rvu, BLKTYPE_CPT, 0);
+	if (blkaddr < 0)
+		return -ENODEV;
+
+	reg = rvu_read64(rvu, blkaddr, CPT_AF_CONSTANTS1);
+	max_ses = reg & 0xffff;
+	max_ies = (reg >> 16) & 0xffff;
+	max_aes = (reg >> 32) & 0xffff;
+
+	e_max = max_ses + max_ies + max_aes;
+
+	seq_puts(filp, "===========================================\n");
+	for (e = 0; e < e_max; e++) {
+		reg = rvu_read64(rvu, blkaddr, CPT_AF_EXEX_CTL2(e));
+		seq_printf(filp, "CPT Engine[%u] Group Enable   0x%02llx\n", e,
+			   reg & 0xff);
+		reg = rvu_read64(rvu, blkaddr, CPT_AF_EXEX_ACTIVE(e));
+		seq_printf(filp, "CPT Engine[%u] Active Info    0x%llx\n", e,
+			   reg);
+		reg = rvu_read64(rvu, blkaddr, CPT_AF_EXEX_CTL(e));
+		seq_printf(filp, "CPT Engine[%u] Control        0x%llx\n", e,
+			   reg);
+		seq_puts(filp, "===========================================\n");
+	}
+	return 0;
+}
+
+RVU_DEBUG_SEQ_FOPS(cpt_engines_info, cpt_engines_info_display, NULL);
+
+static int rvu_dbg_cpt_lfs_info_display(struct seq_file *filp, void *unused)
+{
+	struct rvu *rvu = filp->private;
+	struct rvu_hwinfo *hw = rvu->hw;
+	struct rvu_block *block;
+	int blkaddr;
+	u64 reg;
+	u32 lf;
+
+	blkaddr = rvu_get_blkaddr(rvu, BLKTYPE_CPT, 0);
+	if (blkaddr < 0)
+		return -ENODEV;
+
+	block = &hw->block[blkaddr];
+	if (!block->lf.bmap)
+		return -ENODEV;
+
+	seq_puts(filp, "===========================================\n");
+	for (lf = 0; lf < block->lf.max; lf++) {
+		reg = rvu_read64(rvu, blkaddr, CPT_AF_LFX_CTL(lf));
+		seq_printf(filp, "CPT Lf[%u] CTL          0x%llx\n", lf, reg);
+		reg = rvu_read64(rvu, blkaddr, CPT_AF_LFX_CTL2(lf));
+		seq_printf(filp, "CPT Lf[%u] CTL2         0x%llx\n", lf, reg);
+		reg = rvu_read64(rvu, blkaddr, CPT_AF_LFX_PTR_CTL(lf));
+		seq_printf(filp, "CPT Lf[%u] PTR_CTL      0x%llx\n", lf, reg);
+		reg = rvu_read64(rvu, blkaddr, block->lfcfg_reg |
+				(lf << block->lfshift));
+		seq_printf(filp, "CPT Lf[%u] CFG          0x%llx\n", lf, reg);
+		seq_puts(filp, "===========================================\n");
+	}
+	return 0;
+}
+
+RVU_DEBUG_SEQ_FOPS(cpt_lfs_info, cpt_lfs_info_display, NULL);
+
+static int rvu_dbg_cpt_err_info_display(struct seq_file *filp, void *unused)
+{
+	struct rvu *rvu = filp->private;
+	u64 reg0, reg1;
+	int blkaddr;
+
+	blkaddr = rvu_get_blkaddr(rvu, BLKTYPE_CPT, 0);
+	if (blkaddr < 0)
+		return -ENODEV;
+
+	reg0 = rvu_read64(rvu, blkaddr, CPT_AF_FLTX_INT(0));
+	reg1 = rvu_read64(rvu, blkaddr, CPT_AF_FLTX_INT(1));
+	seq_printf(filp, "CPT_AF_FLTX_INT:       0x%llx 0x%llx\n", reg0, reg1);
+	reg0 = rvu_read64(rvu, blkaddr, CPT_AF_PSNX_EXE(0));
+	reg1 = rvu_read64(rvu, blkaddr, CPT_AF_PSNX_EXE(1));
+	seq_printf(filp, "CPT_AF_PSNX_EXE:       0x%llx 0x%llx\n", reg0, reg1);
+	reg0 = rvu_read64(rvu, blkaddr, CPT_AF_PSNX_LF(0));
+	seq_printf(filp, "CPT_AF_PSNX_LF:        0x%llx\n", reg0);
+	reg0 = rvu_read64(rvu, blkaddr, CPT_AF_RVU_INT);
+	seq_printf(filp, "CPT_AF_RVU_INT:        0x%llx\n", reg0);
+	reg0 = rvu_read64(rvu, blkaddr, CPT_AF_RAS_INT);
+	seq_printf(filp, "CPT_AF_RAS_INT:        0x%llx\n", reg0);
+	reg0 = rvu_read64(rvu, blkaddr, CPT_AF_EXE_ERR_INFO);
+	seq_printf(filp, "CPT_AF_EXE_ERR_INFO:   0x%llx\n", reg0);
+
+	return 0;
+}
+
+RVU_DEBUG_SEQ_FOPS(cpt_err_info, cpt_err_info_display, NULL);
+
+static int rvu_dbg_cpt_pc_display(struct seq_file *filp, void *unused)
+{
+	struct rvu *rvu;
+	int blkaddr;
+	u64 reg;
+
+	rvu = filp->private;
+	blkaddr = rvu_get_blkaddr(rvu, BLKTYPE_CPT, 0);
+	if (blkaddr < 0)
+		return -ENODEV;
+
+	reg = rvu_read64(rvu, blkaddr, CPT_AF_INST_REQ_PC);
+	seq_printf(filp, "CPT instruction requests   %llu\n", reg);
+	reg = rvu_read64(rvu, blkaddr, CPT_AF_INST_LATENCY_PC);
+	seq_printf(filp, "CPT instruction latency    %llu\n", reg);
+	reg = rvu_read64(rvu, blkaddr, CPT_AF_RD_REQ_PC);
+	seq_printf(filp, "CPT NCB read requests      %llu\n", reg);
+	reg = rvu_read64(rvu, blkaddr, CPT_AF_RD_LATENCY_PC);
+	seq_printf(filp, "CPT NCB read latency       %llu\n", reg);
+	reg = rvu_read64(rvu, blkaddr, CPT_AF_RD_UC_PC);
+	seq_printf(filp, "CPT read requests caused by UC fills   %llu\n", reg);
+	reg = rvu_read64(rvu, blkaddr, CPT_AF_ACTIVE_CYCLES_PC);
+	seq_printf(filp, "CPT active cycles pc       %llu\n", reg);
+	reg = rvu_read64(rvu, blkaddr, CPT_AF_CPTCLK_CNT);
+	seq_printf(filp, "CPT clock count pc         %llu\n", reg);
+
+	return 0;
+}
+
+RVU_DEBUG_SEQ_FOPS(cpt_pc, cpt_pc_display, NULL);
+
+static void rvu_dbg_cpt_init(struct rvu *rvu)
+{
+	const struct device *dev = &rvu->pdev->dev;
+	struct dentry *pfile;
+
+	if (!is_block_implemented(rvu->hw, BLKADDR_CPT0))
+		return;
+
+	rvu->rvu_dbg.cpt = debugfs_create_dir("cpt", rvu->rvu_dbg.root);
+	if (!rvu->rvu_dbg.cpt)
+		return;
+
+	pfile = debugfs_create_file("cpt_pc", 0600,
+				    rvu->rvu_dbg.cpt, rvu,
+				    &rvu_dbg_cpt_pc_fops);
+	if (!pfile)
+		goto create_failed;
+
+	pfile = debugfs_create_file("cpt_ae_sts", 0600,
+				    rvu->rvu_dbg.cpt, rvu,
+				    &rvu_dbg_cpt_ae_sts_fops);
+	if (!pfile)
+		goto create_failed;
+
+	pfile = debugfs_create_file("cpt_se_sts", 0600,
+				    rvu->rvu_dbg.cpt, rvu,
+				    &rvu_dbg_cpt_se_sts_fops);
+	if (!pfile)
+		goto create_failed;
+
+	pfile = debugfs_create_file("cpt_ie_sts", 0600,
+				    rvu->rvu_dbg.cpt, rvu,
+				    &rvu_dbg_cpt_ie_sts_fops);
+	if (!pfile)
+		goto create_failed;
+
+	pfile = debugfs_create_file("cpt_engines_info", 0600,
+				    rvu->rvu_dbg.cpt, rvu,
+				    &rvu_dbg_cpt_engines_info_fops);
+	if (!pfile)
+		goto create_failed;
+
+	pfile = debugfs_create_file("cpt_lfs_info", 0600,
+				    rvu->rvu_dbg.cpt, rvu,
+				    &rvu_dbg_cpt_lfs_info_fops);
+	if (!pfile)
+		goto create_failed;
+
+	pfile = debugfs_create_file("cpt_err_info", 0600,
+				    rvu->rvu_dbg.cpt, rvu,
+				    &rvu_dbg_cpt_err_info_fops);
+	if (!pfile)
+		goto create_failed;
+
+	return;
+
+create_failed:
+	dev_err(dev, "Failed to create debugfs dir/file for CPT\n");
+	debugfs_remove_recursive(rvu->rvu_dbg.cpt);
+}
+
 void rvu_dbg_init(struct rvu *rvu)
 {
 	struct device *dev = &rvu->pdev->dev;
@@ -1695,6 +1998,7 @@  void rvu_dbg_init(struct rvu *rvu)
 	rvu_dbg_nix_init(rvu);
 	rvu_dbg_cgx_init(rvu);
 	rvu_dbg_npc_init(rvu);
+	rvu_dbg_cpt_init(rvu);
 
 	return;