octeontx2-af: debugfs: Add Channel info to RPM map
authorLinu Cherian <lcherian@marvell.com>
Thu, 12 Sep 2024 16:14:50 +0000 (21:44 +0530)
committerJakub Kicinski <kuba@kernel.org>
Sat, 14 Sep 2024 04:42:21 +0000 (21:42 -0700)
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: Linu Cherian <lcherian@marvell.com>
Link: https://patch.msgid.link/20240912161450.164402-3-lcherian@marvell.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/marvell/octeontx2/af/rvu_debugfs.c

index 4a4ef5bd9e0bd5be70028e4f8e2834e37bf3d1b3..87ba77e5026a024fa38b39c2b10fbfbfd581fc84 100644 (file)
@@ -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)
 {
+       char cgx[10], lmac[10], chan[10];
        struct rvu *rvu = filp->private;
        struct pci_dev *pdev = NULL;
        struct mac_ops *mac_ops;
-       char cgx[10], lmac[10];
        struct rvu_pfvf *pfvf;
        int pf, domain, blkid;
        u8 cgx_id, lmac_id;
@@ -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 */
        if (!mac_ops)
                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);
        for (pf = 0; pf < rvu->hw->total_pfs; 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)
                                    &lmac_id);
                sprintf(cgx, "%s%d", mac_ops->name, cgx_id);
                sprintf(lmac, "LMAC%d", lmac_id);
-               seq_printf(filp, "%s\t0x%x\t\tNIX%d\t\t%s\t%s\n",
-                          dev_name(&pdev->dev), pcifunc, blkid, cgx, lmac);
+               sprintf(chan, "%d",
+                       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);
        }