Re: [PATCH v1] octeontx2-af: Fix PCI device reference leaks in debugfs

From: 최유호

Date: Tue Jun 02 2026 - 11:52:18 EST


Thanks for your time to review.

On Mon, 1 Jun 2026 at 22:02, Jakub Kicinski <kuba@xxxxxxxxxx> wrote:

> Looks like cgx struct has a pointer to the pci dev.
> Can we use that instead?

I looked into that. While struct cgx does contain a pdev pointer, it
points to the CGX/RPM PCI device rather than the RVU AF device.

Its driver data is struct cgx, as cgx_probe() does:

cgx->pdev = pdev;
pci_set_drvdata(pdev, cgx);

The debugfs callbacks here need the RVU AF private data (struct rvu) for
rvu_cgx_nix_cuml_stats(), cgxlmac_to_pf(), and rvu->fwdat. Therefore
calling pci_get_drvdata(cgx->pdev) would return struct cgx rather than
struct rvu.

Unless I'm missing another path to reach the AF device from struct cgx,
it seems we still need to obtain the RVU AF pdev before calling
pci_get_drvdata().

> When you repost please add net-next to the subject:
>
> [PATCH net-next v2] octeontx2-af: Fix ...
>
> and make sure you base the change on the net-next tree
> For some reason our CI wasn't able to ingest this change.

Understood. I'll apply this for v2.