• Home
  • Raw
  • Download

Lines Matching refs:rvu

112 #define NDC_MAX_BANK(rvu, blk_addr) (rvu_read64(rvu, \  argument
176 static int get_max_column_width(struct rvu *rvu) in get_max_column_width() argument
187 for (pf = 0; pf < rvu->hw->total_pfs; pf++) { in get_max_column_width()
188 for (vf = 0; vf <= rvu->hw->total_vfs; vf++) { in get_max_column_width()
194 block = rvu->hw->block[index]; in get_max_column_width()
215 struct rvu *rvu = filp->private_data; in rvu_dbg_rsrc_attach_status() local
233 lf_str_size = get_max_column_width(rvu); in rvu_dbg_rsrc_attach_status()
243 if (strlen(rvu->hw->block[index].name)) { in rvu_dbg_rsrc_attach_status()
246 rvu->hw->block[index].name); in rvu_dbg_rsrc_attach_status()
256 for (pf = 0; pf < rvu->hw->total_pfs; pf++) { in rvu_dbg_rsrc_attach_status()
257 for (vf = 0; vf <= rvu->hw->total_vfs; vf++) { in rvu_dbg_rsrc_attach_status()
277 block = rvu->hw->block[index]; in rvu_dbg_rsrc_attach_status()
315 static bool rvu_dbg_is_valid_lf(struct rvu *rvu, int blktype, int lf, in rvu_dbg_is_valid_lf() argument
322 blkaddr = rvu_get_blkaddr(rvu, blktype, 0); in rvu_dbg_is_valid_lf()
324 dev_warn(rvu->dev, "Invalid blktype\n"); in rvu_dbg_is_valid_lf()
328 hw = rvu->hw; in rvu_dbg_is_valid_lf()
332 dev_warn(rvu->dev, "Invalid LF: valid range: 0-%d\n", in rvu_dbg_is_valid_lf()
339 dev_warn(rvu->dev, in rvu_dbg_is_valid_lf()
383 struct rvu *rvu; in rvu_dbg_qsize_display() local
387 rvu = filp->private; in rvu_dbg_qsize_display()
390 qsize_id = rvu->rvu_dbg.npa_qsize_id; in rvu_dbg_qsize_display()
395 qsize_id = rvu->rvu_dbg.nix_qsize_id; in rvu_dbg_qsize_display()
403 if (!rvu_dbg_is_valid_lf(rvu, blktype, qsize_id, &pcifunc)) in rvu_dbg_qsize_display()
406 pfvf = rvu_get_pfvf(rvu, pcifunc); in rvu_dbg_qsize_display()
419 struct rvu *rvu = seqfile->private; in rvu_dbg_qsize_write() local
442 dev_info(rvu->dev, "Use echo <%s-lf > qsize\n", blk_string); in rvu_dbg_qsize_write()
446 if (!rvu_dbg_is_valid_lf(rvu, blktype, lf, &pcifunc)) { in rvu_dbg_qsize_write()
451 rvu->rvu_dbg.npa_qsize_id = lf; in rvu_dbg_qsize_write()
453 rvu->rvu_dbg.nix_qsize_id = lf; in rvu_dbg_qsize_write()
568 struct rvu *rvu; in rvu_dbg_npa_ctx_display() local
571 rvu = m->private; in rvu_dbg_npa_ctx_display()
575 npalf = rvu->rvu_dbg.npa_aura_ctx.lf; in rvu_dbg_npa_ctx_display()
576 id = rvu->rvu_dbg.npa_aura_ctx.id; in rvu_dbg_npa_ctx_display()
577 all = rvu->rvu_dbg.npa_aura_ctx.all; in rvu_dbg_npa_ctx_display()
581 npalf = rvu->rvu_dbg.npa_pool_ctx.lf; in rvu_dbg_npa_ctx_display()
582 id = rvu->rvu_dbg.npa_pool_ctx.id; in rvu_dbg_npa_ctx_display()
583 all = rvu->rvu_dbg.npa_pool_ctx.all; in rvu_dbg_npa_ctx_display()
589 if (!rvu_dbg_is_valid_lf(rvu, BLKTYPE_NPA, npalf, &pcifunc)) in rvu_dbg_npa_ctx_display()
592 pfvf = rvu_get_pfvf(rvu, pcifunc); in rvu_dbg_npa_ctx_display()
630 rc = rvu_npa_aq_enq_inst(rvu, &aq_req, &rsp); in rvu_dbg_npa_ctx_display()
640 static int write_npa_ctx(struct rvu *rvu, bool all, in write_npa_ctx() argument
647 if (!rvu_dbg_is_valid_lf(rvu, BLKTYPE_NPA, npalf, &pcifunc)) in write_npa_ctx()
650 pfvf = rvu_get_pfvf(rvu, pcifunc); in write_npa_ctx()
654 dev_warn(rvu->dev, "Aura context is not initialized\n"); in write_npa_ctx()
660 dev_warn(rvu->dev, "Pool context is not initialized\n"); in write_npa_ctx()
667 dev_warn(rvu->dev, "Invalid %s, valid range is 0-%d\n", in write_npa_ctx()
675 rvu->rvu_dbg.npa_aura_ctx.lf = npalf; in write_npa_ctx()
676 rvu->rvu_dbg.npa_aura_ctx.id = id; in write_npa_ctx()
677 rvu->rvu_dbg.npa_aura_ctx.all = all; in write_npa_ctx()
681 rvu->rvu_dbg.npa_pool_ctx.lf = npalf; in write_npa_ctx()
682 rvu->rvu_dbg.npa_pool_ctx.id = id; in write_npa_ctx()
683 rvu->rvu_dbg.npa_pool_ctx.all = all; in write_npa_ctx()
736 struct rvu *rvu = seqfp->private; in rvu_dbg_npa_ctx_write() local
749 dev_info(rvu->dev, in rvu_dbg_npa_ctx_write()
754 ret = write_npa_ctx(rvu, all, npalf, id, ctype); in rvu_dbg_npa_ctx_write()
795 struct rvu *rvu = s->private; in ndc_cache_stats() local
799 req = rvu_read64(rvu, blk_addr, NDC_AF_PORTX_RTX_RWX_REQ_PC in ndc_cache_stats()
801 lat = rvu_read64(rvu, blk_addr, NDC_AF_PORTX_RTX_RWX_LAT_PC in ndc_cache_stats()
803 out_req = rvu_read64(rvu, blk_addr, in ndc_cache_stats()
806 cant_alloc = rvu_read64(rvu, blk_addr, in ndc_cache_stats()
840 struct rvu *rvu = s->private; in ndc_blk_hits_miss_stats() local
843 max_bank = NDC_MAX_BANK(rvu, blk_addr); in ndc_blk_hits_miss_stats()
847 (u64)rvu_read64(rvu, blk_addr, in ndc_blk_hits_miss_stats()
850 (u64)rvu_read64(rvu, blk_addr, in ndc_blk_hits_miss_stats()
1060 struct rvu *rvu = filp->private; in rvu_dbg_nix_queue_ctx_display() local
1071 nixlf = rvu->rvu_dbg.nix_cq_ctx.lf; in rvu_dbg_nix_queue_ctx_display()
1072 id = rvu->rvu_dbg.nix_cq_ctx.id; in rvu_dbg_nix_queue_ctx_display()
1073 all = rvu->rvu_dbg.nix_cq_ctx.all; in rvu_dbg_nix_queue_ctx_display()
1077 nixlf = rvu->rvu_dbg.nix_sq_ctx.lf; in rvu_dbg_nix_queue_ctx_display()
1078 id = rvu->rvu_dbg.nix_sq_ctx.id; in rvu_dbg_nix_queue_ctx_display()
1079 all = rvu->rvu_dbg.nix_sq_ctx.all; in rvu_dbg_nix_queue_ctx_display()
1083 nixlf = rvu->rvu_dbg.nix_rq_ctx.lf; in rvu_dbg_nix_queue_ctx_display()
1084 id = rvu->rvu_dbg.nix_rq_ctx.id; in rvu_dbg_nix_queue_ctx_display()
1085 all = rvu->rvu_dbg.nix_rq_ctx.all; in rvu_dbg_nix_queue_ctx_display()
1092 if (!rvu_dbg_is_valid_lf(rvu, BLKTYPE_NIX, nixlf, &pcifunc)) in rvu_dbg_nix_queue_ctx_display()
1095 pfvf = rvu_get_pfvf(rvu, pcifunc); in rvu_dbg_nix_queue_ctx_display()
1133 rc = rvu_mbox_handler_nix_aq_enq(rvu, &aq_req, &rsp); in rvu_dbg_nix_queue_ctx_display()
1143 static int write_nix_queue_ctx(struct rvu *rvu, bool all, int nixlf, in write_nix_queue_ctx() argument
1150 if (!rvu_dbg_is_valid_lf(rvu, BLKTYPE_NIX, nixlf, &pcifunc)) in write_nix_queue_ctx()
1153 pfvf = rvu_get_pfvf(rvu, pcifunc); in write_nix_queue_ctx()
1157 dev_warn(rvu->dev, "SQ context is not initialized\n"); in write_nix_queue_ctx()
1163 dev_warn(rvu->dev, "RQ context is not initialized\n"); in write_nix_queue_ctx()
1169 dev_warn(rvu->dev, "CQ context is not initialized\n"); in write_nix_queue_ctx()
1176 dev_warn(rvu->dev, "Invalid %s_ctx valid range 0-%d\n", in write_nix_queue_ctx()
1182 rvu->rvu_dbg.nix_cq_ctx.lf = nixlf; in write_nix_queue_ctx()
1183 rvu->rvu_dbg.nix_cq_ctx.id = id; in write_nix_queue_ctx()
1184 rvu->rvu_dbg.nix_cq_ctx.all = all; in write_nix_queue_ctx()
1188 rvu->rvu_dbg.nix_sq_ctx.lf = nixlf; in write_nix_queue_ctx()
1189 rvu->rvu_dbg.nix_sq_ctx.id = id; in write_nix_queue_ctx()
1190 rvu->rvu_dbg.nix_sq_ctx.all = all; in write_nix_queue_ctx()
1194 rvu->rvu_dbg.nix_rq_ctx.lf = nixlf; in write_nix_queue_ctx()
1195 rvu->rvu_dbg.nix_rq_ctx.id = id; in write_nix_queue_ctx()
1196 rvu->rvu_dbg.nix_rq_ctx.all = all; in write_nix_queue_ctx()
1210 struct rvu *rvu = m->private; in rvu_dbg_nix_queue_ctx_write() local
1240 dev_info(rvu->dev, in rvu_dbg_nix_queue_ctx_write()
1245 ret = write_nix_queue_ctx(rvu, all, nixlf, id, ctype, in rvu_dbg_nix_queue_ctx_write()
1350 static void rvu_dbg_nix_init(struct rvu *rvu) in rvu_dbg_nix_init() argument
1352 const struct device *dev = &rvu->pdev->dev; in rvu_dbg_nix_init()
1355 rvu->rvu_dbg.nix = debugfs_create_dir("nix", rvu->rvu_dbg.root); in rvu_dbg_nix_init()
1356 if (!rvu->rvu_dbg.nix) { in rvu_dbg_nix_init()
1357 dev_err(rvu->dev, "create debugfs dir failed for nix\n"); in rvu_dbg_nix_init()
1361 pfile = debugfs_create_file("sq_ctx", 0600, rvu->rvu_dbg.nix, rvu, in rvu_dbg_nix_init()
1366 pfile = debugfs_create_file("rq_ctx", 0600, rvu->rvu_dbg.nix, rvu, in rvu_dbg_nix_init()
1371 pfile = debugfs_create_file("cq_ctx", 0600, rvu->rvu_dbg.nix, rvu, in rvu_dbg_nix_init()
1376 pfile = debugfs_create_file("ndc_tx_cache", 0600, rvu->rvu_dbg.nix, rvu, in rvu_dbg_nix_init()
1381 pfile = debugfs_create_file("ndc_rx_cache", 0600, rvu->rvu_dbg.nix, rvu, in rvu_dbg_nix_init()
1386 pfile = debugfs_create_file("ndc_tx_hits_miss", 0600, rvu->rvu_dbg.nix, in rvu_dbg_nix_init()
1387 rvu, &rvu_dbg_nix_ndc_tx_hits_miss_fops); in rvu_dbg_nix_init()
1391 pfile = debugfs_create_file("ndc_rx_hits_miss", 0600, rvu->rvu_dbg.nix, in rvu_dbg_nix_init()
1392 rvu, &rvu_dbg_nix_ndc_rx_hits_miss_fops); in rvu_dbg_nix_init()
1396 pfile = debugfs_create_file("qsize", 0600, rvu->rvu_dbg.nix, rvu, in rvu_dbg_nix_init()
1404 debugfs_remove_recursive(rvu->rvu_dbg.nix); in rvu_dbg_nix_init()
1407 static void rvu_dbg_npa_init(struct rvu *rvu) in rvu_dbg_npa_init() argument
1409 const struct device *dev = &rvu->pdev->dev; in rvu_dbg_npa_init()
1412 rvu->rvu_dbg.npa = debugfs_create_dir("npa", rvu->rvu_dbg.root); in rvu_dbg_npa_init()
1413 if (!rvu->rvu_dbg.npa) in rvu_dbg_npa_init()
1416 pfile = debugfs_create_file("qsize", 0600, rvu->rvu_dbg.npa, rvu, in rvu_dbg_npa_init()
1421 pfile = debugfs_create_file("aura_ctx", 0600, rvu->rvu_dbg.npa, rvu, in rvu_dbg_npa_init()
1426 pfile = debugfs_create_file("pool_ctx", 0600, rvu->rvu_dbg.npa, rvu, in rvu_dbg_npa_init()
1431 pfile = debugfs_create_file("ndc_cache", 0600, rvu->rvu_dbg.npa, rvu, in rvu_dbg_npa_init()
1436 pfile = debugfs_create_file("ndc_hits_miss", 0600, rvu->rvu_dbg.npa, in rvu_dbg_npa_init()
1437 rvu, &rvu_dbg_npa_ndc_hits_miss_fops); in rvu_dbg_npa_init()
1445 debugfs_remove_recursive(rvu->rvu_dbg.npa); in rvu_dbg_npa_init()
1451 err = rvu_cgx_nix_cuml_stats(rvu, cgxd, lmac_id, (idx), \
1461 err = rvu_cgx_nix_cuml_stats(rvu, cgxd, lmac_id, (idx), \
1475 struct rvu *rvu; in cgx_print_stats() local
1477 rvu = pci_get_drvdata(pci_get_device(PCI_VENDOR_ID_CAVIUM, in cgx_print_stats()
1479 if (!rvu) in cgx_print_stats()
1577 static void rvu_dbg_cgx_init(struct rvu *rvu) in rvu_dbg_cgx_init() argument
1579 const struct device *dev = &rvu->pdev->dev; in rvu_dbg_cgx_init()
1585 rvu->rvu_dbg.cgx_root = debugfs_create_dir("cgx", rvu->rvu_dbg.root); in rvu_dbg_cgx_init()
1588 cgx = rvu_cgx_pdata(i, rvu); in rvu_dbg_cgx_init()
1593 rvu->rvu_dbg.cgx = debugfs_create_dir(dname, in rvu_dbg_cgx_init()
1594 rvu->rvu_dbg.cgx_root); in rvu_dbg_cgx_init()
1598 rvu->rvu_dbg.lmac = in rvu_dbg_cgx_init()
1599 debugfs_create_dir(dname, rvu->rvu_dbg.cgx); in rvu_dbg_cgx_init()
1602 rvu->rvu_dbg.lmac, cgx, in rvu_dbg_cgx_init()
1612 debugfs_remove_recursive(rvu->rvu_dbg.cgx_root); in rvu_dbg_cgx_init()
1619 struct rvu *rvu = s->private; in rvu_print_npc_mcam_info() local
1626 rvu_npc_get_mcam_entry_alloc_info(rvu, pcifunc, blkaddr, in rvu_print_npc_mcam_info()
1628 rvu_npc_get_mcam_counter_alloc_info(rvu, pcifunc, blkaddr, in rvu_print_npc_mcam_info()
1653 struct rvu *rvu = filp->private; in rvu_dbg_npc_mcam_info_display() local
1659 blkaddr = rvu_get_blkaddr(rvu, BLKTYPE_NPC, 0); in rvu_dbg_npc_mcam_info_display()
1663 mcam = &rvu->hw->mcam; in rvu_dbg_npc_mcam_info_display()
1667 cfg = rvu_read64(rvu, blkaddr, NPC_AF_INTFX_KEX_CFG(NIX_INTF_RX)); in rvu_dbg_npc_mcam_info_display()
1672 cfg = rvu_read64(rvu, blkaddr, NPC_AF_INTFX_KEX_CFG(NIX_INTF_TX)); in rvu_dbg_npc_mcam_info_display()
1686 cfg = rvu_read64(rvu, blkaddr, NPC_AF_CONST); in rvu_dbg_npc_mcam_info_display()
1700 for (pf = 0; pf < rvu->hw->total_pfs; pf++) { in rvu_dbg_npc_mcam_info_display()
1704 cfg = rvu_read64(rvu, BLKADDR_RVUM, RVU_PRIV_PFX_CFG(pf)); in rvu_dbg_npc_mcam_info_display()
1721 struct rvu *rvu = filp->private; in rvu_dbg_npc_rx_miss_stats_display() local
1725 blkaddr = rvu_get_blkaddr(rvu, BLKTYPE_NPC, 0); in rvu_dbg_npc_rx_miss_stats_display()
1729 mcam = &rvu->hw->mcam; in rvu_dbg_npc_rx_miss_stats_display()
1733 rvu_read64(rvu, blkaddr, in rvu_dbg_npc_rx_miss_stats_display()
1741 static void rvu_dbg_npc_init(struct rvu *rvu) in rvu_dbg_npc_init() argument
1743 const struct device *dev = &rvu->pdev->dev; in rvu_dbg_npc_init()
1746 rvu->rvu_dbg.npc = debugfs_create_dir("npc", rvu->rvu_dbg.root); in rvu_dbg_npc_init()
1747 if (!rvu->rvu_dbg.npc) in rvu_dbg_npc_init()
1750 pfile = debugfs_create_file("mcam_info", 0444, rvu->rvu_dbg.npc, in rvu_dbg_npc_init()
1751 rvu, &rvu_dbg_npc_mcam_info_fops); in rvu_dbg_npc_init()
1755 pfile = debugfs_create_file("rx_miss_act_stats", 0444, rvu->rvu_dbg.npc, in rvu_dbg_npc_init()
1756 rvu, &rvu_dbg_npc_rx_miss_act_fops); in rvu_dbg_npc_init()
1764 debugfs_remove_recursive(rvu->rvu_dbg.npc); in rvu_dbg_npc_init()
1767 void rvu_dbg_init(struct rvu *rvu) in rvu_dbg_init() argument
1769 struct device *dev = &rvu->pdev->dev; in rvu_dbg_init()
1772 rvu->rvu_dbg.root = debugfs_create_dir(DEBUGFS_DIR_NAME, NULL); in rvu_dbg_init()
1773 if (!rvu->rvu_dbg.root) { in rvu_dbg_init()
1774 dev_err(rvu->dev, "%s failed\n", __func__); in rvu_dbg_init()
1777 pfile = debugfs_create_file("rsrc_alloc", 0444, rvu->rvu_dbg.root, rvu, in rvu_dbg_init()
1782 rvu_dbg_npa_init(rvu); in rvu_dbg_init()
1783 rvu_dbg_nix_init(rvu); in rvu_dbg_init()
1784 rvu_dbg_cgx_init(rvu); in rvu_dbg_init()
1785 rvu_dbg_npc_init(rvu); in rvu_dbg_init()
1791 debugfs_remove_recursive(rvu->rvu_dbg.root); in rvu_dbg_init()
1794 void rvu_dbg_exit(struct rvu *rvu) in rvu_dbg_exit() argument
1796 debugfs_remove_recursive(rvu->rvu_dbg.root); in rvu_dbg_exit()