Support for OcteonTX2 98xx CPT block.
cover Support for OcteonTX2 98xx CPT block.
OcteonTX2 series of silicons have multiple variants, the 98xx variant has two crypto (CPT) blocks to double the crypto performance. This patchset adds support for new CPT block(CPT1).
Srujana Challa (3):
octeontx2-af: Mailbox changes for 98xx CPT block
octeontx2-af: Add support for CPT1 in debugfs
octeontx2-af: Handle CPT function level reset
.../net/ethernet/marvell/octeontx2/af/mbox.h | 2 + .../net/ethernet/marvell/octeontx2/af/rvu.c | 3 + .../net/ethernet/marvell/octeontx2/af/rvu.h | 2 + .../ethernet/marvell/octeontx2/af/rvu_cpt.c | 115 +++++++++++++++--- .../marvell/octeontx2/af/rvu_debugfs.c | 45 ++++--- .../ethernet/marvell/octeontx2/af/rvu_reg.h | 8 ++ 6 files changed, 140 insertions(+), 35 deletions(-)
Signature · 1 line
2.29.0
PATCH 1/3 octeontx2-af: Mailbox changes for 98xx CPT block
This patch changes CPT mailbox message format to
support new block CPT1 in 98xx silicon.
cpt_rd_wr_reg ->
Modify cpt_rd_wr_reg mailbox and its handler to accommodate new block CPT1.cpt_lf_alloc ->
Modify cpt_lf_alloc mailbox and its handler to configure LFs from a block address out of multiple blocks of same type. If a PF/VF needs to configure LFs from both the blocks then this mbox should be called twice.
--- .../net/ethernet/marvell/octeontx2/af/mbox.h | 2 + .../ethernet/marvell/octeontx2/af/rvu_cpt.c | 41 +++++++++++-------- 2 files changed, 27 insertions(+), 16 deletions(-)
drivers/net/ethernet/marvell/octeontx2/af/mbox.h +2 -0
@@ -1071,6 +1071,7 @@ struct cpt_rd_wr_reg_msg {u64 *ret_val;u64 val;u8 is_write; +int blkaddr; };struct cpt_lf_alloc_req_msg {
@@ -1078,6 +1079,7 @@ struct cpt_lf_alloc_req_msg {u16 nix_pf_func;u16 sso_pf_func;u16 eng_grpmsk; + int blkaddr; };#endif /* MBOX_H */
drivers/net/ethernet/marvell/octeontx2/af/rvu_cpt.c +25 -16
76 lines not on this page · raw message
Signature · 1 line
2.29.0
PATCH 2/3 octeontx2-af: Add support for CPT1 in debugfs
In reply to Srujana ChallaAdds support to display block CPT1 stats at
"/sys/kernel/debug/octeontx2/cpt1".
--- .../marvell/octeontx2/af/rvu_debugfs.c | 45 +++++++++++-------- 1 file changed, 26 insertions(+), 19 deletions(-)
drivers/net/ethernet/marvell/octeontx2/af/rvu_debugfs.c +26 -19
@@ -1904,6 +1904,18 @@ static void rvu_dbg_npc_init(struct rvu *rvu) }/* CPT debugfs APIs */ +static int cpt_get_blkaddr (struct seq_file *filp) +{ +struct dentry *current_dir; +int blkaddr; + + current_dir = filp->file->f_path.dentry->d_parent; + blkaddr = (!strcmp (current_dir->d_name.name,"cpt1" ) ? +BLKADDR_CPT1 :BLKADDR_CPT0 ); + +return blkaddr; +} +static int cpt_eng_sts_display (struct seq_file *filp,u8 eng_type) {struct rvu *rvu = filp->private;
@@ -1913,9 +1925,7 @@ static int cpt_eng_sts_display(struct seq_file *filp, u8 eng_type)int blkaddr;u64 reg; - blkaddr =rvu_get_blkaddr (rvu,BLKTYPE_CPT ,0 ); -if (blkaddr <0 ) -return -ENODEV ; + blkaddr =cpt_get_blkaddr (filp); reg =rvu_read64 (rvu, blkaddr,CPT_AF_CONSTANTS1 ); max_ses = reg &0xffff ;
@@ -1982,9 +1992,7 @@ static int rvu_dbg_cpt_engines_info_display(struct seq_file *filp, void *unused)int blkaddr;u64 reg; - blkaddr =rvu_get_blkaddr (rvu,BLKTYPE_CPT ,0 ); -if (blkaddr <0 ) -return -ENODEV ; + blkaddr =cpt_get_blkaddr (filp); reg =rvu_read64 (rvu, blkaddr,CPT_AF_CONSTANTS1 ); max_ses = reg &0xffff ;
@@ -2020,9 +2028,7 @@ static int rvu_dbg_cpt_lfs_info_display(struct seq_file *filp, void *unused)u64 reg;u32 lf; - blkaddr =rvu_get_blkaddr (rvu,BLKTYPE_CPT ,0 ); -if (blkaddr <0 ) -return -ENODEV ; + blkaddr =cpt_get_blkaddr (filp); block = &hw->block[blkaddr];if (!block->lf.bmap)
@@ -2052,9 +2058,7 @@ static int rvu_dbg_cpt_err_info_display(struct seq_file *filp, void *unused)u64 reg0, reg1;int blkaddr; - blkaddr =rvu_get_blkaddr (rvu,BLKTYPE_CPT ,0 ); -if (blkaddr <0 ) -return -ENODEV ; + blkaddr =cpt_get_blkaddr (filp); reg0 =rvu_read64 (rvu, blkaddr,CPT_AF_FLTX_INT (0 )); reg1 =rvu_read64 (rvu, blkaddr,CPT_AF_FLTX_INT (1 ));
@@ -2083,9 +2087,7 @@ static int rvu_dbg_cpt_pc_display(struct seq_file *filp, void *unused)u64 reg; rvu = filp->private; - blkaddr =rvu_get_blkaddr (rvu,BLKTYPE_CPT ,0 ); -if (blkaddr <0 ) -return -ENODEV ; + blkaddr =cpt_get_blkaddr (filp); reg =rvu_read64 (rvu, blkaddr,CPT_AF_INST_REQ_PC );seq_printf (filp,"CPT instruction requests %llu\n" , reg);
@@ -2107,12 +2109,16 @@ static int rvu_dbg_cpt_pc_display(struct seq_file *filp, void *unused)RVU_DEBUG_SEQ_FOPS (cpt_pc, cpt_pc_display,NULL ); -static void rvu_dbg_cpt_init (struct rvu *rvu) +static void rvu_dbg_cpt_init (struct rvu *rvu,int blkaddr) { -if (!is_block_implemented (rvu->hw,BLKADDR_CPT0 )) +if (!is_block_implemented (rvu->hw, blkaddr))return ; - rvu->rvu_dbg.cpt =debugfs_create_dir ("cpt" , rvu->rvu_dbg.root); +if (blkaddr ==BLKADDR_NIX0 ) + rvu->rvu_dbg.cpt =debugfs_create_dir ("cpt" , rvu->rvu_dbg.root); +else + rvu->rvu_dbg.cpt =debugfs_create_dir ("cpt1" , + rvu->rvu_dbg.root);debugfs_create_file ("cpt_pc" ,0600 , rvu->rvu_dbg.cpt, rvu, &rvu_dbg_cpt_pc_fops);
@@ -2145,7 +2151,8 @@ void rvu_dbg_init(struct rvu *rvu)rvu_dbg_nix_init (rvu,BLKADDR_NIX1 );rvu_dbg_cgx_init (rvu);rvu_dbg_npc_init (rvu); -rvu_dbg_cpt_init (rvu); +rvu_dbg_cpt_init (rvu,BLKADDR_CPT0 ); +rvu_dbg_cpt_init (rvu,BLKADDR_CPT1 ); }void rvu_dbg_exit (struct rvu *rvu)
Signature · 1 line
2.29.0
PATCH 3/3 octeontx2-af: Handle CPT function level reset
In reply to Srujana ChallaWhen FLR is initiated for a VF (PCI function level reset), the parent PF gets a interrupt. PF then sends a message to admin function (AF), which then cleans up all resources attached to that VF. This patch adds support to handle CPT FLR.
--- .../net/ethernet/marvell/octeontx2/af/rvu.c | 3 + .../net/ethernet/marvell/octeontx2/af/rvu.h | 2 + .../ethernet/marvell/octeontx2/af/rvu_cpt.c | 74 +++++++++++++++++++ .../ethernet/marvell/octeontx2/af/rvu_reg.h | 8 ++ 4 files changed, 87 insertions(+)
drivers/net/ethernet/marvell/octeontx2/af/rvu.c +3 -0
@@ -2150,6 +2150,9 @@ static void rvu_blklf_teardown(struct rvu *rvu, u16 pcifunc, u8 blkaddr)rvu_nix_lf_teardown (rvu, pcifunc, block->addr, lf); else if (block->addr == BLKADDR_NPA) rvu_npa_lf_teardown(rvu, pcifunc, lf); + else if ((block->addr == BLKADDR_CPT0) || + (block->addr == BLKADDR_CPT1)) + rvu_cpt_lf_teardown(rvu, pcifunc, lf, slot); err = rvu_lf_reset(rvu, block, lf);if (err) {
drivers/net/ethernet/marvell/octeontx2/af/rvu.h +2 -0
@@ -601,6 +601,8 @@ void npc_enable_mcam_entry(struct rvu *rvu, struct npc_mcam *mcam,void npc_read_mcam_entry (struct rvu *rvu,struct npc_mcam *mcam,int blkaddr,u16 src,struct mcam_entry *entry,u8 *intf,u8 *ena); +/* CPT APIs */ +int rvu_cpt_lf_teardown (struct rvu *rvu,u16 pcifunc,int lf,int slot);#ifdef CONFIG_DEBUG_FS void rvu_dbg_init (struct rvu *rvu);
drivers/net/ethernet/marvell/octeontx2/af/rvu_cpt.c +74 -0
77 lines not on this page · raw message
drivers/net/ethernet/marvell/octeontx2/af/rvu_reg.h +8 -0
@@ -484,9 +484,17 @@#define CPT_AF_RAS_INT_ENA_W1S (0x47030)#define CPT_AF_RAS_INT_ENA_W1C (0x47038) +#define AF_BAR2_ALIASX (a, b) (0x9100000ull | (a) << 12 | (b)) +#define CPT_AF_BAR2_SEL 0x9000000 +#define CPT_AF_BAR2_ALIASX (a, b) AF_BAR2_ALIASX(a, b) +#define CPT_AF_LF_CTL2_SHIFT 3#define CPT_AF_LF_SSO_PF_FUNC_SHIFT 32 +#define CPT_LF_CTL 0x10 +#define CPT_LF_INPROG 0x40 +#define CPT_LF_Q_GRP_PTR 0x120 +#define NPC_AF_BLK_RST (0x00040)/* NPC */
Signature · 1 line
2.29.0
Re: [PATCH net-next,1/3] octeontx2-af: Mailbox changes for 98xx CPT block
In reply to Srujana ChallaQuoted 48 lines · Srujana Challa
This patch changes CPT mailbox message format to
support new block CPT1 in 98xx silicon.
cpt_rd_wr_reg->
Modifycpt_rd_wr_regmailbox and its handler to accommodate new block CPT1.cpt_lf_alloc->
Modifycpt_lf_allocmailbox and its handler to configure LFs from a block address out of multiple blocks of same type. If a PF/VF needs to configure LFs from both the blocks then this mbox should be called twice.Signed-off-by Mahipal Challa <[email protected]>Signed-off-by Srujana Challa <[email protected]>--- .../net/ethernet/marvell/octeontx2/af/mbox.h | 2 + .../ethernet/marvell/octeontx2/af/rvu_cpt.c | 41 +++++++++++---- ---- 2 files changed, 27 insertions(+), 16 deletions(-)drivers/net/ethernet/marvell/octeontx2/af/mbox.h +2
-0@@ -1071,6 +1071,7 @@ struct cpt_rd_wr_reg_msg {u64 *ret_val;u64 val;u8 is_write; +int blkaddr; };struct cpt_lf_alloc_req_msg {@@ -1078,6 +1079,7 @@ struct cpt_lf_alloc_req_msg {u16 nix_pf_func;u16 sso_pf_func;u16 eng_grpmsk; + int blkaddr; };#endif /* MBOX_H */ drivers/net/ethernet/marvell/octeontx2/af/rvu_cpt.c +0
-0
drivers/net/ethernet/marvell/octeontx2/af/rvu_cpt.c int rvu_mbox_handler_cpt_lf_alloc(struct rvu · line 73
Quoted 9 lines
drivers/net/ethernet/marvell/octeontx2/af/rvu_cpt.c +4
-0@@ -65,13 +65,13 @@ int rvu_mbox_handler_cpt_lf_alloc(struct rvu *rvu, int num_lfs, slot;u64 val; + blkaddr = req->blkaddr ? req->blkaddr :BLKADDR_CPT0 ; +if (blkaddr !=BLKADDR_CPT0 && blkaddr !=BLKADDR_CPT1 ) +return -ENODEV ; +
Just out of curiosity, why do you need to check against your driver's internals function calls ?
who calls this function: I Couldn't find any caller !
$ git grep rvu_mbox_handler_cpt_lf_alloc drivers/net/ethernet/marvell/octeontx2/af/rvu_cpt.c:int rvu_mbox_handler_cpt_lf_alloc(struct rvu *rvu,
Re: [PATCH net-next,2/3] octeontx2-af: Add support for CPT1 in debugfs
In reply to Srujana ChallaQuoted 18 lines · Srujana Challa
Adds support to display block CPT1 stats at
"/sys/kernel/debug/octeontx2/cpt1".Signed-off-by Mahipal Challa <[email protected]>Signed-off-by Srujana Challa <[email protected]>--- .../marvell/octeontx2/af/rvu_debugfs.c | 45 +++++++++++---- ---- 1 file changed, 26 insertions(+), 19 deletions(-)drivers/net/ethernet/marvell/octeontx2/af/rvu_debugfs.c +0
-0@@ -1904,6 +1904,18 @@ static void rvu_dbg_npc_init(struct rvu *rvu) }
drivers/net/ethernet/marvell/octeontx2/af/rvu_debugfs.c static void rvu_dbg_npc_init(struct rvu *rvu) · line 1915
Quoted 10 lines
drivers/net/ethernet/marvell/octeontx2/af/rvu_debugfs.c +9
-0/* CPT debugfs APIs */ +static int cpt_get_blkaddr (struct seq_file *filp) +{ +struct dentry *current_dir; +int blkaddr; + + current_dir = filp->file->f_path.dentry->d_parent; + blkaddr = (!strcmp (current_dir->d_name.name,"cpt1" ) ? +BLKADDR_CPT1 :BLKADDR_CPT0 ); +
This is very fragile piece of code! it assumes static debugfs directory structure and naming, why don't you store the CPT context in the sqe_file private ? as you already have in rvu_dbg_nix_init for nix_hw type
Re: [PATCH net-next,3/3] octeontx2-af: Handle CPT function level reset
In reply to Srujana ChallaQuoted 96 lines · Srujana Challa
When FLR is initiated for a VF (PCI function level reset), the parent PF gets a interrupt. PF then sends a message to admin function (AF), which then cleans up all resources attached to that VF. This patch adds support to handle CPT FLR.
Signed-off-by Narayana Prasad Raju Atherya <[email protected]>Signed-off-by Suheil Chandran <[email protected]>Signed-off-by Sunil Kovvuri Goutham <[email protected]>Signed-off-by Srujana Challa <[email protected]>--- .../net/ethernet/marvell/octeontx2/af/rvu.c | 3 + .../net/ethernet/marvell/octeontx2/af/rvu.h | 2 + .../ethernet/marvell/octeontx2/af/rvu_cpt.c | 74 +++++++++++++++++++ .../ethernet/marvell/octeontx2/af/rvu_reg.h | 8 ++ 4 files changed, 87 insertions(+)drivers/net/ethernet/marvell/octeontx2/af/rvu.c +3
-0@@ -2150,6 +2150,9 @@ static void rvu_blklf_teardown(struct rvu *rvu, u16 pcifunc, u8 blkaddr) rvu_nix_lf_teardown(rvu, pcifunc, block->addr,lf ); else if (block->addr == BLKADDR_NPA) rvu_npa_lf_teardown(rvu, pcifunc, lf); + else if ((block->addr == BLKADDR_CPT0) || + (block->addr == BLKADDR_CPT1)) + rvu_cpt_lf_teardown(rvu, pcifunc, lf, slot);drivers/net/ethernet/marvell/octeontx2/af/rvu.c +0
-0err =rvu_lf_reset (rvu, block, lf);if (err) {drivers/net/ethernet/marvell/octeontx2/af/rvu.h +2
-0@@ -601,6 +601,8 @@ void npc_enable_mcam_entry(struct rvu *rvu,struct npc_mcam *mcam, void npc_read_mcam_entry(struct rvu *rvu, struct npc_mcam *mcam,int blkaddr,u16 src,struct mcam_entry *entry,u8 *intf,u8 *ena); +/* CPT APIs */ +int rvu_cpt_lf_teardown (struct rvu *rvu,u16 pcifunc,int lf,int slot);#ifdef
CONFIG_DEBUG_FS
voidrvu_dbg_init(struct rvu *rvu);drivers/net/ethernet/marvell/octeontx2/af/rvu_cpt.c +2
-0@@ -240,3 +240,77 @@ int rvu_mbox_handler_cpt_rd_wr_register(structrvu *rvu, return 0; } + +static void cpt_lf_disable_iqueue(struct rvu *rvu, int blkaddr, intslot)
drivers/net/ethernet/marvell/octeontx2/af/rvu_cpt.c +6
-0+{ +u64 inprog, grp_ptr; +int i =0 ; + +/* Disable instructions enqueuing */ + rvu_write64(rvu, blkaddr, CPT_AF_BAR2_ALIASX(slot, CPT_LF_CTL),
0x0);drivers/net/ethernet/marvell/octeontx2/af/rvu_cpt.c +12
-0+ +/* Disable executions in the LF's queue */ + inprog =rvu_read64 (rvu, blkaddr, +CPT_AF_BAR2_ALIASX (slot,CPT_LF_INPROG )); + inprog &= ~BIT_ULL (16 ); +rvu_write64 (rvu, blkaddr, +CPT_AF_BAR2_ALIASX (slot,CPT_LF_INPROG ), inprog); + +/* Wait for CPT queue to become execution-quiescent */ + do { + inprog = rvu_read64(rvu, blkaddr, + CPT_AF_BAR2_ALIASX(slot,
CPT_LF_INPROG));drivers/net/ethernet/marvell/octeontx2/af/rvu_cpt.c +9
-0+/* Check for partial entries (GRB_PARTIAL) */ +if (inprog &BIT_ULL (31 )) + i =0 ; +else + i++; + + grp_ptr = rvu_read64(rvu, blkaddr, + CPT_AF_BAR2_ALIASX(slot, + CPT_LF_Q_GRP_PTR));
drivers/net/ethernet/marvell/octeontx2/af/rvu_cpt.c int rvu_mbox_handler_cpt_rd_wr_register(struct rvu *rvu, · line 273
Quoted 2 lines
drivers/net/ethernet/marvell/octeontx2/af/rvu_cpt.c +2
-0+ }while ((i <10 ) && (((grp_ptr >>32 ) &0x7FFF ) != + (grp_ptr &0x7FFF )));
What prevents an infinite loop if the HW locks up and you get stuck on a partial entry ?
Also it would be nice if you'd wrap this in a nice macro with an informative name:
(grp_ptr >> 32) & 0x7FFF) != (grp_ptr & 0x7FFF))
drivers/net/ethernet/marvell/octeontx2/af/rvu_cpt.c int rvu_mbox_handler_cpt_rd_wr_register(struct rvu *rvu, · line 282
Quoted 10 lines
drivers/net/ethernet/marvell/octeontx2/af/rvu_cpt.c +4
-0+ i =0 ; + do { + inprog = rvu_read64(rvu, blkaddr, + CPT_AF_BAR2_ALIASX(slot,
CPT_LF_INPROG));drivers/net/ethernet/marvell/octeontx2/af/rvu_cpt.c +1
-0+/* GWB writes groups of 40. So below formula is used for
drivers/net/ethernet/marvell/octeontx2/af/rvu_cpt.c +3
-0+* knowing that no more instructions will be scheduled +* (INFLIGHT == 0) && (GWB < 40) && (GRB == 0 OR 40) +*/
So why not replace the comment with macros that wrap the below conditions and the code will become self explanatory..
Quoted 11 lines
drivers/net/ethernet/marvell/octeontx2/af/rvu_cpt.c +10
-0+if (((inprog &0x1FF ) ==0 ) && + (((inprog >>40 ) &0xFF ) <40 ) && + ((((inprog >>32 ) &0xFF ) ==0 ) || + (((inprog >>32 ) &0xFF ) ==40 ))) + i++; +else + i =0 ; + }while (i <10 ); +} +
RE: [EXT] Re: [PATCH net-next,1/3] octeontx2-af: Mailbox changes for 98xx CPT block
In reply to Saeed MahameedQuoted 61 lines · Srujana Challa
Quoted 48 lines
This patch changes CPT mailbox message format to support new block CPT1 in 98xx silicon.
cpt_rd_wr_reg->
Modifycpt_rd_wr_regmailbox and its handler to accommodate new block CPT1.cpt_lf_alloc->
Modifycpt_lf_allocmailbox and its handler to configure LFs from a block address out of multiple blocks of same type. If a PF/VF needs to configure LFs from both the blocks then this mbox should be called twice.Signed-off-by Mahipal Challa <[email protected]>Signed-off-by Srujana Challa <[email protected]>--- .../net/ethernet/marvell/octeontx2/af/mbox.h | 2 + .../ethernet/marvell/octeontx2/af/rvu_cpt.c | 41 +++++++++++---- ---- 2 files changed, 27 insertions(+), 16 deletions(-)drivers/net/ethernet/marvell/octeontx2/af/mbox.h +2
-0@@ -1071,6 +1071,7 @@ struct cpt_rd_wr_reg_msg {u64 *ret_val;u64 val;u8 is_write; +int blkaddr; };struct cpt_lf_alloc_req_msg {@@ -1078,6 +1079,7 @@ struct cpt_lf_alloc_req_msg {u16 nix_pf_func;u16 sso_pf_func;u16 eng_grpmsk; + int blkaddr; };#endif /* MBOX_H */ drivers/net/ethernet/marvell/octeontx2/af/rvu_cpt.c +0
-0drivers/net/ethernet/marvell/octeontx2/af/rvu_cpt.c int rvu_mbox_handler_cpt_lf_alloc(struct rvu *rvu, · line 72
Quoted 8 lines
drivers/net/ethernet/marvell/octeontx2/af/rvu_cpt.c +4
-0@@ -65,13 +65,13 @@ int rvu_mbox_handler_cpt_lf_alloc(struct rvu *rvu,int num_lfs, slot;u64 val; + blkaddr = req->blkaddr ? req->blkaddr :BLKADDR_CPT0 ; +if (blkaddr !=BLKADDR_CPT0 && blkaddr !=BLKADDR_CPT1 ) +return -ENODEV ; +Just out of curiosity, why do you need to check against your driver's internals function calls ?
Quoted 2 lines
who calls this function: I Couldn't find any caller !
This function is a mailbox handler, it will be triggered when Marvell crypto(CPT) driver sends a CPT_LF_ALLOC mailbox message. I have added check for blkaddr because there is a chance for sending invalid blkaddr through mailbox request from CPT VF drivers.
Quoted 5 lines
$ git grep rvu_mbox_handler_cpt_lf_alloc drivers/net/ethernet/marvell/octeontx2/af/rvu_cpt.c:int rvu_mbox_handler_cpt_lf_alloc(struct rvu *rvu,
RE: [EXT] Re: [PATCH net-next,2/3] octeontx2-af: Add support for CPT1 in debugfs
In reply to Saeed MahameedQuoted 19 lines · Srujana Challa
Quoted 18 lines
Adds support to display block CPT1 stats at
"/sys/kernel/debug/octeontx2/cpt1".Signed-off-by Mahipal Challa <[email protected]>Signed-off-by Srujana Challa <[email protected]>--- .../marvell/octeontx2/af/rvu_debugfs.c | 45 +++++++++++---- ---- 1 file changed, 26 insertions(+), 19 deletions(-)drivers/net/ethernet/marvell/octeontx2/af/rvu_debugfs.c +0
-0@@ -1904,6 +1904,18 @@ static void rvu_dbg_npc_init(struct rvu *rvu) }
Quoted 14 lines
drivers/net/ethernet/marvell/octeontx2/af/rvu_debugfs.c static void rvu_dbg_npc_init(struct rvu *rvu) · line 1915
Quoted 9 lines
drivers/net/ethernet/marvell/octeontx2/af/rvu_debugfs.c +8
-0/* CPT debugfs APIs */ +static int cpt_get_blkaddr (struct seq_file *filp) { +struct dentry *current_dir; +int blkaddr; + + current_dir = filp->file->f_path.dentry->d_parent; + blkaddr = (!strcmp (current_dir->d_name.name,"cpt1" ) ? +BLKADDR_CPT1 :BLKADDR_CPT0 ); +This is very fragile piece of code! it assumes static debugfs directory structure and naming, why don't you store the CPT context in the
sqe_fileprivate ? as you already have inrvu_dbg_nix_initfornix_hwtype
Okay, I will do the changes accordingly and submit next version. Thanks.