[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <3edb033746906618bc451aa8a634bc3e51c162b8.camel@kernel.org>
Date: Thu, 14 Jan 2021 15:50:43 -0800
From: Saeed Mahameed <saeed@...nel.org>
To: Srujana Challa <schalla@...vell.com>, davem@...emloft.net
Cc: netdev@...r.kernel.org, kuba@...nel.org, sgoutham@...vell.com,
gakula@...vell.com, sbhatta@...vell.com, schandran@...vell.com,
pathreya@...vell.com, jerinj@...vell.com,
Mahipal Challa <mchalla@...vell.com>
Subject: Re: [PATCH net-next,2/3] octeontx2-af: Add support for CPT1 in
debugfs
On Wed, 2021-01-13 at 20:50 +0530, Srujana Challa wrote:
> Adds support to display block CPT1 stats at
> "/sys/kernel/debug/octeontx2/cpt1".
>
> Signed-off-by: Mahipal Challa <mchalla@...vell.com>
> Signed-off-by: Srujana Challa <schalla@...vell.com>
> ---
> .../marvell/octeontx2/af/rvu_debugfs.c | 45 +++++++++++----
> ----
> 1 file changed, 26 insertions(+), 19 deletions(-)
>
> diff --git a/drivers/net/ethernet/marvell/octeontx2/af/rvu_debugfs.c
> b/drivers/net/ethernet/marvell/octeontx2/af/rvu_debugfs.c
> index d27543c1a166..158876366dd3 100644
> --- a/drivers/net/ethernet/marvell/octeontx2/af/rvu_debugfs.c
> +++ b/drivers/net/ethernet/marvell/octeontx2/af/rvu_debugfs.c
> @@ -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);
> +
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
Powered by blists - more mailing lists