Lines Matching refs:blk
119 static u32 ice_sect_id(enum ice_block blk, enum ice_sect sect) in ice_sect_id() argument
121 return ice_sect_lkup[blk][sect]; in ice_sect_id()
703 ice_find_prot_off(struct ice_hw *hw, enum ice_block blk, u8 prof, u16 fv_idx, in ice_find_prot_off() argument
708 if (prof >= hw->blk[blk].es.count) in ice_find_prot_off()
711 if (fv_idx >= hw->blk[blk].es.fvw) in ice_find_prot_off()
714 fv_ext = hw->blk[blk].es.t + (prof * hw->blk[blk].es.fvw); in ice_find_prot_off()
732 int ice_ptg_update_xlt1(struct ice_hw *hw, enum ice_block blk) in ice_ptg_update_xlt1() argument
739 bld = ice_pkg_buf_alloc_single_section(hw, ice_sect_id(blk, ICE_XLT1), in ice_ptg_update_xlt1()
749 sect->value[index] = hw->blk[blk].xlt1.ptypes[index].ptg; in ice_ptg_update_xlt1()
770 ice_ptg_find_ptype(struct ice_hw *hw, enum ice_block blk, u16 ptype, u8 *ptg) in ice_ptg_find_ptype() argument
775 *ptg = hw->blk[blk].xlt1.ptypes[ptype].ptg; in ice_ptg_find_ptype()
788 static void ice_ptg_alloc_val(struct ice_hw *hw, enum ice_block blk, u8 ptg) in ice_ptg_alloc_val() argument
790 hw->blk[blk].xlt1.ptg_tbl[ptg].in_use = true; in ice_ptg_alloc_val()
802 void ice_ptg_free(struct ice_hw *hw, enum ice_block blk, u8 ptg) in ice_ptg_free() argument
806 hw->blk[blk].xlt1.ptg_tbl[ptg].in_use = false; in ice_ptg_free()
807 p = hw->blk[blk].xlt1.ptg_tbl[ptg].first_ptype; in ice_ptg_free()
815 hw->blk[blk].xlt1.ptg_tbl[ptg].first_ptype = NULL; in ice_ptg_free()
829 ice_ptg_remove_ptype(struct ice_hw *hw, enum ice_block blk, u16 ptype, u8 ptg) in ice_ptg_remove_ptype() argument
837 if (!hw->blk[blk].xlt1.ptg_tbl[ptg].in_use) in ice_ptg_remove_ptype()
841 if (!hw->blk[blk].xlt1.ptg_tbl[ptg].first_ptype) in ice_ptg_remove_ptype()
845 p = hw->blk[blk].xlt1.ptg_tbl[ptg].first_ptype; in ice_ptg_remove_ptype()
846 ch = &hw->blk[blk].xlt1.ptg_tbl[ptg].first_ptype; in ice_ptg_remove_ptype()
848 if (ptype == (p - hw->blk[blk].xlt1.ptypes)) { in ice_ptg_remove_ptype()
857 hw->blk[blk].xlt1.ptypes[ptype].ptg = ICE_DEFAULT_PTG; in ice_ptg_remove_ptype()
858 hw->blk[blk].xlt1.ptypes[ptype].next_ptype = NULL; in ice_ptg_remove_ptype()
876 ice_ptg_add_mv_ptype(struct ice_hw *hw, enum ice_block blk, u16 ptype, u8 ptg) in ice_ptg_add_mv_ptype() argument
884 if (!hw->blk[blk].xlt1.ptg_tbl[ptg].in_use && ptg != ICE_DEFAULT_PTG) in ice_ptg_add_mv_ptype()
887 status = ice_ptg_find_ptype(hw, blk, ptype, &original_ptg); in ice_ptg_add_mv_ptype()
897 ice_ptg_remove_ptype(hw, blk, ptype, original_ptg); in ice_ptg_add_mv_ptype()
904 hw->blk[blk].xlt1.ptypes[ptype].next_ptype = in ice_ptg_add_mv_ptype()
905 hw->blk[blk].xlt1.ptg_tbl[ptg].first_ptype; in ice_ptg_add_mv_ptype()
906 hw->blk[blk].xlt1.ptg_tbl[ptg].first_ptype = in ice_ptg_add_mv_ptype()
907 &hw->blk[blk].xlt1.ptypes[ptype]; in ice_ptg_add_mv_ptype()
909 hw->blk[blk].xlt1.ptypes[ptype].ptg = ptg; in ice_ptg_add_mv_ptype()
910 hw->blk[blk].xlt1.t[ptype] = ptg; in ice_ptg_add_mv_ptype()
1020 ice_vsig_update_xlt2_sect(struct ice_hw *hw, enum ice_block blk, u16 vsi, in ice_vsig_update_xlt2_sect() argument
1027 bld = ice_pkg_buf_alloc_single_section(hw, ice_sect_id(blk, ICE_XLT2), in ice_vsig_update_xlt2_sect()
1052 int ice_vsig_update_xlt2(struct ice_hw *hw, enum ice_block blk) in ice_vsig_update_xlt2() argument
1058 if (hw->blk[blk].xlt2.vsis[vsi].changed) { in ice_vsig_update_xlt2()
1062 vsig = hw->blk[blk].xlt2.vsis[vsi].vsig; in ice_vsig_update_xlt2()
1063 status = ice_vsig_update_xlt2_sect(hw, blk, vsi, vsig); in ice_vsig_update_xlt2()
1067 hw->blk[blk].xlt2.vsis[vsi].changed = 0; in ice_vsig_update_xlt2()
1085 ice_vsig_find_vsi(struct ice_hw *hw, enum ice_block blk, u16 vsi, u16 *vsig) in ice_vsig_find_vsi() argument
1094 *vsig = hw->blk[blk].xlt2.vsis[vsi].vsig; in ice_vsig_find_vsi()
1107 static u16 ice_vsig_alloc_val(struct ice_hw *hw, enum ice_block blk, u16 vsig) in ice_vsig_alloc_val() argument
1111 if (!hw->blk[blk].xlt2.vsig_tbl[idx].in_use) { in ice_vsig_alloc_val()
1112 INIT_LIST_HEAD(&hw->blk[blk].xlt2.vsig_tbl[idx].prop_lst); in ice_vsig_alloc_val()
1113 hw->blk[blk].xlt2.vsig_tbl[idx].in_use = true; in ice_vsig_alloc_val()
1127 static u16 ice_vsig_alloc(struct ice_hw *hw, enum ice_block blk) in ice_vsig_alloc() argument
1132 if (!hw->blk[blk].xlt2.vsig_tbl[i].in_use) in ice_vsig_alloc()
1133 return ice_vsig_alloc_val(hw, blk, i); in ice_vsig_alloc()
1154 ice_find_dup_props_vsig(struct ice_hw *hw, enum ice_block blk, in ice_find_dup_props_vsig() argument
1157 struct ice_xlt2 *xlt2 = &hw->blk[blk].xlt2; in ice_find_dup_props_vsig()
1180 ice_vsig_free(struct ice_hw *hw, enum ice_block blk, u16 vsig) in ice_vsig_free() argument
1190 if (!hw->blk[blk].xlt2.vsig_tbl[idx].in_use) in ice_vsig_free()
1193 hw->blk[blk].xlt2.vsig_tbl[idx].in_use = false; in ice_vsig_free()
1195 vsi_cur = hw->blk[blk].xlt2.vsig_tbl[idx].first_vsi; in ice_vsig_free()
1211 hw->blk[blk].xlt2.vsig_tbl[idx].first_vsi = NULL; in ice_vsig_free()
1216 &hw->blk[blk].xlt2.vsig_tbl[idx].prop_lst, in ice_vsig_free()
1225 INIT_LIST_HEAD(&hw->blk[blk].xlt2.vsig_tbl[idx].prop_lst); in ice_vsig_free()
1241 ice_vsig_remove_vsi(struct ice_hw *hw, enum ice_block blk, u16 vsi, u16 vsig) in ice_vsig_remove_vsi() argument
1251 if (!hw->blk[blk].xlt2.vsig_tbl[idx].in_use) in ice_vsig_remove_vsi()
1258 vsi_head = &hw->blk[blk].xlt2.vsig_tbl[idx].first_vsi; in ice_vsig_remove_vsi()
1262 vsi_tgt = &hw->blk[blk].xlt2.vsis[vsi]; in ice_vsig_remove_vsi()
1299 ice_vsig_add_mv_vsi(struct ice_hw *hw, enum ice_block blk, u16 vsi, u16 vsig) in ice_vsig_add_mv_vsi() argument
1313 if (!hw->blk[blk].xlt2.vsig_tbl[idx].in_use && in ice_vsig_add_mv_vsi()
1317 status = ice_vsig_find_vsi(hw, blk, vsi, &orig_vsig); in ice_vsig_add_mv_vsi()
1327 status = ice_vsig_remove_vsi(hw, blk, vsi, orig_vsig); in ice_vsig_add_mv_vsi()
1336 hw->blk[blk].xlt2.vsis[vsi].vsig = vsig; in ice_vsig_add_mv_vsi()
1337 hw->blk[blk].xlt2.vsis[vsi].changed = 1; in ice_vsig_add_mv_vsi()
1340 tmp = hw->blk[blk].xlt2.vsig_tbl[idx].first_vsi; in ice_vsig_add_mv_vsi()
1341 hw->blk[blk].xlt2.vsig_tbl[idx].first_vsi = in ice_vsig_add_mv_vsi()
1342 &hw->blk[blk].xlt2.vsis[vsi]; in ice_vsig_add_mv_vsi()
1343 hw->blk[blk].xlt2.vsis[vsi].next_vsi = tmp; in ice_vsig_add_mv_vsi()
1344 hw->blk[blk].xlt2.t[vsi] = vsig; in ice_vsig_add_mv_vsi()
1357 ice_find_prof_id(struct ice_hw *hw, enum ice_block blk, in ice_find_prof_id() argument
1360 struct ice_es *es = &hw->blk[blk].es; in ice_find_prof_id()
1382 static bool ice_prof_id_rsrc_type(enum ice_block blk, u16 *rsrc_type) in ice_prof_id_rsrc_type() argument
1384 switch (blk) { in ice_prof_id_rsrc_type()
1402 static bool ice_tcam_ent_rsrc_type(enum ice_block blk, u16 *rsrc_type) in ice_tcam_ent_rsrc_type() argument
1404 switch (blk) { in ice_tcam_ent_rsrc_type()
1428 ice_alloc_tcam_ent(struct ice_hw *hw, enum ice_block blk, bool btm, in ice_alloc_tcam_ent() argument
1433 if (!ice_tcam_ent_rsrc_type(blk, &res_type)) in ice_alloc_tcam_ent()
1448 ice_free_tcam_ent(struct ice_hw *hw, enum ice_block blk, u16 tcam_idx) in ice_free_tcam_ent() argument
1452 if (!ice_tcam_ent_rsrc_type(blk, &res_type)) in ice_free_tcam_ent()
1468 ice_alloc_prof_id(struct ice_hw *hw, enum ice_block blk, u8 *prof_id) in ice_alloc_prof_id() argument
1474 if (!ice_prof_id_rsrc_type(blk, &res_type)) in ice_alloc_prof_id()
1493 ice_free_prof_id(struct ice_hw *hw, enum ice_block blk, u8 prof_id) in ice_free_prof_id() argument
1498 if (!ice_prof_id_rsrc_type(blk, &res_type)) in ice_free_prof_id()
1511 ice_prof_inc_ref(struct ice_hw *hw, enum ice_block blk, u8 prof_id) in ice_prof_inc_ref() argument
1513 if (prof_id > hw->blk[blk].es.count) in ice_prof_inc_ref()
1516 hw->blk[blk].es.ref_count[prof_id]++; in ice_prof_inc_ref()
1529 ice_write_es(struct ice_hw *hw, enum ice_block blk, u8 prof_id, in ice_write_es() argument
1534 off = prof_id * hw->blk[blk].es.fvw; in ice_write_es()
1536 ice_memset(&hw->blk[blk].es.t[off], 0, hw->blk[blk].es.fvw * in ice_write_es()
1538 hw->blk[blk].es.written[prof_id] = false; in ice_write_es()
1540 ice_memcpy(&hw->blk[blk].es.t[off], fv, hw->blk[blk].es.fvw * in ice_write_es()
1552 ice_prof_dec_ref(struct ice_hw *hw, enum ice_block blk, u8 prof_id) in ice_prof_dec_ref() argument
1554 if (prof_id > hw->blk[blk].es.count) in ice_prof_dec_ref()
1557 if (hw->blk[blk].es.ref_count[prof_id] > 0) { in ice_prof_dec_ref()
1558 if (!--hw->blk[blk].es.ref_count[prof_id]) { in ice_prof_dec_ref()
1559 ice_write_es(hw, blk, prof_id, NULL); in ice_prof_dec_ref()
1560 return ice_free_prof_id(hw, blk, prof_id); in ice_prof_dec_ref()
1615 static void ice_init_sw_xlt1_db(struct ice_hw *hw, enum ice_block blk) in ice_init_sw_xlt1_db() argument
1619 for (pt = 0; pt < hw->blk[blk].xlt1.count; pt++) { in ice_init_sw_xlt1_db()
1622 ptg = hw->blk[blk].xlt1.t[pt]; in ice_init_sw_xlt1_db()
1624 ice_ptg_alloc_val(hw, blk, ptg); in ice_init_sw_xlt1_db()
1625 ice_ptg_add_mv_ptype(hw, blk, pt, ptg); in ice_init_sw_xlt1_db()
1635 static void ice_init_sw_xlt2_db(struct ice_hw *hw, enum ice_block blk) in ice_init_sw_xlt2_db() argument
1639 for (vsi = 0; vsi < hw->blk[blk].xlt2.count; vsi++) { in ice_init_sw_xlt2_db()
1642 vsig = hw->blk[blk].xlt2.t[vsi]; in ice_init_sw_xlt2_db()
1644 ice_vsig_alloc_val(hw, blk, vsig); in ice_init_sw_xlt2_db()
1645 ice_vsig_add_mv_vsi(hw, blk, vsi, vsig); in ice_init_sw_xlt2_db()
1649 hw->blk[blk].xlt2.vsis[vsi].changed = 0; in ice_init_sw_xlt2_db()
1715 sizeof(*hw->blk[block_id].xlt1.t); in ice_fill_tbl()
1716 dst = hw->blk[block_id].xlt1.t; in ice_fill_tbl()
1717 dst_len = hw->blk[block_id].xlt1.count * in ice_fill_tbl()
1718 sizeof(*hw->blk[block_id].xlt1.t); in ice_fill_tbl()
1728 sizeof(*hw->blk[block_id].xlt2.t); in ice_fill_tbl()
1729 dst = (u8 *)hw->blk[block_id].xlt2.t; in ice_fill_tbl()
1730 dst_len = hw->blk[block_id].xlt2.count * in ice_fill_tbl()
1731 sizeof(*hw->blk[block_id].xlt2.t); in ice_fill_tbl()
1741 sizeof(*hw->blk[block_id].prof.t); in ice_fill_tbl()
1742 dst = (u8 *)hw->blk[block_id].prof.t; in ice_fill_tbl()
1743 dst_len = hw->blk[block_id].prof.count * in ice_fill_tbl()
1744 sizeof(*hw->blk[block_id].prof.t); in ice_fill_tbl()
1754 sizeof(*hw->blk[block_id].prof_redir.t); in ice_fill_tbl()
1755 dst = hw->blk[block_id].prof_redir.t; in ice_fill_tbl()
1756 dst_len = hw->blk[block_id].prof_redir.count * in ice_fill_tbl()
1757 sizeof(*hw->blk[block_id].prof_redir.t); in ice_fill_tbl()
1767 hw->blk[block_id].es.fvw) * in ice_fill_tbl()
1768 sizeof(*hw->blk[block_id].es.t); in ice_fill_tbl()
1769 dst = (u8 *)hw->blk[block_id].es.t; in ice_fill_tbl()
1770 dst_len = (u32)(hw->blk[block_id].es.count * in ice_fill_tbl()
1771 hw->blk[block_id].es.fvw) * in ice_fill_tbl()
1772 sizeof(*hw->blk[block_id].es.t); in ice_fill_tbl()
1821 struct ice_prof_redir *prof_redir = &hw->blk[i].prof_redir; in ice_init_hw_tbls()
1822 struct ice_prof_tcam *prof = &hw->blk[i].prof; in ice_init_hw_tbls()
1823 struct ice_xlt1 *xlt1 = &hw->blk[i].xlt1; in ice_init_hw_tbls()
1824 struct ice_xlt2 *xlt2 = &hw->blk[i].xlt2; in ice_init_hw_tbls()
1825 struct ice_es *es = &hw->blk[i].es; in ice_init_hw_tbls()
1828 if (hw->blk[i].is_list_init) in ice_init_hw_tbls()
1834 hw->blk[i].is_list_init = true; in ice_init_hw_tbls()
1836 hw->blk[i].overwrite = blk_sizes[i].overwrite; in ice_init_hw_tbls()
1941 ice_fill_tbl(hw, blk_id, hw->blk[blk_id].xlt1.sid); in ice_fill_blk_tbls()
1942 ice_fill_tbl(hw, blk_id, hw->blk[blk_id].xlt2.sid); in ice_fill_blk_tbls()
1943 ice_fill_tbl(hw, blk_id, hw->blk[blk_id].prof.sid); in ice_fill_blk_tbls()
1944 ice_fill_tbl(hw, blk_id, hw->blk[blk_id].prof_redir.sid); in ice_fill_blk_tbls()
1945 ice_fill_tbl(hw, blk_id, hw->blk[blk_id].es.sid); in ice_fill_blk_tbls()
1958 struct ice_es *es = &hw->blk[blk_idx].es; in ice_free_prof_map()
2000 static void ice_free_vsig_tbl(struct ice_hw *hw, enum ice_block blk) in ice_free_vsig_tbl() argument
2004 if (!hw->blk[blk].xlt2.vsig_tbl) in ice_free_vsig_tbl()
2008 if (hw->blk[blk].xlt2.vsig_tbl[i].in_use) in ice_free_vsig_tbl()
2009 ice_vsig_free(hw, blk, i); in ice_free_vsig_tbl()
2022 if (hw->blk[i].is_list_init) { in ice_free_hw_tbls()
2023 struct ice_es *es = &hw->blk[i].es; in ice_free_hw_tbls()
2031 hw->blk[i].is_list_init = false; in ice_free_hw_tbls()
2034 ice_free(hw, hw->blk[i].xlt1.ptypes); in ice_free_hw_tbls()
2035 ice_free(hw, hw->blk[i].xlt1.ptg_tbl); in ice_free_hw_tbls()
2036 ice_free(hw, hw->blk[i].xlt1.t); in ice_free_hw_tbls()
2037 ice_free(hw, hw->blk[i].xlt2.t); in ice_free_hw_tbls()
2038 ice_free(hw, hw->blk[i].xlt2.vsig_tbl); in ice_free_hw_tbls()
2039 ice_free(hw, hw->blk[i].xlt2.vsis); in ice_free_hw_tbls()
2040 ice_free(hw, hw->blk[i].prof.t); in ice_free_hw_tbls()
2041 ice_free(hw, hw->blk[i].prof_redir.t); in ice_free_hw_tbls()
2042 ice_free(hw, hw->blk[i].es.t); in ice_free_hw_tbls()
2043 ice_free(hw, hw->blk[i].es.ref_count); in ice_free_hw_tbls()
2044 ice_free(hw, hw->blk[i].es.written); in ice_free_hw_tbls()
2053 ice_memset(hw->blk, 0, sizeof(hw->blk), ICE_NONDMA_MEM); in ice_free_hw_tbls()
2065 struct ice_prof_redir *prof_redir = &hw->blk[i].prof_redir; in ice_clear_hw_tbls()
2066 struct ice_prof_tcam *prof = &hw->blk[i].prof; in ice_clear_hw_tbls()
2067 struct ice_xlt1 *xlt1 = &hw->blk[i].xlt1; in ice_clear_hw_tbls()
2068 struct ice_xlt2 *xlt2 = &hw->blk[i].xlt2; in ice_clear_hw_tbls()
2069 struct ice_es *es = &hw->blk[i].es; in ice_clear_hw_tbls()
2071 if (hw->blk[i].is_list_init) { in ice_clear_hw_tbls()
2147 ice_prof_gen_key(struct ice_hw *hw, enum ice_block blk, u8 ptg, u16 vsig, in ice_prof_gen_key() argument
2158 switch (hw->blk[blk].prof.cdid_bits) { in ice_prof_gen_key()
2203 ice_tcam_write_entry(struct ice_hw *hw, enum ice_block blk, u16 idx, in ice_tcam_write_entry() argument
2212 status = ice_prof_gen_key(hw, blk, ptg, vsig, cdid, flags, vl_msk, in ice_tcam_write_entry()
2213 dc_msk, nm_msk, hw->blk[blk].prof.t[idx].key); in ice_tcam_write_entry()
2215 hw->blk[blk].prof.t[idx].addr = CPU_TO_LE16(idx); in ice_tcam_write_entry()
2216 hw->blk[blk].prof.t[idx].prof_id = prof_id; in ice_tcam_write_entry()
2230 ice_vsig_get_ref(struct ice_hw *hw, enum ice_block blk, u16 vsig, u16 *refs) in ice_vsig_get_ref() argument
2237 if (!hw->blk[blk].xlt2.vsig_tbl[idx].in_use) in ice_vsig_get_ref()
2240 ptr = hw->blk[blk].xlt2.vsig_tbl[idx].first_vsi; in ice_vsig_get_ref()
2257 ice_has_prof_vsig(struct ice_hw *hw, enum ice_block blk, u16 vsig, u64 hdl) in ice_has_prof_vsig() argument
2262 LIST_FOR_EACH_ENTRY(ent, &hw->blk[blk].xlt2.vsig_tbl[idx].prop_lst, in ice_has_prof_vsig()
2280 ice_prof_bld_es(struct ice_hw *hw, enum ice_block blk, in ice_prof_bld_es() argument
2283 u16 vec_size = hw->blk[blk].es.fvw * sizeof(struct ice_fv_word); in ice_prof_bld_es()
2288 u16 off = tmp->prof_id * hw->blk[blk].es.fvw; in ice_prof_bld_es()
2292 id = ice_sect_id(blk, ICE_VEC_TBL); in ice_prof_bld_es()
2306 ice_memcpy(p->es, &hw->blk[blk].es.t[off], vec_size, in ice_prof_bld_es()
2321 ice_prof_bld_tcam(struct ice_hw *hw, enum ice_block blk, in ice_prof_bld_tcam() argument
2331 id = ice_sect_id(blk, ICE_PROF_TCAM); in ice_prof_bld_tcam()
2346 &hw->blk[blk].prof.t[tmp->tcam_idx].key, in ice_prof_bld_tcam()
2347 sizeof(hw->blk[blk].prof.t->key), in ice_prof_bld_tcam()
2361 ice_prof_bld_xlt1(enum ice_block blk, struct ice_buf_build *bld, in ice_prof_bld_xlt1() argument
2371 id = ice_sect_id(blk, ICE_XLT1); in ice_prof_bld_xlt1()
2396 ice_prof_bld_xlt2(enum ice_block blk, struct ice_buf_build *bld, in ice_prof_bld_xlt2() argument
2409 id = ice_sect_id(blk, ICE_XLT2); in ice_prof_bld_xlt2()
2438 ice_upd_prof_hw(struct ice_hw *hw, enum ice_block blk, in ice_upd_prof_hw() argument
2488 status = ice_prof_bld_es(hw, blk, b, chgs); in ice_upd_prof_hw()
2494 status = ice_prof_bld_tcam(hw, blk, b, chgs); in ice_upd_prof_hw()
2500 status = ice_prof_bld_xlt1(blk, b, chgs); in ice_upd_prof_hw()
2506 status = ice_prof_bld_xlt2(blk, b, chgs); in ice_upd_prof_hw()
2545 ice_add_prof(struct ice_hw *hw, enum ice_block blk, u64 id, in ice_add_prof() argument
2556 ice_acquire_lock(&hw->blk[blk].es.prof_map_lock); in ice_add_prof()
2559 status = ice_find_prof_id(hw, blk, es, &prof_id); in ice_add_prof()
2562 status = ice_alloc_prof_id(hw, blk, &prof_id); in ice_add_prof()
2567 ice_write_es(hw, blk, prof_id, es); in ice_add_prof()
2570 ice_prof_inc_ref(hw, blk, prof_id); in ice_add_prof()
2590 if (ice_ptg_find_ptype(hw, blk, ptype, &ptg)) in ice_add_prof()
2604 LIST_ADD(&prof->list, &hw->blk[blk].es.prof_map); in ice_add_prof()
2608 ice_release_lock(&hw->blk[blk].es.prof_map_lock); in ice_add_prof()
2622 ice_search_prof_id(struct ice_hw *hw, enum ice_block blk, u64 id) in ice_search_prof_id() argument
2627 LIST_FOR_EACH_ENTRY(map, &hw->blk[blk].es.prof_map, ice_prof_map, list) in ice_search_prof_id()
2644 ice_set_prof_context(struct ice_hw *hw, enum ice_block blk, u64 id, u64 cntxt) in ice_set_prof_context() argument
2649 ice_acquire_lock(&hw->blk[blk].es.prof_map_lock); in ice_set_prof_context()
2650 entry = ice_search_prof_id(hw, blk, id); in ice_set_prof_context()
2655 ice_release_lock(&hw->blk[blk].es.prof_map_lock); in ice_set_prof_context()
2667 ice_get_prof_context(struct ice_hw *hw, enum ice_block blk, u64 id, u64 *cntxt) in ice_get_prof_context() argument
2672 ice_acquire_lock(&hw->blk[blk].es.prof_map_lock); in ice_get_prof_context()
2673 entry = ice_search_prof_id(hw, blk, id); in ice_get_prof_context()
2678 ice_release_lock(&hw->blk[blk].es.prof_map_lock); in ice_get_prof_context()
2689 ice_vsig_prof_id_count(struct ice_hw *hw, enum ice_block blk, u16 vsig) in ice_vsig_prof_id_count() argument
2694 LIST_FOR_EACH_ENTRY(p, &hw->blk[blk].xlt2.vsig_tbl[idx].prop_lst, in ice_vsig_prof_id_count()
2708 ice_rel_tcam_idx(struct ice_hw *hw, enum ice_block blk, u16 idx) in ice_rel_tcam_idx() argument
2717 status = ice_tcam_write_entry(hw, blk, idx, 0, 0, 0, 0, 0, vl_msk, in ice_rel_tcam_idx()
2723 status = ice_free_tcam_ent(hw, blk, idx); in ice_rel_tcam_idx()
2735 ice_rem_prof_id(struct ice_hw *hw, enum ice_block blk, in ice_rem_prof_id() argument
2744 status = ice_rel_tcam_idx(hw, blk, in ice_rem_prof_id()
2761 ice_rem_vsig(struct ice_hw *hw, enum ice_block blk, u16 vsig, in ice_rem_vsig() argument
2770 &hw->blk[blk].xlt2.vsig_tbl[idx].prop_lst, in ice_rem_vsig()
2774 status = ice_rem_prof_id(hw, blk, d); in ice_rem_vsig()
2783 vsi_cur = hw->blk[blk].xlt2.vsig_tbl[idx].first_vsi; in ice_rem_vsig()
2799 p->vsi = (u16)(vsi_cur - hw->blk[blk].xlt2.vsis); in ice_rem_vsig()
2806 return ice_vsig_free(hw, blk, vsig); in ice_rem_vsig()
2818 ice_rem_prof_id_vsig(struct ice_hw *hw, enum ice_block blk, u16 vsig, u64 hdl, in ice_rem_prof_id_vsig() argument
2825 &hw->blk[blk].xlt2.vsig_tbl[idx].prop_lst, in ice_rem_prof_id_vsig()
2830 if (ice_vsig_prof_id_count(hw, blk, vsig) == 1) in ice_rem_prof_id_vsig()
2832 return ice_rem_vsig(hw, blk, vsig, chg); in ice_rem_prof_id_vsig()
2834 status = ice_rem_prof_id(hw, blk, p); in ice_rem_prof_id_vsig()
2852 ice_rem_flow_all(struct ice_hw *hw, enum ice_block blk, u64 id) in ice_rem_flow_all() argument
2862 if (hw->blk[blk].xlt2.vsig_tbl[i].in_use) { in ice_rem_flow_all()
2863 if (ice_has_prof_vsig(hw, blk, i, id)) { in ice_rem_flow_all()
2864 status = ice_rem_prof_id_vsig(hw, blk, i, id, in ice_rem_flow_all()
2871 status = ice_upd_prof_hw(hw, blk, &chg); in ice_rem_flow_all()
2892 int ice_rem_prof(struct ice_hw *hw, enum ice_block blk, u64 id) in ice_rem_prof() argument
2897 ice_acquire_lock(&hw->blk[blk].es.prof_map_lock); in ice_rem_prof()
2899 pmap = ice_search_prof_id(hw, blk, id); in ice_rem_prof()
2906 status = ice_rem_flow_all(hw, blk, pmap->profile_cookie); in ice_rem_prof()
2911 ice_prof_dec_ref(hw, blk, pmap->prof_id); in ice_rem_prof()
2917 ice_release_lock(&hw->blk[blk].es.prof_map_lock); in ice_rem_prof()
2929 ice_get_prof(struct ice_hw *hw, enum ice_block blk, u64 hdl, in ice_get_prof() argument
2937 ice_acquire_lock(&hw->blk[blk].es.prof_map_lock); in ice_get_prof()
2939 map = ice_search_prof_id(hw, blk, hdl); in ice_get_prof()
2946 if (!hw->blk[blk].es.written[map->prof_id]) { in ice_get_prof()
2962 hw->blk[blk].es.written[map->prof_id] = true; in ice_get_prof()
2968 ice_release_lock(&hw->blk[blk].es.prof_map_lock); in ice_get_prof()
2983 ice_get_profs_vsig(struct ice_hw *hw, enum ice_block blk, u16 vsig, in ice_get_profs_vsig() argument
2989 LIST_FOR_EACH_ENTRY(ent1, &hw->blk[blk].xlt2.vsig_tbl[idx].prop_lst, in ice_get_profs_vsig()
3021 ice_add_prof_to_lst(struct ice_hw *hw, enum ice_block blk, in ice_add_prof_to_lst() argument
3029 ice_acquire_lock(&hw->blk[blk].es.prof_map_lock); in ice_add_prof_to_lst()
3030 map = ice_search_prof_id(hw, blk, hdl); in ice_add_prof_to_lst()
3055 ice_release_lock(&hw->blk[blk].es.prof_map_lock); in ice_add_prof_to_lst()
3068 ice_move_vsi(struct ice_hw *hw, enum ice_block blk, u16 vsi, u16 vsig, in ice_move_vsi() argument
3079 status = ice_vsig_find_vsi(hw, blk, vsi, &orig_vsig); in ice_move_vsi()
3081 status = ice_vsig_add_mv_vsi(hw, blk, vsi, vsig); in ice_move_vsi()
3128 ice_prof_tcam_ena_dis(struct ice_hw *hw, enum ice_block blk, bool enable, in ice_prof_tcam_ena_dis() argument
3141 status = ice_rel_tcam_idx(hw, blk, tcam->tcam_idx); in ice_prof_tcam_ena_dis()
3154 status = ice_alloc_tcam_ent(hw, blk, true, &tcam->tcam_idx); in ice_prof_tcam_ena_dis()
3163 status = ice_tcam_write_entry(hw, blk, tcam->tcam_idx, tcam->prof_id, in ice_prof_tcam_ena_dis()
3196 ice_adj_prof_priorities(struct ice_hw *hw, enum ice_block blk, u16 vsig, in ice_adj_prof_priorities() argument
3216 LIST_FOR_EACH_ENTRY(t, &hw->blk[blk].xlt2.vsig_tbl[idx].prop_lst, in ice_adj_prof_priorities()
3233 status = ice_prof_tcam_ena_dis(hw, blk, false, in ice_adj_prof_priorities()
3243 status = ice_prof_tcam_ena_dis(hw, blk, true, in ice_adj_prof_priorities()
3269 ice_add_prof_id_vsig(struct ice_hw *hw, enum ice_block blk, u16 vsig, u64 hdl, in ice_add_prof_id_vsig() argument
3283 if (ice_has_prof_vsig(hw, blk, vsig, hdl)) in ice_add_prof_id_vsig()
3291 ice_acquire_lock(&hw->blk[blk].es.prof_map_lock); in ice_add_prof_id_vsig()
3293 map = ice_search_prof_id(hw, blk, hdl); in ice_add_prof_id_vsig()
3315 status = ice_alloc_tcam_ent(hw, blk, true, &tcam_idx); in ice_add_prof_id_vsig()
3334 status = ice_tcam_write_entry(hw, blk, t->tcam[i].tcam_idx, in ice_add_prof_id_vsig()
3351 &hw->blk[blk].xlt2.vsig_tbl[vsig_idx].prop_lst); in ice_add_prof_id_vsig()
3354 &hw->blk[blk].xlt2.vsig_tbl[vsig_idx].prop_lst); in ice_add_prof_id_vsig()
3356 ice_release_lock(&hw->blk[blk].es.prof_map_lock); in ice_add_prof_id_vsig()
3360 ice_release_lock(&hw->blk[blk].es.prof_map_lock); in ice_add_prof_id_vsig()
3375 ice_create_prof_id_vsig(struct ice_hw *hw, enum ice_block blk, u16 vsi, u64 hdl, in ice_create_prof_id_vsig() argument
3386 new_vsig = ice_vsig_alloc(hw, blk); in ice_create_prof_id_vsig()
3392 status = ice_move_vsi(hw, blk, vsi, new_vsig, chg); in ice_create_prof_id_vsig()
3396 status = ice_add_prof_id_vsig(hw, blk, new_vsig, hdl, false, chg); in ice_create_prof_id_vsig()
3425 ice_create_vsig_from_lst(struct ice_hw *hw, enum ice_block blk, u16 vsi, in ice_create_vsig_from_lst() argument
3433 vsig = ice_vsig_alloc(hw, blk); in ice_create_vsig_from_lst()
3437 status = ice_move_vsi(hw, blk, vsi, vsig, chg); in ice_create_vsig_from_lst()
3443 status = ice_add_prof_id_vsig(hw, blk, vsig, t->profile_cookie, in ice_create_vsig_from_lst()
3462 ice_find_prof_vsig(struct ice_hw *hw, enum ice_block blk, u64 hdl, u16 *vsig) in ice_find_prof_vsig() argument
3477 status = ice_find_dup_props_vsig(hw, blk, &lst, vsig); in ice_find_prof_vsig()
3500 ice_add_vsi_flow(struct ice_hw *hw, enum ice_block blk, u16 vsi, u16 vsig) in ice_add_vsi_flow() argument
3513 status = ice_move_vsi(hw, blk, vsi, vsig, &chg); in ice_add_vsi_flow()
3516 status = ice_upd_prof_hw(hw, blk, &chg); in ice_add_vsi_flow()
3538 ice_add_prof_id_flow(struct ice_hw *hw, enum ice_block blk, u16 vsi, u64 hdl) in ice_add_prof_id_flow() argument
3551 status = ice_get_prof(hw, blk, hdl, &chg); in ice_add_prof_id_flow()
3556 status = ice_vsig_find_vsi(hw, blk, vsi, &vsig); in ice_add_prof_id_flow()
3569 if (ice_has_prof_vsig(hw, blk, vsig, hdl)) { in ice_add_prof_id_flow()
3575 status = ice_vsig_get_ref(hw, blk, vsig, &ref); in ice_add_prof_id_flow()
3583 status = ice_get_profs_vsig(hw, blk, vsig, &union_lst); in ice_add_prof_id_flow()
3587 status = ice_add_prof_to_lst(hw, blk, &union_lst, hdl); in ice_add_prof_id_flow()
3592 status = ice_find_dup_props_vsig(hw, blk, &union_lst, &vsig); in ice_add_prof_id_flow()
3595 status = ice_move_vsi(hw, blk, vsi, vsig, &chg); in ice_add_prof_id_flow()
3603 status = ice_rem_vsig(hw, blk, or_vsig, &chg); in ice_add_prof_id_flow()
3613 status = ice_add_prof_id_vsig(hw, blk, vsig, hdl, false, in ice_add_prof_id_flow()
3619 status = ice_adj_prof_priorities(hw, blk, vsig, &chg); in ice_add_prof_id_flow()
3624 status = ice_create_vsig_from_lst(hw, blk, vsi, in ice_add_prof_id_flow()
3631 status = ice_adj_prof_priorities(hw, blk, vsig, &chg); in ice_add_prof_id_flow()
3638 if (ice_find_prof_vsig(hw, blk, hdl, &vsig)) { in ice_add_prof_id_flow()
3641 status = ice_move_vsi(hw, blk, vsi, vsig, &chg); in ice_add_prof_id_flow()
3647 status = ice_create_prof_id_vsig(hw, blk, vsi, hdl, in ice_add_prof_id_flow()
3656 status = ice_upd_prof_hw(hw, blk, &chg); in ice_add_prof_id_flow()
3685 ice_add_flow(struct ice_hw *hw, enum ice_block blk, u16 vsi[], u8 count, in ice_add_flow() argument
3693 status = ice_add_prof_id_flow(hw, blk, vsi[i], id); in ice_add_flow()
3734 ice_rem_prof_id_flow(struct ice_hw *hw, enum ice_block blk, u16 vsi, u64 hdl) in ice_rem_prof_id_flow() argument
3746 status = ice_vsig_find_vsi(hw, blk, vsi, &vsig); in ice_rem_prof_id_flow()
3753 last_profile = ice_vsig_prof_id_count(hw, blk, vsig) == 1; in ice_rem_prof_id_flow()
3754 status = ice_vsig_get_ref(hw, blk, vsig, &ref); in ice_rem_prof_id_flow()
3770 status = ice_rem_vsig(hw, blk, vsig, &chg); in ice_rem_prof_id_flow()
3774 status = ice_rem_prof_id_vsig(hw, blk, vsig, in ice_rem_prof_id_flow()
3780 status = ice_adj_prof_priorities(hw, blk, vsig, in ice_rem_prof_id_flow()
3788 status = ice_get_profs_vsig(hw, blk, vsig, ©); in ice_rem_prof_id_flow()
3798 status = ice_move_vsi(hw, blk, vsi, in ice_rem_prof_id_flow()
3803 } else if (!ice_find_dup_props_vsig(hw, blk, ©, in ice_rem_prof_id_flow()
3812 status = ice_move_vsi(hw, blk, vsi, vsig, &chg); in ice_rem_prof_id_flow()
3820 status = ice_create_vsig_from_lst(hw, blk, vsi, in ice_rem_prof_id_flow()
3827 status = ice_adj_prof_priorities(hw, blk, vsig, in ice_rem_prof_id_flow()
3839 status = ice_upd_prof_hw(hw, blk, &chg); in ice_rem_prof_id_flow()
3868 ice_rem_flow(struct ice_hw *hw, enum ice_block blk, u16 vsi[], u8 count, in ice_rem_flow() argument
3876 status = ice_rem_prof_id_flow(hw, blk, vsi[i], id); in ice_rem_flow()