Commit beb2baa9 authored by Linu Cherian's avatar Linu Cherian Committed by Jakub Kicinski

octeontx2-af: debugfs: Add Channel info to RPM map

Display channel info in the RPM map debugfs output.

With this, cat /sys/kernel/debug/cn10k/rvu_pf_rpm_map
would display channel number for each device in addition to
the existing data.

Sample output:
PCI dev         RVU PF Func     NIX block       rpm     LMAC    CHAN
0002:02:00.0    0x400           NIX0            rpm0    LMAC0   256
Signed-off-by: default avatarLinu Cherian <lcherian@marvell.com>
Link: https://patch.msgid.link/20240912161450.164402-3-lcherian@marvell.comSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent 1ad84a15
...@@ -838,10 +838,10 @@ RVU_DEBUG_FOPS(rsrc_status, rsrc_attach_status, NULL); ...@@ -838,10 +838,10 @@ RVU_DEBUG_FOPS(rsrc_status, rsrc_attach_status, NULL);
static int rvu_dbg_rvu_pf_cgx_map_display(struct seq_file *filp, void *unused) static int rvu_dbg_rvu_pf_cgx_map_display(struct seq_file *filp, void *unused)
{ {
char cgx[10], lmac[10], chan[10];
struct rvu *rvu = filp->private; struct rvu *rvu = filp->private;
struct pci_dev *pdev = NULL; struct pci_dev *pdev = NULL;
struct mac_ops *mac_ops; struct mac_ops *mac_ops;
char cgx[10], lmac[10];
struct rvu_pfvf *pfvf; struct rvu_pfvf *pfvf;
int pf, domain, blkid; int pf, domain, blkid;
u8 cgx_id, lmac_id; u8 cgx_id, lmac_id;
...@@ -852,7 +852,7 @@ static int rvu_dbg_rvu_pf_cgx_map_display(struct seq_file *filp, void *unused) ...@@ -852,7 +852,7 @@ static int rvu_dbg_rvu_pf_cgx_map_display(struct seq_file *filp, void *unused)
/* There can be no CGX devices at all */ /* There can be no CGX devices at all */
if (!mac_ops) if (!mac_ops)
return 0; return 0;
seq_printf(filp, "PCI dev\t\tRVU PF Func\tNIX block\t%s\tLMAC\n", seq_printf(filp, "PCI dev\t\tRVU PF Func\tNIX block\t%s\tLMAC\tCHAN\n",
mac_ops->name); mac_ops->name);
for (pf = 0; pf < rvu->hw->total_pfs; pf++) { for (pf = 0; pf < rvu->hw->total_pfs; pf++) {
if (!is_pf_cgxmapped(rvu, pf)) if (!is_pf_cgxmapped(rvu, pf))
...@@ -876,8 +876,11 @@ static int rvu_dbg_rvu_pf_cgx_map_display(struct seq_file *filp, void *unused) ...@@ -876,8 +876,11 @@ static int rvu_dbg_rvu_pf_cgx_map_display(struct seq_file *filp, void *unused)
&lmac_id); &lmac_id);
sprintf(cgx, "%s%d", mac_ops->name, cgx_id); sprintf(cgx, "%s%d", mac_ops->name, cgx_id);
sprintf(lmac, "LMAC%d", lmac_id); sprintf(lmac, "LMAC%d", lmac_id);
seq_printf(filp, "%s\t0x%x\t\tNIX%d\t\t%s\t%s\n", sprintf(chan, "%d",
dev_name(&pdev->dev), pcifunc, blkid, cgx, lmac); rvu_nix_chan_cgx(rvu, cgx_id, lmac_id, 0));
seq_printf(filp, "%s\t0x%x\t\tNIX%d\t\t%s\t%s\t%s\n",
dev_name(&pdev->dev), pcifunc, blkid, cgx, lmac,
chan);
pci_dev_put(pdev); pci_dev_put(pdev);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment