Lines Matching refs:rvu
34 static void npc_mcam_free_all_entries(struct rvu *rvu, struct npc_mcam *mcam,
36 static void npc_mcam_free_all_counters(struct rvu *rvu, struct npc_mcam *mcam,
39 void rvu_npc_set_pkind(struct rvu *rvu, int pkind, struct rvu_pfvf *pfvf) in rvu_npc_set_pkind() argument
44 blkaddr = rvu_get_blkaddr(rvu, BLKTYPE_NPC, 0); in rvu_npc_set_pkind()
50 rvu_write64(rvu, blkaddr, NPC_AF_PKINDX_CPI_DEFX(pkind, 0), val); in rvu_npc_set_pkind()
53 int rvu_npc_get_pkind(struct rvu *rvu, u16 pf) in rvu_npc_get_pkind() argument
55 struct npc_pkind *pkind = &rvu->hw->pkind; in rvu_npc_get_pkind()
69 int npc_config_ts_kpuaction(struct rvu *rvu, int pf, u16 pcifunc, bool enable) in npc_config_ts_kpuaction() argument
74 pkind = rvu_npc_get_pkind(rvu, pf); in npc_config_ts_kpuaction()
76 dev_err(rvu->dev, "%s: pkind not mapped\n", __func__); in npc_config_ts_kpuaction()
80 blkaddr = rvu_get_blkaddr(rvu, BLKTYPE_NPC, pcifunc); in npc_config_ts_kpuaction()
82 dev_err(rvu->dev, "%s: NPC block not implemented\n", __func__); in npc_config_ts_kpuaction()
86 val = rvu_read64(rvu, blkaddr, NPC_AF_PKINDX_ACTION0(pkind)); in npc_config_ts_kpuaction()
92 rvu_write64(rvu, blkaddr, NPC_AF_PKINDX_ACTION0(pkind), val); in npc_config_ts_kpuaction()
131 static bool is_mcam_entry_enabled(struct rvu *rvu, struct npc_mcam *mcam, in is_mcam_entry_enabled() argument
138 cfg = rvu_read64(rvu, blkaddr, NPC_AF_MCAMEX_BANKX_CFG(index, bank)); in is_mcam_entry_enabled()
142 static void npc_enable_mcam_entry(struct rvu *rvu, struct npc_mcam *mcam, in npc_enable_mcam_entry() argument
150 rvu_write64(rvu, blkaddr, in npc_enable_mcam_entry()
156 static void npc_clear_mcam_entry(struct rvu *rvu, struct npc_mcam *mcam, in npc_clear_mcam_entry() argument
164 rvu_write64(rvu, blkaddr, in npc_clear_mcam_entry()
166 rvu_write64(rvu, blkaddr, in npc_clear_mcam_entry()
169 rvu_write64(rvu, blkaddr, in npc_clear_mcam_entry()
171 rvu_write64(rvu, blkaddr, in npc_clear_mcam_entry()
174 rvu_write64(rvu, blkaddr, in npc_clear_mcam_entry()
176 rvu_write64(rvu, blkaddr, in npc_clear_mcam_entry()
260 static void npc_config_mcam_entry(struct rvu *rvu, struct npc_mcam *mcam, in npc_config_mcam_entry() argument
273 npc_enable_mcam_entry(rvu, mcam, blkaddr, actindex, false); in npc_config_mcam_entry()
276 npc_clear_mcam_entry(rvu, mcam, blkaddr, actindex); in npc_config_mcam_entry()
286 rvu_write64(rvu, blkaddr, in npc_config_mcam_entry()
289 rvu_write64(rvu, blkaddr, in npc_config_mcam_entry()
295 rvu_write64(rvu, blkaddr, in npc_config_mcam_entry()
297 rvu_write64(rvu, blkaddr, in npc_config_mcam_entry()
301 rvu_write64(rvu, blkaddr, in npc_config_mcam_entry()
303 rvu_write64(rvu, blkaddr, in npc_config_mcam_entry()
308 rvu_write64(rvu, blkaddr, in npc_config_mcam_entry()
312 rvu_write64(rvu, blkaddr, NPC_AF_MCAMEX_BANKX_TAG_ACT(index, actbank), in npc_config_mcam_entry()
317 npc_enable_mcam_entry(rvu, mcam, blkaddr, actindex, true); in npc_config_mcam_entry()
320 static void npc_copy_mcam_entry(struct rvu *rvu, struct npc_mcam *mcam, in npc_copy_mcam_entry() argument
336 cfg = rvu_read64(rvu, blkaddr, sreg + (i * 8)); in npc_copy_mcam_entry()
337 rvu_write64(rvu, blkaddr, dreg + (i * 8), cfg); in npc_copy_mcam_entry()
342 cfg = rvu_read64(rvu, blkaddr, in npc_copy_mcam_entry()
344 rvu_write64(rvu, blkaddr, in npc_copy_mcam_entry()
348 cfg = rvu_read64(rvu, blkaddr, in npc_copy_mcam_entry()
350 rvu_write64(rvu, blkaddr, in npc_copy_mcam_entry()
354 cfg = rvu_read64(rvu, blkaddr, in npc_copy_mcam_entry()
356 rvu_write64(rvu, blkaddr, in npc_copy_mcam_entry()
360 static u64 npc_get_mcam_action(struct rvu *rvu, struct npc_mcam *mcam, in npc_get_mcam_action() argument
366 return rvu_read64(rvu, blkaddr, in npc_get_mcam_action()
370 void rvu_npc_install_ucast_entry(struct rvu *rvu, u16 pcifunc, in rvu_npc_install_ucast_entry() argument
373 struct rvu_pfvf *pfvf = rvu_get_pfvf(rvu, pcifunc); in rvu_npc_install_ucast_entry()
374 struct npc_mcam *mcam = &rvu->hw->mcam; in rvu_npc_install_ucast_entry()
384 blkaddr = rvu_get_blkaddr(rvu, BLKTYPE_NPC, 0); in rvu_npc_install_ucast_entry()
405 if (is_mcam_entry_enabled(rvu, mcam, blkaddr, index)) { in rvu_npc_install_ucast_entry()
406 *(u64 *)&action = npc_get_mcam_action(rvu, mcam, in rvu_npc_install_ucast_entry()
415 npc_config_mcam_entry(rvu, mcam, blkaddr, index, in rvu_npc_install_ucast_entry()
430 void rvu_npc_install_promisc_entry(struct rvu *rvu, u16 pcifunc, in rvu_npc_install_promisc_entry() argument
433 struct npc_mcam *mcam = &rvu->hw->mcam; in rvu_npc_install_promisc_entry()
442 blkaddr = rvu_get_blkaddr(rvu, BLKTYPE_NPC, 0); in rvu_npc_install_promisc_entry()
464 if (is_mcam_entry_enabled(rvu, mcam, blkaddr, ucast_idx)) in rvu_npc_install_promisc_entry()
465 *(u64 *)&action = npc_get_mcam_action(rvu, mcam, in rvu_npc_install_promisc_entry()
475 npc_config_mcam_entry(rvu, mcam, blkaddr, index, in rvu_npc_install_promisc_entry()
479 static void npc_enadis_promisc_entry(struct rvu *rvu, u16 pcifunc, in npc_enadis_promisc_entry() argument
482 struct npc_mcam *mcam = &rvu->hw->mcam; in npc_enadis_promisc_entry()
485 blkaddr = rvu_get_blkaddr(rvu, BLKTYPE_NPC, 0); in npc_enadis_promisc_entry()
495 npc_enable_mcam_entry(rvu, mcam, blkaddr, index, enable); in npc_enadis_promisc_entry()
498 void rvu_npc_disable_promisc_entry(struct rvu *rvu, u16 pcifunc, int nixlf) in rvu_npc_disable_promisc_entry() argument
500 npc_enadis_promisc_entry(rvu, pcifunc, nixlf, false); in rvu_npc_disable_promisc_entry()
503 void rvu_npc_enable_promisc_entry(struct rvu *rvu, u16 pcifunc, int nixlf) in rvu_npc_enable_promisc_entry() argument
505 npc_enadis_promisc_entry(rvu, pcifunc, nixlf, true); in rvu_npc_enable_promisc_entry()
508 void rvu_npc_install_bcast_match_entry(struct rvu *rvu, u16 pcifunc, in rvu_npc_install_bcast_match_entry() argument
511 struct npc_mcam *mcam = &rvu->hw->mcam; in rvu_npc_install_bcast_match_entry()
513 struct rvu_hwinfo *hw = rvu->hw; in rvu_npc_install_bcast_match_entry()
518 blkaddr = rvu_get_blkaddr(rvu, BLKTYPE_NPC, 0); in rvu_npc_install_bcast_match_entry()
556 pfvf = rvu_get_pfvf(rvu, pcifunc); in rvu_npc_install_bcast_match_entry()
562 npc_config_mcam_entry(rvu, mcam, blkaddr, index, in rvu_npc_install_bcast_match_entry()
566 void rvu_npc_enable_bcast_entry(struct rvu *rvu, u16 pcifunc, bool enable) in rvu_npc_enable_bcast_entry() argument
568 struct npc_mcam *mcam = &rvu->hw->mcam; in rvu_npc_enable_bcast_entry()
571 blkaddr = rvu_get_blkaddr(rvu, BLKTYPE_NPC, 0); in rvu_npc_enable_bcast_entry()
579 npc_enable_mcam_entry(rvu, mcam, blkaddr, index, enable); in rvu_npc_enable_bcast_entry()
582 void rvu_npc_update_flowkey_alg_idx(struct rvu *rvu, u16 pcifunc, int nixlf, in rvu_npc_update_flowkey_alg_idx() argument
585 struct npc_mcam *mcam = &rvu->hw->mcam; in rvu_npc_update_flowkey_alg_idx()
589 blkaddr = rvu_get_blkaddr(rvu, BLKTYPE_NPC, 0); in rvu_npc_update_flowkey_alg_idx()
610 *(u64 *)&action = rvu_read64(rvu, blkaddr, in rvu_npc_update_flowkey_alg_idx()
621 rvu_write64(rvu, blkaddr, in rvu_npc_update_flowkey_alg_idx()
630 if (is_mcam_entry_enabled(rvu, mcam, blkaddr, index)) { in rvu_npc_update_flowkey_alg_idx()
634 rvu_write64(rvu, blkaddr, in rvu_npc_update_flowkey_alg_idx()
639 rvu_npc_update_rxvlan(rvu, pcifunc, nixlf); in rvu_npc_update_flowkey_alg_idx()
642 static void npc_enadis_default_entries(struct rvu *rvu, u16 pcifunc, in npc_enadis_default_entries() argument
645 struct npc_mcam *mcam = &rvu->hw->mcam; in npc_enadis_default_entries()
649 blkaddr = rvu_get_blkaddr(rvu, BLKTYPE_NPC, 0); in npc_enadis_default_entries()
656 npc_enable_mcam_entry(rvu, mcam, blkaddr, index, enable); in npc_enadis_default_entries()
662 if (pcifunc & RVU_PFVF_FUNC_MASK && !rvu->hw->cap.nix_rx_multicast) in npc_enadis_default_entries()
673 *(u64 *)&action = rvu_read64(rvu, blkaddr, in npc_enadis_default_entries()
679 npc_enable_mcam_entry(rvu, mcam, in npc_enadis_default_entries()
682 nix_update_bcast_mce_list(rvu, pcifunc, enable); in npc_enadis_default_entries()
684 rvu_npc_enable_bcast_entry(rvu, pcifunc, enable); in npc_enadis_default_entries()
688 rvu_npc_enable_promisc_entry(rvu, pcifunc, nixlf); in npc_enadis_default_entries()
690 rvu_npc_disable_promisc_entry(rvu, pcifunc, nixlf); in npc_enadis_default_entries()
692 rvu_npc_update_rxvlan(rvu, pcifunc, nixlf); in npc_enadis_default_entries()
695 void rvu_npc_disable_default_entries(struct rvu *rvu, u16 pcifunc, int nixlf) in rvu_npc_disable_default_entries() argument
697 npc_enadis_default_entries(rvu, pcifunc, nixlf, false); in rvu_npc_disable_default_entries()
700 void rvu_npc_enable_default_entries(struct rvu *rvu, u16 pcifunc, int nixlf) in rvu_npc_enable_default_entries() argument
702 npc_enadis_default_entries(rvu, pcifunc, nixlf, true); in rvu_npc_enable_default_entries()
705 void rvu_npc_disable_mcam_entries(struct rvu *rvu, u16 pcifunc, int nixlf) in rvu_npc_disable_mcam_entries() argument
707 struct npc_mcam *mcam = &rvu->hw->mcam; in rvu_npc_disable_mcam_entries()
710 blkaddr = rvu_get_blkaddr(rvu, BLKTYPE_NPC, 0); in rvu_npc_disable_mcam_entries()
717 npc_mcam_free_all_entries(rvu, mcam, blkaddr, pcifunc); in rvu_npc_disable_mcam_entries()
720 npc_mcam_free_all_counters(rvu, mcam, pcifunc); in rvu_npc_disable_mcam_entries()
724 rvu_npc_disable_default_entries(rvu, pcifunc, nixlf); in rvu_npc_disable_mcam_entries()
728 rvu_write64(rvu, blkaddr, \
732 rvu_write64(rvu, blkaddr, \
735 static void npc_program_mkex_profile(struct rvu *rvu, int blkaddr, in npc_program_mkex_profile() argument
740 rvu_write64(rvu, blkaddr, NPC_AF_INTFX_KEX_CFG(NIX_INTF_RX), in npc_program_mkex_profile()
742 rvu_write64(rvu, blkaddr, NPC_AF_INTFX_KEX_CFG(NIX_INTF_TX), in npc_program_mkex_profile()
746 rvu_write64(rvu, blkaddr, NPC_AF_KEX_LDATAX_FLAGS_CFG(ld), in npc_program_mkex_profile()
778 static void npc_load_mkex_profile(struct rvu *rvu, int blkaddr, in npc_load_mkex_profile() argument
781 struct device *dev = &rvu->pdev->dev; in npc_load_mkex_profile()
790 if (!rvu->fwdata) in npc_load_mkex_profile()
792 prfl_addr = rvu->fwdata->mcam_addr; in npc_load_mkex_profile()
793 prfl_sz = rvu->fwdata->mcam_sz; in npc_load_mkex_profile()
812 if (!is_rvu_96xx_B0(rvu) || in npc_load_mkex_profile()
814 rvu->kpu.mkex = mcam_kex; in npc_load_mkex_profile()
824 dev_info(rvu->dev, "Using %s mkex profile\n", rvu->kpu.mkex->name); in npc_load_mkex_profile()
826 npc_program_mkex_profile(rvu, blkaddr, rvu->kpu.mkex); in npc_load_mkex_profile()
831 static void npc_config_kpuaction(struct rvu *rvu, int blkaddr, in npc_config_kpuaction() argument
850 rvu_write64(rvu, blkaddr, reg, *(u64 *)&action1); in npc_config_kpuaction()
870 rvu_write64(rvu, blkaddr, reg, *(u64 *)&action0); in npc_config_kpuaction()
873 static void npc_config_kpucam(struct rvu *rvu, int blkaddr, in npc_config_kpucam() argument
890 rvu_write64(rvu, blkaddr, in npc_config_kpucam()
892 rvu_write64(rvu, blkaddr, in npc_config_kpucam()
901 static void npc_program_kpu_profile(struct rvu *rvu, int blkaddr, int kpu, in npc_program_kpu_profile() argument
907 dev_err(rvu->dev, in npc_program_kpu_profile()
912 max_entries = rvu_read64(rvu, blkaddr, NPC_AF_CONST1) & 0xFFF; in npc_program_kpu_profile()
917 npc_config_kpucam(rvu, blkaddr, in npc_program_kpu_profile()
923 npc_config_kpuaction(rvu, blkaddr, &profile->action[entry], in npc_program_kpu_profile()
928 rvu_write64(rvu, blkaddr, in npc_program_kpu_profile()
931 rvu_write64(rvu, blkaddr, in npc_program_kpu_profile()
937 rvu_write64(rvu, blkaddr, NPC_AF_KPUX_CFG(kpu), 0x01); in npc_program_kpu_profile()
954 static void npc_load_kpu_profile(struct rvu *rvu) in npc_load_kpu_profile() argument
956 struct npc_kpu_profile_adapter *profile = &rvu->kpu; in npc_load_kpu_profile()
961 static void npc_parser_profile_init(struct rvu *rvu, int blkaddr) in npc_parser_profile_init() argument
963 struct rvu_hwinfo *hw = rvu->hw; in npc_parser_profile_init()
968 hw->npc_kpus = (rvu_read64(rvu, blkaddr, NPC_AF_CONST) >> 8) & 0x1F; in npc_parser_profile_init()
972 rvu_write64(rvu, blkaddr, in npc_parser_profile_init()
974 rvu_write64(rvu, blkaddr, in npc_parser_profile_init()
976 rvu_write64(rvu, blkaddr, NPC_AF_KPUX_CFG(idx), 0x00); in npc_parser_profile_init()
980 npc_load_kpu_profile(rvu); in npc_parser_profile_init()
987 num_pkinds = rvu->kpu.pkinds; in npc_parser_profile_init()
991 npc_config_kpuaction(rvu, blkaddr, &rvu->kpu.ikpu[idx], 0, idx, true); in npc_parser_profile_init()
994 num_kpus = rvu->kpu.kpus; in npc_parser_profile_init()
998 npc_program_kpu_profile(rvu, blkaddr, idx, &rvu->kpu.kpu[idx]); in npc_parser_profile_init()
1001 static int npc_mcam_rsrcs_init(struct rvu *rvu, int blkaddr) in npc_mcam_rsrcs_init() argument
1003 int nixlf_count = rvu_get_nixlf_count(rvu); in npc_mcam_rsrcs_init()
1004 struct npc_mcam *mcam = &rvu->hw->mcam; in npc_mcam_rsrcs_init()
1009 cfg = rvu_read64(rvu, blkaddr, NPC_AF_CONST); in npc_mcam_rsrcs_init()
1015 cfg = (rvu_read64(rvu, blkaddr, in npc_mcam_rsrcs_init()
1036 ((rvu->hw->total_pfs - 1) * RSVD_MCAM_ENTRIES_PER_PF); in npc_mcam_rsrcs_init()
1038 dev_warn(rvu->dev, in npc_mcam_rsrcs_init()
1049 mcam->bmap = devm_kcalloc(rvu->dev, BITS_TO_LONGS(mcam->bmap_entries), in npc_mcam_rsrcs_init()
1054 mcam->bmap_reverse = devm_kcalloc(rvu->dev, in npc_mcam_rsrcs_init()
1063 mcam->entry2pfvf_map = devm_kcalloc(rvu->dev, mcam->bmap_entries, in npc_mcam_rsrcs_init()
1094 mcam->cntr2pfvf_map = devm_kcalloc(rvu->dev, mcam->counters.max, in npc_mcam_rsrcs_init()
1102 mcam->entry2cntr_map = devm_kcalloc(rvu->dev, mcam->bmap_entries, in npc_mcam_rsrcs_init()
1107 mcam->cntr_refcnt = devm_kcalloc(rvu->dev, mcam->counters.max, in npc_mcam_rsrcs_init()
1121 int rvu_npc_init(struct rvu *rvu) in rvu_npc_init() argument
1123 struct npc_kpu_profile_adapter *kpu = &rvu->kpu; in rvu_npc_init()
1124 struct npc_pkind *pkind = &rvu->hw->pkind; in rvu_npc_init()
1125 struct npc_mcam *mcam = &rvu->hw->mcam; in rvu_npc_init()
1129 blkaddr = rvu_get_blkaddr(rvu, BLKTYPE_NPC, 0); in rvu_npc_init()
1131 dev_err(rvu->dev, "%s: NPC block not implemented\n", __func__); in rvu_npc_init()
1136 cfg = rvu_read64(rvu, blkaddr, NPC_AF_CONST); in rvu_npc_init()
1139 rvu_write64(rvu, blkaddr, in rvu_npc_init()
1144 pkind->rsrc.max = (rvu_read64(rvu, blkaddr, in rvu_npc_init()
1151 pkind->pfchan_map = devm_kcalloc(rvu->dev, pkind->rsrc.max, in rvu_npc_init()
1157 npc_parser_profile_init(rvu, blkaddr); in rvu_npc_init()
1160 rvu_write64(rvu, blkaddr, NPC_AF_PCK_DEF_OL2, in rvu_npc_init()
1163 rvu_write64(rvu, blkaddr, NPC_AF_PCK_DEF_OIP4, in rvu_npc_init()
1168 rvu_write64(rvu, blkaddr, NPC_AF_PCK_DEF_IIP4, in rvu_npc_init()
1179 rvu_write64(rvu, blkaddr, NPC_AF_PCK_CFG, in rvu_npc_init()
1180 rvu_read64(rvu, blkaddr, NPC_AF_PCK_CFG) | in rvu_npc_init()
1190 rvu_write64(rvu, blkaddr, NPC_AF_INTFX_KEX_CFG(NIX_INTF_RX), rx_kex); in rvu_npc_init()
1194 if (is_rvu_96xx_B0(rvu)) { in rvu_npc_init()
1198 rvu_write64(rvu, blkaddr, NPC_AF_INTFX_KEX_CFG(NIX_INTF_TX), tx_kex); in rvu_npc_init()
1200 err = npc_mcam_rsrcs_init(rvu, blkaddr); in rvu_npc_init()
1205 npc_load_mkex_profile(rvu, blkaddr, rvu->mkex_pfl_name); in rvu_npc_init()
1210 rvu_write64(rvu, blkaddr, NPC_AF_INTFX_MISS_ACT(NIX_INTF_TX), in rvu_npc_init()
1216 rvu_write64(rvu, blkaddr, NPC_AF_INTFX_MISS_ACT(NIX_INTF_RX), in rvu_npc_init()
1218 rvu_write64(rvu, blkaddr, NPC_AF_INTFX_MISS_STAT_ACT(NIX_INTF_RX), in rvu_npc_init()
1224 void rvu_npc_freemem(struct rvu *rvu) in rvu_npc_freemem() argument
1226 struct npc_pkind *pkind = &rvu->hw->pkind; in rvu_npc_freemem()
1227 struct npc_mcam *mcam = &rvu->hw->mcam; in rvu_npc_freemem()
1234 void rvu_npc_get_mcam_entry_alloc_info(struct rvu *rvu, u16 pcifunc, in rvu_npc_get_mcam_entry_alloc_info() argument
1238 struct npc_mcam *mcam = &rvu->hw->mcam; in rvu_npc_get_mcam_entry_alloc_info()
1247 if (is_mcam_entry_enabled(rvu, mcam, blkaddr, entry)) in rvu_npc_get_mcam_entry_alloc_info()
1253 void rvu_npc_get_mcam_counter_alloc_info(struct rvu *rvu, u16 pcifunc, in rvu_npc_get_mcam_counter_alloc_info() argument
1257 struct npc_mcam *mcam = &rvu->hw->mcam; in rvu_npc_get_mcam_counter_alloc_info()
1302 static void npc_map_mcam_entry_and_cntr(struct rvu *rvu, struct npc_mcam *mcam, in npc_map_mcam_entry_and_cntr() argument
1312 rvu_write64(rvu, blkaddr, in npc_map_mcam_entry_and_cntr()
1317 static void npc_unmap_mcam_entry_and_cntr(struct rvu *rvu, in npc_unmap_mcam_entry_and_cntr() argument
1328 rvu_write64(rvu, blkaddr, in npc_unmap_mcam_entry_and_cntr()
1364 static void npc_mcam_free_all_entries(struct rvu *rvu, struct npc_mcam *mcam, in npc_mcam_free_all_entries() argument
1376 npc_enable_mcam_entry(rvu, mcam, blkaddr, index, false); in npc_mcam_free_all_entries()
1381 npc_unmap_mcam_entry_and_cntr(rvu, mcam, in npc_mcam_free_all_entries()
1388 static void npc_mcam_free_all_counters(struct rvu *rvu, struct npc_mcam *mcam, in npc_mcam_free_all_counters() argument
1703 int rvu_mbox_handler_npc_mcam_alloc_entry(struct rvu *rvu, in rvu_mbox_handler_npc_mcam_alloc_entry() argument
1707 struct npc_mcam *mcam = &rvu->hw->mcam; in rvu_mbox_handler_npc_mcam_alloc_entry()
1711 blkaddr = rvu_get_blkaddr(rvu, BLKTYPE_NPC, 0); in rvu_mbox_handler_npc_mcam_alloc_entry()
1737 if (!is_nixlf_attached(rvu, pcifunc)) in rvu_mbox_handler_npc_mcam_alloc_entry()
1743 int rvu_mbox_handler_npc_mcam_free_entry(struct rvu *rvu, in rvu_mbox_handler_npc_mcam_free_entry() argument
1747 struct npc_mcam *mcam = &rvu->hw->mcam; in rvu_mbox_handler_npc_mcam_free_entry()
1752 blkaddr = rvu_get_blkaddr(rvu, BLKTYPE_NPC, 0); in rvu_mbox_handler_npc_mcam_free_entry()
1757 if (!is_nixlf_attached(rvu, pcifunc)) in rvu_mbox_handler_npc_mcam_free_entry()
1771 npc_enable_mcam_entry(rvu, mcam, blkaddr, req->entry, false); in rvu_mbox_handler_npc_mcam_free_entry()
1776 npc_unmap_mcam_entry_and_cntr(rvu, mcam, blkaddr, in rvu_mbox_handler_npc_mcam_free_entry()
1783 npc_mcam_free_all_entries(rvu, mcam, blkaddr, pcifunc); in rvu_mbox_handler_npc_mcam_free_entry()
1789 int rvu_mbox_handler_npc_mcam_write_entry(struct rvu *rvu, in rvu_mbox_handler_npc_mcam_write_entry() argument
1793 struct npc_mcam *mcam = &rvu->hw->mcam; in rvu_mbox_handler_npc_mcam_write_entry()
1797 blkaddr = rvu_get_blkaddr(rvu, BLKTYPE_NPC, 0); in rvu_mbox_handler_npc_mcam_write_entry()
1817 npc_config_mcam_entry(rvu, mcam, blkaddr, req->entry, req->intf, in rvu_mbox_handler_npc_mcam_write_entry()
1821 npc_map_mcam_entry_and_cntr(rvu, mcam, blkaddr, in rvu_mbox_handler_npc_mcam_write_entry()
1830 int rvu_mbox_handler_npc_mcam_ena_entry(struct rvu *rvu, in rvu_mbox_handler_npc_mcam_ena_entry() argument
1834 struct npc_mcam *mcam = &rvu->hw->mcam; in rvu_mbox_handler_npc_mcam_ena_entry()
1838 blkaddr = rvu_get_blkaddr(rvu, BLKTYPE_NPC, 0); in rvu_mbox_handler_npc_mcam_ena_entry()
1848 npc_enable_mcam_entry(rvu, mcam, blkaddr, req->entry, true); in rvu_mbox_handler_npc_mcam_ena_entry()
1853 int rvu_mbox_handler_npc_mcam_dis_entry(struct rvu *rvu, in rvu_mbox_handler_npc_mcam_dis_entry() argument
1857 struct npc_mcam *mcam = &rvu->hw->mcam; in rvu_mbox_handler_npc_mcam_dis_entry()
1861 blkaddr = rvu_get_blkaddr(rvu, BLKTYPE_NPC, 0); in rvu_mbox_handler_npc_mcam_dis_entry()
1871 npc_enable_mcam_entry(rvu, mcam, blkaddr, req->entry, false); in rvu_mbox_handler_npc_mcam_dis_entry()
1876 int rvu_mbox_handler_npc_mcam_shift_entry(struct rvu *rvu, in rvu_mbox_handler_npc_mcam_shift_entry() argument
1880 struct npc_mcam *mcam = &rvu->hw->mcam; in rvu_mbox_handler_npc_mcam_shift_entry()
1886 blkaddr = rvu_get_blkaddr(rvu, BLKTYPE_NPC, 0); in rvu_mbox_handler_npc_mcam_shift_entry()
1916 npc_enable_mcam_entry(rvu, mcam, blkaddr, new_entry, false); in rvu_mbox_handler_npc_mcam_shift_entry()
1919 npc_copy_mcam_entry(rvu, mcam, blkaddr, old_entry, new_entry); in rvu_mbox_handler_npc_mcam_shift_entry()
1924 npc_unmap_mcam_entry_and_cntr(rvu, mcam, blkaddr, in rvu_mbox_handler_npc_mcam_shift_entry()
1926 npc_map_mcam_entry_and_cntr(rvu, mcam, blkaddr, in rvu_mbox_handler_npc_mcam_shift_entry()
1931 npc_enable_mcam_entry(rvu, mcam, blkaddr, new_entry, true); in rvu_mbox_handler_npc_mcam_shift_entry()
1932 npc_enable_mcam_entry(rvu, mcam, blkaddr, old_entry, false); in rvu_mbox_handler_npc_mcam_shift_entry()
1945 int rvu_mbox_handler_npc_mcam_alloc_counter(struct rvu *rvu, in rvu_mbox_handler_npc_mcam_alloc_counter() argument
1949 struct npc_mcam *mcam = &rvu->hw->mcam; in rvu_mbox_handler_npc_mcam_alloc_counter()
1954 blkaddr = rvu_get_blkaddr(rvu, BLKTYPE_NPC, 0); in rvu_mbox_handler_npc_mcam_alloc_counter()
1959 if (!is_nixlf_attached(rvu, pcifunc)) in rvu_mbox_handler_npc_mcam_alloc_counter()
2009 int rvu_mbox_handler_npc_mcam_free_counter(struct rvu *rvu, in rvu_mbox_handler_npc_mcam_free_counter() argument
2012 struct npc_mcam *mcam = &rvu->hw->mcam; in rvu_mbox_handler_npc_mcam_free_counter()
2016 blkaddr = rvu_get_blkaddr(rvu, BLKTYPE_NPC, 0); in rvu_mbox_handler_npc_mcam_free_counter()
2043 npc_unmap_mcam_entry_and_cntr(rvu, mcam, blkaddr, in rvu_mbox_handler_npc_mcam_free_counter()
2051 int rvu_mbox_handler_npc_mcam_unmap_counter(struct rvu *rvu, in rvu_mbox_handler_npc_mcam_unmap_counter() argument
2054 struct npc_mcam *mcam = &rvu->hw->mcam; in rvu_mbox_handler_npc_mcam_unmap_counter()
2058 blkaddr = rvu_get_blkaddr(rvu, BLKTYPE_NPC, 0); in rvu_mbox_handler_npc_mcam_unmap_counter()
2072 npc_unmap_mcam_entry_and_cntr(rvu, mcam, blkaddr, in rvu_mbox_handler_npc_mcam_unmap_counter()
2090 npc_unmap_mcam_entry_and_cntr(rvu, mcam, blkaddr, in rvu_mbox_handler_npc_mcam_unmap_counter()
2098 int rvu_mbox_handler_npc_mcam_clear_counter(struct rvu *rvu, in rvu_mbox_handler_npc_mcam_clear_counter() argument
2101 struct npc_mcam *mcam = &rvu->hw->mcam; in rvu_mbox_handler_npc_mcam_clear_counter()
2104 blkaddr = rvu_get_blkaddr(rvu, BLKTYPE_NPC, 0); in rvu_mbox_handler_npc_mcam_clear_counter()
2114 rvu_write64(rvu, blkaddr, NPC_AF_MATCH_STATX(req->cntr), 0x00); in rvu_mbox_handler_npc_mcam_clear_counter()
2119 int rvu_mbox_handler_npc_mcam_counter_stats(struct rvu *rvu, in rvu_mbox_handler_npc_mcam_counter_stats() argument
2123 struct npc_mcam *mcam = &rvu->hw->mcam; in rvu_mbox_handler_npc_mcam_counter_stats()
2126 blkaddr = rvu_get_blkaddr(rvu, BLKTYPE_NPC, 0); in rvu_mbox_handler_npc_mcam_counter_stats()
2136 rsp->stat = rvu_read64(rvu, blkaddr, NPC_AF_MATCH_STATX(req->cntr)); in rvu_mbox_handler_npc_mcam_counter_stats()
2142 int rvu_mbox_handler_npc_mcam_alloc_and_write_entry(struct rvu *rvu, in rvu_mbox_handler_npc_mcam_alloc_and_write_entry() argument
2150 struct npc_mcam *mcam = &rvu->hw->mcam; in rvu_mbox_handler_npc_mcam_alloc_and_write_entry()
2155 blkaddr = rvu_get_blkaddr(rvu, BLKTYPE_NPC, 0); in rvu_mbox_handler_npc_mcam_alloc_and_write_entry()
2169 rc = rvu_mbox_handler_npc_mcam_alloc_entry(rvu, in rvu_mbox_handler_npc_mcam_alloc_and_write_entry()
2187 rc = rvu_mbox_handler_npc_mcam_alloc_counter(rvu, &cntr_req, &cntr_rsp); in rvu_mbox_handler_npc_mcam_alloc_and_write_entry()
2201 npc_config_mcam_entry(rvu, mcam, blkaddr, entry, req->intf, in rvu_mbox_handler_npc_mcam_alloc_and_write_entry()
2205 npc_map_mcam_entry_and_cntr(rvu, mcam, blkaddr, entry, cntr); in rvu_mbox_handler_npc_mcam_alloc_and_write_entry()
2215 rvu_read64(rvu, BLKADDR_NPC, NPC_AF_INTFX_KEX_CFG(intf))
2218 rvu_read64(rvu, BLKADDR_NPC, NPC_AF_KEX_LDATAX_FLAGS_CFG(ld))
2221 rvu_read64(rvu, BLKADDR_NPC, \
2225 rvu_read64(rvu, BLKADDR_NPC, \
2228 int rvu_mbox_handler_npc_get_kex_cfg(struct rvu *rvu, struct msg_req *req, in rvu_mbox_handler_npc_get_kex_cfg() argument
2256 memcpy(rsp->mkex_pfl_name, rvu->mkex_pfl_name, MKEX_NAME_LEN); in rvu_mbox_handler_npc_get_kex_cfg()
2260 int rvu_npc_update_rxvlan(struct rvu *rvu, u16 pcifunc, int nixlf) in rvu_npc_update_rxvlan() argument
2262 struct rvu_pfvf *pfvf = rvu_get_pfvf(rvu, pcifunc); in rvu_npc_update_rxvlan()
2263 struct npc_mcam *mcam = &rvu->hw->mcam; in rvu_npc_update_rxvlan()
2267 blkaddr = rvu_get_blkaddr(rvu, BLKTYPE_NPC, 0); in rvu_npc_update_rxvlan()
2276 pfvf->entry.action = npc_get_mcam_action(rvu, mcam, blkaddr, index); in rvu_npc_update_rxvlan()
2277 enable = is_mcam_entry_enabled(rvu, mcam, blkaddr, index); in rvu_npc_update_rxvlan()
2278 npc_config_mcam_entry(rvu, mcam, blkaddr, pfvf->rxvlan_index, in rvu_npc_update_rxvlan()