Lines Matching refs:pcifunc
32 int blkaddr, u16 pcifunc);
34 u16 pcifunc);
65 u16 pcifunc) in npc_mcam_verify_pf_func() argument
79 (pcifunc & ~RVU_PFVF_FUNC_MASK))) in npc_mcam_verify_pf_func()
115 int npc_config_ts_kpuaction(struct rvu *rvu, int pf, u16 pcifunc, bool enable) in npc_config_ts_kpuaction() argument
126 blkaddr = rvu_get_blkaddr(rvu, BLKTYPE_NPC, pcifunc); in npc_config_ts_kpuaction()
143 static int npc_get_ucast_mcam_index(struct npc_mcam *mcam, u16 pcifunc, in npc_get_ucast_mcam_index() argument
152 pfvf = rvu_get_pfvf(rvu, pcifunc); in npc_get_ucast_mcam_index()
169 u16 pcifunc, int nixlf, int type) in npc_get_nixlf_mcam_index() argument
171 int pf = rvu_get_pf(pcifunc); in npc_get_nixlf_mcam_index()
175 if (pf && !(pcifunc & RVU_PFVF_FUNC_MASK)) { in npc_get_nixlf_mcam_index()
190 return npc_get_ucast_mcam_index(mcam, pcifunc, nixlf); in npc_get_nixlf_mcam_index()
611 void rvu_npc_install_ucast_entry(struct rvu *rvu, u16 pcifunc, in rvu_npc_install_ucast_entry() argument
614 struct rvu_pfvf *pfvf = rvu_get_pfvf(rvu, pcifunc); in rvu_npc_install_ucast_entry()
622 if (is_afvf(pcifunc) || is_sdp_vf(pcifunc)) in rvu_npc_install_ucast_entry()
629 index = npc_get_nixlf_mcam_index(mcam, pcifunc, in rvu_npc_install_ucast_entry()
640 action.pf_func = pcifunc; in rvu_npc_install_ucast_entry()
651 req.hdr.pcifunc = 0; /* AF is requester */ in rvu_npc_install_ucast_entry()
660 void rvu_npc_install_promisc_entry(struct rvu *rvu, u16 pcifunc, in rvu_npc_install_promisc_entry() argument
663 struct rvu_pfvf *pfvf = rvu_get_pfvf(rvu, pcifunc); in rvu_npc_install_promisc_entry()
673 if (!hw->cap.nix_rx_multicast && is_cgx_vf(rvu, pcifunc)) in rvu_npc_install_promisc_entry()
680 index = npc_get_nixlf_mcam_index(mcam, pcifunc, in rvu_npc_install_promisc_entry()
683 if (is_cgx_vf(rvu, pcifunc)) in rvu_npc_install_promisc_entry()
685 pcifunc & ~RVU_PFVF_FUNC_MASK, in rvu_npc_install_promisc_entry()
691 ucast_idx = npc_get_nixlf_mcam_index(mcam, pcifunc, in rvu_npc_install_promisc_entry()
706 is_pf_cgxmapped(rvu, rvu_get_pf(pcifunc))) { in rvu_npc_install_promisc_entry()
709 pfvf = rvu_get_pfvf(rvu, pcifunc & ~RVU_PFVF_FUNC_MASK); in rvu_npc_install_promisc_entry()
739 req.hdr.pcifunc = 0; /* AF is requester */ in rvu_npc_install_promisc_entry()
740 req.vf = pcifunc; in rvu_npc_install_promisc_entry()
748 void rvu_npc_enable_promisc_entry(struct rvu *rvu, u16 pcifunc, in rvu_npc_enable_promisc_entry() argument
759 pcifunc = pcifunc & ~RVU_PFVF_FUNC_MASK; in rvu_npc_enable_promisc_entry()
761 index = npc_get_nixlf_mcam_index(mcam, pcifunc, in rvu_npc_enable_promisc_entry()
766 void rvu_npc_install_bcast_match_entry(struct rvu *rvu, u16 pcifunc, in rvu_npc_install_bcast_match_entry() argument
781 if (is_afvf(pcifunc)) in rvu_npc_install_bcast_match_entry()
787 if (!hw->cap.nix_rx_multicast && is_vf(pcifunc)) in rvu_npc_install_bcast_match_entry()
791 pcifunc = pcifunc & ~RVU_PFVF_FUNC_MASK; in rvu_npc_install_bcast_match_entry()
792 pfvf = rvu_get_pfvf(rvu, pcifunc); in rvu_npc_install_bcast_match_entry()
793 index = npc_get_nixlf_mcam_index(mcam, pcifunc, in rvu_npc_install_bcast_match_entry()
814 req.hdr.pcifunc = 0; /* AF is requester */ in rvu_npc_install_bcast_match_entry()
815 req.vf = pcifunc; in rvu_npc_install_bcast_match_entry()
820 void rvu_npc_enable_bcast_entry(struct rvu *rvu, u16 pcifunc, int nixlf, in rvu_npc_enable_bcast_entry() argument
831 pcifunc = pcifunc & ~RVU_PFVF_FUNC_MASK; in rvu_npc_enable_bcast_entry()
833 index = npc_get_nixlf_mcam_index(mcam, pcifunc, nixlf, in rvu_npc_enable_bcast_entry()
838 void rvu_npc_install_allmulti_entry(struct rvu *rvu, u16 pcifunc, int nixlf, in rvu_npc_install_allmulti_entry() argument
853 if (is_afvf(pcifunc) && is_sdp_vf(pcifunc)) in rvu_npc_install_allmulti_entry()
861 vf_func = pcifunc & RVU_PFVF_FUNC_MASK; in rvu_npc_install_allmulti_entry()
862 pcifunc = pcifunc & ~RVU_PFVF_FUNC_MASK; in rvu_npc_install_allmulti_entry()
863 pfvf = rvu_get_pfvf(rvu, pcifunc); in rvu_npc_install_allmulti_entry()
864 index = npc_get_nixlf_mcam_index(mcam, pcifunc, in rvu_npc_install_allmulti_entry()
870 ucast_idx = npc_get_nixlf_mcam_index(mcam, pcifunc, in rvu_npc_install_allmulti_entry()
880 action.pf_func = pcifunc; in rvu_npc_install_allmulti_entry()
909 req.hdr.pcifunc = 0; /* AF is requester */ in rvu_npc_install_allmulti_entry()
910 req.vf = pcifunc | vf_func; in rvu_npc_install_allmulti_entry()
918 void rvu_npc_enable_allmulti_entry(struct rvu *rvu, u16 pcifunc, int nixlf, in rvu_npc_enable_allmulti_entry() argument
929 pcifunc = pcifunc & ~RVU_PFVF_FUNC_MASK; in rvu_npc_enable_allmulti_entry()
931 index = npc_get_nixlf_mcam_index(mcam, pcifunc, nixlf, in rvu_npc_enable_allmulti_entry()
937 int blkaddr, u16 pcifunc, u64 rx_action) in npc_update_vf_flow_entry() argument
943 if (!(pcifunc & RVU_PFVF_FUNC_MASK)) in npc_update_vf_flow_entry()
948 if (mcam->entry2target_pffunc[index] == pcifunc) { in npc_update_vf_flow_entry()
1007 void rvu_npc_update_flowkey_alg_idx(struct rvu *rvu, u16 pcifunc, int nixlf, in rvu_npc_update_flowkey_alg_idx() argument
1023 index = npc_get_nixlf_mcam_index(mcam, pcifunc, in rvu_npc_update_flowkey_alg_idx()
1043 action.pf_func = pcifunc; in rvu_npc_update_flowkey_alg_idx()
1052 npc_update_vf_flow_entry(rvu, mcam, blkaddr, pcifunc, in rvu_npc_update_flowkey_alg_idx()
1056 pfvf = rvu_get_pfvf(rvu, pcifunc); in rvu_npc_update_flowkey_alg_idx()
1060 index = npc_get_nixlf_mcam_index(mcam, pcifunc, in rvu_npc_update_flowkey_alg_idx()
1069 index = npc_get_nixlf_mcam_index(mcam, pcifunc, in rvu_npc_update_flowkey_alg_idx()
1078 void npc_enadis_default_mce_entry(struct rvu *rvu, u16 pcifunc, in npc_enadis_default_mce_entry() argument
1091 index = npc_get_nixlf_mcam_index(mcam, pcifunc & ~RVU_PFVF_FUNC_MASK, in npc_enadis_default_mce_entry()
1095 if (!hw->cap.nix_rx_multicast && !is_vf(pcifunc)) { in npc_enadis_default_mce_entry()
1101 pfvf = rvu_get_pfvf(rvu, pcifunc & ~RVU_PFVF_FUNC_MASK); in npc_enadis_default_mce_entry()
1102 if (hw->cap.nix_rx_multicast && is_vf(pcifunc) && in npc_enadis_default_mce_entry()
1106 nix_get_mce_list(rvu, pcifunc, type, &mce_list, &mce_idx); in npc_enadis_default_mce_entry()
1108 nix_update_mce_list(rvu, pcifunc, mce_list, in npc_enadis_default_mce_entry()
1114 static void npc_enadis_default_entries(struct rvu *rvu, u16 pcifunc, in npc_enadis_default_entries() argument
1125 index = npc_get_nixlf_mcam_index(mcam, pcifunc, in npc_enadis_default_entries()
1132 if ((pcifunc & RVU_PFVF_FUNC_MASK) && !rvu->hw->cap.nix_rx_multicast) in npc_enadis_default_entries()
1136 npc_enadis_default_mce_entry(rvu, pcifunc, nixlf, in npc_enadis_default_entries()
1140 void rvu_npc_disable_default_entries(struct rvu *rvu, u16 pcifunc, int nixlf) in rvu_npc_disable_default_entries() argument
1145 npc_enadis_default_entries(rvu, pcifunc, nixlf, false); in rvu_npc_disable_default_entries()
1148 npc_enadis_default_mce_entry(rvu, pcifunc, nixlf, in rvu_npc_disable_default_entries()
1150 npc_enadis_default_mce_entry(rvu, pcifunc, nixlf, in rvu_npc_disable_default_entries()
1154 void rvu_npc_enable_default_entries(struct rvu *rvu, u16 pcifunc, int nixlf) in rvu_npc_enable_default_entries() argument
1162 npc_enadis_default_entries(rvu, pcifunc, nixlf, true); in rvu_npc_enable_default_entries()
1165 void rvu_npc_disable_mcam_entries(struct rvu *rvu, u16 pcifunc, int nixlf) in rvu_npc_disable_mcam_entries() argument
1167 struct rvu_pfvf *pfvf = rvu_get_pfvf(rvu, pcifunc); in rvu_npc_disable_mcam_entries()
1181 rule->rx_action.pf_func == pcifunc && in rvu_npc_disable_mcam_entries()
1197 npc_mcam_disable_flows(rvu, pcifunc); in rvu_npc_disable_mcam_entries()
1199 rvu_npc_disable_default_entries(rvu, pcifunc, nixlf); in rvu_npc_disable_mcam_entries()
1202 void rvu_npc_free_mcam_entries(struct rvu *rvu, u16 pcifunc, int nixlf) in rvu_npc_free_mcam_entries() argument
1215 npc_mcam_free_all_entries(rvu, mcam, blkaddr, pcifunc); in rvu_npc_free_mcam_entries()
1218 npc_mcam_free_all_counters(rvu, mcam, pcifunc); in rvu_npc_free_mcam_entries()
1222 if (rule->owner == pcifunc && !rule->default_rule) { in rvu_npc_free_mcam_entries()
1230 rvu_npc_disable_default_entries(rvu, pcifunc, nixlf); in rvu_npc_free_mcam_entries()
2131 void rvu_npc_get_mcam_entry_alloc_info(struct rvu *rvu, u16 pcifunc, in rvu_npc_get_mcam_entry_alloc_info() argument
2142 if (mcam->entry2pfvf_map[entry] == pcifunc) { in rvu_npc_get_mcam_entry_alloc_info()
2150 void rvu_npc_get_mcam_counter_alloc_info(struct rvu *rvu, u16 pcifunc, in rvu_npc_get_mcam_counter_alloc_info() argument
2161 if (mcam->cntr2pfvf_map[cntr] == pcifunc) { in rvu_npc_get_mcam_counter_alloc_info()
2170 u16 pcifunc, int entry) in npc_mcam_verify_entry() argument
2173 if (is_pffunc_af(pcifunc)) in npc_mcam_verify_entry()
2181 if (pcifunc != mcam->entry2pfvf_map[entry]) in npc_mcam_verify_entry()
2188 u16 pcifunc, int cntr) in npc_mcam_verify_counter() argument
2196 if (pcifunc != mcam->cntr2pfvf_map[cntr]) in npc_mcam_verify_counter()
2266 int blkaddr, u16 pcifunc) in npc_mcam_free_all_entries() argument
2272 if (mcam->entry2pfvf_map[index] == pcifunc) { in npc_mcam_free_all_entries()
2291 u16 pcifunc) in npc_mcam_free_all_counters() argument
2297 if (mcam->cntr2pfvf_map[cntr] == pcifunc) { in npc_mcam_free_all_counters()
2428 static int npc_mcam_alloc_entries(struct npc_mcam *mcam, u16 pcifunc, in npc_mcam_alloc_entries() argument
2479 if (!(pcifunc & RVU_PFVF_FUNC_MASK)) in npc_mcam_alloc_entries()
2606 mcam->entry2pfvf_map[index] = pcifunc; in npc_mcam_alloc_entries()
2622 u16 pcifunc = req->hdr.pcifunc; in rvu_mbox_handler_npc_mcam_alloc_entry() local
2657 if (!is_pffunc_af(pcifunc) && !is_nixlf_attached(rvu, pcifunc)) in rvu_mbox_handler_npc_mcam_alloc_entry()
2660 return npc_mcam_alloc_entries(mcam, pcifunc, req, rsp); in rvu_mbox_handler_npc_mcam_alloc_entry()
2668 u16 pcifunc = req->hdr.pcifunc; in rvu_mbox_handler_npc_mcam_free_entry() local
2677 if (!is_pffunc_af(pcifunc) && !is_nixlf_attached(rvu, pcifunc)) in rvu_mbox_handler_npc_mcam_free_entry()
2685 rc = npc_mcam_verify_entry(mcam, pcifunc, req->entry); in rvu_mbox_handler_npc_mcam_free_entry()
2704 npc_mcam_free_all_entries(rvu, mcam, blkaddr, pcifunc); in rvu_mbox_handler_npc_mcam_free_entry()
2715 u16 pcifunc = req->hdr.pcifunc; in rvu_mbox_handler_npc_mcam_read_entry() local
2723 rc = npc_mcam_verify_entry(mcam, pcifunc, req->entry); in rvu_mbox_handler_npc_mcam_read_entry()
2738 struct rvu_pfvf *pfvf = rvu_get_pfvf(rvu, req->hdr.pcifunc); in rvu_mbox_handler_npc_mcam_write_entry()
2740 u16 pcifunc = req->hdr.pcifunc; in rvu_mbox_handler_npc_mcam_write_entry() local
2749 rc = npc_mcam_verify_entry(mcam, pcifunc, req->entry); in rvu_mbox_handler_npc_mcam_write_entry()
2754 npc_mcam_verify_counter(mcam, pcifunc, req->cntr)) { in rvu_mbox_handler_npc_mcam_write_entry()
2769 if (!is_pffunc_af(pcifunc) && in rvu_mbox_handler_npc_mcam_write_entry()
2770 npc_mcam_verify_pf_func(rvu, &req->entry_data, req->intf, pcifunc)) { in rvu_mbox_handler_npc_mcam_write_entry()
2776 if (is_pffunc_af(req->hdr.pcifunc)) in rvu_mbox_handler_npc_mcam_write_entry()
2797 u16 pcifunc = req->hdr.pcifunc; in rvu_mbox_handler_npc_mcam_ena_entry() local
2805 rc = npc_mcam_verify_entry(mcam, pcifunc, req->entry); in rvu_mbox_handler_npc_mcam_ena_entry()
2820 u16 pcifunc = req->hdr.pcifunc; in rvu_mbox_handler_npc_mcam_dis_entry() local
2828 rc = npc_mcam_verify_entry(mcam, pcifunc, req->entry); in rvu_mbox_handler_npc_mcam_dis_entry()
2843 u16 pcifunc = req->hdr.pcifunc; in rvu_mbox_handler_npc_mcam_shift_entry() local
2863 rc = npc_mcam_verify_entry(mcam, pcifunc, old_entry); in rvu_mbox_handler_npc_mcam_shift_entry()
2867 rc = npc_mcam_verify_entry(mcam, pcifunc, new_entry); in rvu_mbox_handler_npc_mcam_shift_entry()
2912 u16 pcifunc = req->hdr.pcifunc; in rvu_mbox_handler_npc_mcam_alloc_counter() local
2921 if (!is_pffunc_af(pcifunc) && !is_nixlf_attached(rvu, pcifunc)) in rvu_mbox_handler_npc_mcam_alloc_counter()
2951 mcam->cntr2pfvf_map[cntr] = pcifunc; in rvu_mbox_handler_npc_mcam_alloc_counter()
2963 mcam->cntr2pfvf_map[index] = pcifunc; in rvu_mbox_handler_npc_mcam_alloc_counter()
2983 err = npc_mcam_verify_counter(mcam, req->hdr.pcifunc, req->cntr); in rvu_mbox_handler_npc_mcam_free_counter()
3025 rc = npc_mcam_verify_counter(mcam, req->hdr.pcifunc, req->cntr); in rvu_mbox_handler_npc_mcam_unmap_counter()
3031 rc = npc_mcam_verify_entry(mcam, req->hdr.pcifunc, req->entry); in rvu_mbox_handler_npc_mcam_unmap_counter()
3071 err = npc_mcam_verify_counter(mcam, req->hdr.pcifunc, req->cntr); in rvu_mbox_handler_npc_mcam_clear_counter()
3093 err = npc_mcam_verify_counter(mcam, req->hdr.pcifunc, req->cntr); in rvu_mbox_handler_npc_mcam_counter_stats()
3108 struct rvu_pfvf *pfvf = rvu_get_pfvf(rvu, req->hdr.pcifunc); in rvu_mbox_handler_npc_mcam_alloc_and_write_entry()
3127 req->hdr.pcifunc)) in rvu_mbox_handler_npc_mcam_alloc_and_write_entry()
3131 entry_req.hdr.pcifunc = req->hdr.pcifunc; in rvu_mbox_handler_npc_mcam_alloc_and_write_entry()
3151 cntr_req.hdr.pcifunc = req->hdr.pcifunc; in rvu_mbox_handler_npc_mcam_alloc_and_write_entry()
3235 npc_set_var_len_offset_pkind(struct rvu *rvu, u16 pcifunc, u64 pkind, in npc_set_var_len_offset_pkind() argument
3252 blkaddr = rvu_get_blkaddr(rvu, BLKTYPE_NPC, pcifunc); in npc_set_var_len_offset_pkind()
3267 int rvu_npc_set_parse_mode(struct rvu *rvu, u16 pcifunc, u64 mode, u8 dir, in rvu_npc_set_parse_mode() argument
3272 struct rvu_pfvf *pfvf = rvu_get_pfvf(rvu, pcifunc); in rvu_npc_set_parse_mode()
3274 int pf = rvu_get_pf(pcifunc); in rvu_npc_set_parse_mode()
3285 rc = npc_set_var_len_offset_pkind(rvu, pcifunc, pkind, in rvu_npc_set_parse_mode()
3298 if (!is_cgx_config_permitted(rvu, pcifunc)) in rvu_npc_set_parse_mode()
3310 rc = nix_get_nixlf(rvu, pcifunc, &nixlf, &blkaddr); in rvu_npc_set_parse_mode()
3325 return rvu_npc_set_parse_mode(rvu, req->hdr.pcifunc, req->mode, in rvu_mbox_handler_npc_set_pkind()
3336 u16 pcifunc = req->hdr.pcifunc; in rvu_mbox_handler_npc_read_base_steer_rule() local
3345 if (!(pcifunc & RVU_PFVF_FUNC_MASK)) { in rvu_mbox_handler_npc_read_base_steer_rule()
3346 pfvf = rvu_get_pfvf(rvu, pcifunc); in rvu_mbox_handler_npc_read_base_steer_rule()
3355 if (mcam->entry2target_pffunc[index] == pcifunc) in rvu_mbox_handler_npc_read_base_steer_rule()
3359 rc = nix_get_nixlf(rvu, pcifunc, &nixlf, NULL); in rvu_mbox_handler_npc_read_base_steer_rule()
3365 index = npc_get_nixlf_mcam_index(mcam, pcifunc, nixlf, in rvu_mbox_handler_npc_read_base_steer_rule()