From: Simon Horman <horms@kernel.org>
To: Ratheesh Kannoth <rkannoth@marvell.com>
Cc: davem@davemloft.net, hkelam@marvell.com, lcherian@marvell.com,
linux-kernel@vger.kernel.org, netdev@vger.kernel.org,
pabeni@redhat.com, sgoutham@marvell.com, andrew+netdev@lunn.ch,
edumazet@google.com, kuba@kernel.org,
Yuho Choi <dbgh9129@gmail.com>
Subject: Re: [PATCH net] octeontx2-af: fix CGX debugfs RVU AF PCI reference leaks
Date: Thu, 18 Jun 2026 16:07:23 +0100 [thread overview]
Message-ID: <20260618150723.GR827683@horms.kernel.org> (raw)
In-Reply-To: <20260617104525.1321395-1-rkannoth@marvell.com>
On Wed, Jun 17, 2026 at 04:15:25PM +0530, Ratheesh Kannoth wrote:
> CGX per-lmac debugfs seq readers obtained struct rvu via
> pci_get_drvdata(pci_get_device(..., PCI_DEVID_OCTEONTX2_RVU_AF, ...)),
> which leaks a PCI device reference on every read. Store rvu and the CGX
> handle in debugfs inode private data when creating stats, mac_filter,
> and fwdata files (one context per CGX), and use debugfs aux numbers for
> fwdata so lmac_id matches the other CGX debugfs entries.
>
> Fixes: f967488d095e ("octeontx2-af: Add per CGX port level NIX Rx/Tx counters")
> Fixes: dbc52debf95f ("octeontx2-af: Debugfs support for DMAC filters")
> Fixes: 49f02e6877d1 ("Octeontx2-af: Debugfs support for firmware data")
> Cc: Linu Cherian <lcherian@marvell.com>
> Reported-by: Yuho Choi <dbgh9129@gmail.com>
> Signed-off-by: Ratheesh Kannoth <rkannoth@marvell.com>
The nit below not withstanding this looks good to me.
Reviewed-by: Simon Horman <horms@kernel.org>
> ---
> .../marvell/octeontx2/af/rvu_debugfs.c | 77 ++++++++++---------
> 1 file changed, 42 insertions(+), 35 deletions(-)
>
> diff --git a/drivers/net/ethernet/marvell/octeontx2/af/rvu_debugfs.c b/drivers/net/ethernet/marvell/octeontx2/af/rvu_debugfs.c
...
> @@ -2831,18 +2839,14 @@ static void rvu_dbg_npa_init(struct rvu *rvu)
>
> static int cgx_print_stats(struct seq_file *s, int lmac_id)
> {
> + struct rvu_cgx_lmac_dbgfs_ctx *dctx = s->private;
> struct cgx_link_user_info linfo;
> struct mac_ops *mac_ops;
> - void *cgxd = s->private;
> + void *cgxd = dctx->cgxd;
> + struct rvu *rvu = dctx->rvu;
nit: It would be nice to preserve reverse xmas tree order - longest line to
shortest - for local variable declarations. Likewise elsewhere in this
patch.
> u64 ucast, mcast, bcast;
> int stat = 0, err = 0;
> u64 tx_stat, rx_stat;
...
prev parent reply other threads:[~2026-06-18 15:07 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-17 10:45 [PATCH net] octeontx2-af: fix CGX debugfs RVU AF PCI reference leaks Ratheesh Kannoth
2026-06-18 15:07 ` Simon Horman [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260618150723.GR827683@horms.kernel.org \
--to=horms@kernel.org \
--cc=andrew+netdev@lunn.ch \
--cc=davem@davemloft.net \
--cc=dbgh9129@gmail.com \
--cc=edumazet@google.com \
--cc=hkelam@marvell.com \
--cc=kuba@kernel.org \
--cc=lcherian@marvell.com \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=rkannoth@marvell.com \
--cc=sgoutham@marvell.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox