Lines Matching +full:in +full:- +full:masks

1 // SPDX-License-Identifier: GPL-2.0
77 * ice_sect_id - returns section ID
90 * ice_hw_ptype_ena - check if the PTYPE is enabled or not
97 test_bit(ptype, hw->hw_ptype); in ice_hw_ptype_ena()
112 * ice_gen_key_word - generate 16-bits of a key/mask word
120 * This function generates 16-bits from a 8-bit value, an 8-bit don't care mask
121 * and an 8-bit never match mask. The 16-bits of output are divided into 8 bits
133 * ------------------------------
143 /* 'dont_care' and 'nvr_mtch' masks cannot overlap */ in ice_gen_key_word()
145 return -EIO; in ice_gen_key_word()
150 /* encode the 8 bits into 8-bit key and 8-bit key invert */ in ice_gen_key_word()
184 * ice_bits_max_set - determine if the number of bits set is within a maximum
186 * @size: the number of bytes in the mask
189 * This function determines if there are at most 'max' number of bits set in an
204 /* We know there is at least one set bit in this byte because of in ice_bits_max_set()
211 /* count the bits in this byte, checking threshold */ in ice_bits_max_set()
221 * ice_set_key - generate a variable sized key with multiples of 16-bits
223 * @size: the size of the complete key in bytes (must be even)
224 * @val: array of 8-bit values that makes up the value portion of the key
225 * @upd: array of 8-bit masks that determine what key portion to update
226 * @dc: array of 8-bit masks that make up the don't care mask
227 * @nm: array of 8-bit masks that make up the never match mask
228 * @off: the offset of the first byte in the key to update
229 * @len: the number of bytes in the key update
234 * upd == NULL --> upd mask is all 1's (update all bits)
235 * dc == NULL --> dc mask is all 0's (no don't care bits)
236 * nm == NULL --> nm mask is all 0's (no never match bits)
247 return -EIO; in ice_set_key()
251 return -EIO; in ice_set_key()
253 /* Make sure at most one bit is set in the never match mask. Having more in ice_set_key()
259 return -EIO; in ice_set_key()
265 return -EIO; in ice_set_key()
296 * ice_get_open_tunnel_port - retrieve an open tunnel port
308 mutex_lock(&hw->tnl_lock); in ice_get_open_tunnel_port()
310 for (i = 0; i < hw->tnl.count && i < ICE_TUNNEL_MAX_ENTRIES; i++) in ice_get_open_tunnel_port()
311 if (hw->tnl.tbl[i].valid && hw->tnl.tbl[i].port && in ice_get_open_tunnel_port()
312 (type == TNL_LAST || type == hw->tnl.tbl[i].type)) { in ice_get_open_tunnel_port()
313 *port = hw->tnl.tbl[i].port; in ice_get_open_tunnel_port()
318 mutex_unlock(&hw->tnl_lock); in ice_get_open_tunnel_port()
332 int status = -ENOSPC; in ice_upd_dvm_boost_entry()
338 return -ENOMEM; in ice_upd_dvm_boost_entry()
348 sect_rx->count = cpu_to_le16(1); in ice_upd_dvm_boost_entry()
354 sect_tx->count = cpu_to_le16(1); in ice_upd_dvm_boost_entry()
357 memcpy(sect_rx->tcam, entry->boost_entry, sizeof(*sect_rx->tcam)); in ice_upd_dvm_boost_entry()
359 /* re-write the don't care and never match bits accordingly */ in ice_upd_dvm_boost_entry()
360 if (entry->enable) { in ice_upd_dvm_boost_entry()
372 ice_set_key((u8 *)&sect_rx->tcam[0].key, sizeof(sect_rx->tcam[0].key), in ice_upd_dvm_boost_entry()
376 memcpy(sect_tx->tcam, sect_rx->tcam, sizeof(*sect_tx->tcam)); in ice_upd_dvm_boost_entry()
396 for (i = 0; i < hw->dvm_upd.count; i++) { in ice_set_dvm_boost_entries()
399 status = ice_upd_dvm_boost_entry(hw, &hw->dvm_upd.tbl[i]); in ice_set_dvm_boost_entries()
408 * ice_tunnel_idx_to_entry - convert linear index to the sparse one
422 for (i = 0; i < hw->tnl.count && i < ICE_TUNNEL_MAX_ENTRIES; i++) in ice_tunnel_idx_to_entry()
423 if (hw->tnl.tbl[i].valid && in ice_tunnel_idx_to_entry()
424 hw->tnl.tbl[i].type == type && in ice_tunnel_idx_to_entry()
425 idx-- == 0) in ice_tunnel_idx_to_entry()
439 * Create a tunnel by updating the parse graph in the parser. We do that by
449 int status = -ENOSPC; in ice_create_tunnel()
451 mutex_lock(&hw->tnl_lock); in ice_create_tunnel()
455 status = -ENOMEM; in ice_create_tunnel()
467 sect_rx->count = cpu_to_le16(1); in ice_create_tunnel()
473 sect_tx->count = cpu_to_le16(1); in ice_create_tunnel()
476 memcpy(sect_rx->tcam, hw->tnl.tbl[index].boost_entry, in ice_create_tunnel()
477 sizeof(*sect_rx->tcam)); in ice_create_tunnel()
479 /* over-write the never-match dest port key bits with the encoded port in ice_create_tunnel()
482 ice_set_key((u8 *)&sect_rx->tcam[0].key, sizeof(sect_rx->tcam[0].key), in ice_create_tunnel()
485 sizeof(sect_rx->tcam[0].key.key.hv_dst_port_key)); in ice_create_tunnel()
488 memcpy(sect_tx->tcam, sect_rx->tcam, sizeof(*sect_tx->tcam)); in ice_create_tunnel()
492 hw->tnl.tbl[index].port = port; in ice_create_tunnel()
498 mutex_unlock(&hw->tnl_lock); in ice_create_tunnel()
520 int status = -ENOSPC; in ice_destroy_tunnel()
522 mutex_lock(&hw->tnl_lock); in ice_destroy_tunnel()
524 if (WARN_ON(!hw->tnl.tbl[index].valid || in ice_destroy_tunnel()
525 hw->tnl.tbl[index].type != type || in ice_destroy_tunnel()
526 hw->tnl.tbl[index].port != port)) { in ice_destroy_tunnel()
527 status = -EIO; in ice_destroy_tunnel()
533 status = -ENOMEM; in ice_destroy_tunnel()
545 sect_rx->count = cpu_to_le16(1); in ice_destroy_tunnel()
551 sect_tx->count = cpu_to_le16(1); in ice_destroy_tunnel()
556 memcpy(sect_rx->tcam, hw->tnl.tbl[index].boost_entry, in ice_destroy_tunnel()
557 sizeof(*sect_rx->tcam)); in ice_destroy_tunnel()
558 memcpy(sect_tx->tcam, hw->tnl.tbl[index].boost_entry, in ice_destroy_tunnel()
559 sizeof(*sect_tx->tcam)); in ice_destroy_tunnel()
563 hw->tnl.tbl[index].port = 0; in ice_destroy_tunnel()
569 mutex_unlock(&hw->tnl_lock); in ice_destroy_tunnel()
578 struct ice_vsi *vsi = np->vsi; in ice_udp_tunnel_set_port()
579 struct ice_pf *pf = vsi->back; in ice_udp_tunnel_set_port()
584 tnl_type = ti->type == UDP_TUNNEL_TYPE_VXLAN ? TNL_VXLAN : TNL_GENEVE; in ice_udp_tunnel_set_port()
585 index = ice_tunnel_idx_to_entry(&pf->hw, tnl_type, idx); in ice_udp_tunnel_set_port()
587 status = ice_create_tunnel(&pf->hw, index, tnl_type, ntohs(ti->port)); in ice_udp_tunnel_set_port()
589 netdev_err(netdev, "Error adding UDP tunnel - %d\n", in ice_udp_tunnel_set_port()
591 return -EIO; in ice_udp_tunnel_set_port()
602 struct ice_vsi *vsi = np->vsi; in ice_udp_tunnel_unset_port()
603 struct ice_pf *pf = vsi->back; in ice_udp_tunnel_unset_port()
607 tnl_type = ti->type == UDP_TUNNEL_TYPE_VXLAN ? TNL_VXLAN : TNL_GENEVE; in ice_udp_tunnel_unset_port()
609 status = ice_destroy_tunnel(&pf->hw, ti->hw_priv, tnl_type, in ice_udp_tunnel_unset_port()
610 ntohs(ti->port)); in ice_udp_tunnel_unset_port()
612 netdev_err(netdev, "Error removing UDP tunnel - %d\n", in ice_udp_tunnel_unset_port()
614 return -EIO; in ice_udp_tunnel_unset_port()
621 * ice_find_prot_off - find prot ID and offset pair, based on prof and FV index
635 if (prof >= hw->blk[blk].es.count) in ice_find_prot_off()
636 return -EINVAL; in ice_find_prot_off()
638 if (fv_idx >= hw->blk[blk].es.fvw) in ice_find_prot_off()
639 return -EINVAL; in ice_find_prot_off()
641 fv_ext = hw->blk[blk].es.t + (prof * hw->blk[blk].es.fvw); in ice_find_prot_off()
652 * ice_ptg_find_ptype - Search for packet type group using packet type (ptype)
666 return -EINVAL; in ice_ptg_find_ptype()
668 *ptg = hw->blk[blk].xlt1.ptypes[ptype].ptg; in ice_ptg_find_ptype()
673 * ice_ptg_alloc_val - Allocates a new packet type group ID by value
683 hw->blk[blk].xlt1.ptg_tbl[ptg].in_use = true; in ice_ptg_alloc_val()
687 * ice_ptg_remove_ptype - Removes ptype from a particular packet type group
702 if (ptype > ICE_XLT1_CNT - 1) in ice_ptg_remove_ptype()
703 return -EINVAL; in ice_ptg_remove_ptype()
705 if (!hw->blk[blk].xlt1.ptg_tbl[ptg].in_use) in ice_ptg_remove_ptype()
706 return -ENOENT; in ice_ptg_remove_ptype()
709 if (!hw->blk[blk].xlt1.ptg_tbl[ptg].first_ptype) in ice_ptg_remove_ptype()
710 return -EIO; in ice_ptg_remove_ptype()
713 p = hw->blk[blk].xlt1.ptg_tbl[ptg].first_ptype; in ice_ptg_remove_ptype()
714 ch = &hw->blk[blk].xlt1.ptg_tbl[ptg].first_ptype; in ice_ptg_remove_ptype()
716 if (ptype == (p - hw->blk[blk].xlt1.ptypes)) { in ice_ptg_remove_ptype()
717 *ch = p->next_ptype; in ice_ptg_remove_ptype()
721 ch = &p->next_ptype; in ice_ptg_remove_ptype()
722 p = p->next_ptype; in ice_ptg_remove_ptype()
725 hw->blk[blk].xlt1.ptypes[ptype].ptg = ICE_DEFAULT_PTG; in ice_ptg_remove_ptype()
726 hw->blk[blk].xlt1.ptypes[ptype].next_ptype = NULL; in ice_ptg_remove_ptype()
732 * ice_ptg_add_mv_ptype - Adds/moves ptype to a particular packet type group
749 if (ptype > ICE_XLT1_CNT - 1) in ice_ptg_add_mv_ptype()
750 return -EINVAL; in ice_ptg_add_mv_ptype()
752 if (!hw->blk[blk].xlt1.ptg_tbl[ptg].in_use && ptg != ICE_DEFAULT_PTG) in ice_ptg_add_mv_ptype()
753 return -ENOENT; in ice_ptg_add_mv_ptype()
759 /* Is ptype already in the correct PTG? */ in ice_ptg_add_mv_ptype()
772 hw->blk[blk].xlt1.ptypes[ptype].next_ptype = in ice_ptg_add_mv_ptype()
773 hw->blk[blk].xlt1.ptg_tbl[ptg].first_ptype; in ice_ptg_add_mv_ptype()
774 hw->blk[blk].xlt1.ptg_tbl[ptg].first_ptype = in ice_ptg_add_mv_ptype()
775 &hw->blk[blk].xlt1.ptypes[ptype]; in ice_ptg_add_mv_ptype()
777 hw->blk[blk].xlt1.ptypes[ptype].ptg = ptg; in ice_ptg_add_mv_ptype()
778 hw->blk[blk].xlt1.t[ptype] = ptg; in ice_ptg_add_mv_ptype()
789 u8 prof_cdid_bits; /* # CDID one-hot bits used in key */
800 * XLT1 - Number of entries in XLT1 table
801 * XLT2 - Number of entries in XLT2 table
802 * TCAM - Number of entries Profile ID TCAM table
803 * CDID - Control Domain ID of the hardware block
804 * PRED - Number of entries in the Profile Redirection Table
805 * FV - Number of entries in the Field Vector
806 * FVW - Width (in WORDs) of the Field Vector
807 * OVR - Overwrite existing table entries
808 * REV - Reverse FV
836 * ice_match_prop_lst - determine if properties of two lists match
840 * Count, cookies and the order must match in order to be considered equivalent.
861 /* profile cookies must compare, and in the exact same order to take in ice_match_prop_lst()
864 while (count--) { in ice_match_prop_lst()
865 if (tmp2->profile_cookie != tmp1->profile_cookie) in ice_match_prop_lst()
878 * ice_vsig_find_vsi - find a VSIG that contains a specified VSI
884 * This function will lookup the VSI entry in the XLT2 list and return
891 return -EINVAL; in ice_vsig_find_vsi()
897 *vsig = hw->blk[blk].xlt2.vsis[vsi].vsig; in ice_vsig_find_vsi()
903 * ice_vsig_alloc_val - allocate a new VSIG by value
914 if (!hw->blk[blk].xlt2.vsig_tbl[idx].in_use) { in ice_vsig_alloc_val()
915 INIT_LIST_HEAD(&hw->blk[blk].xlt2.vsig_tbl[idx].prop_lst); in ice_vsig_alloc_val()
916 hw->blk[blk].xlt2.vsig_tbl[idx].in_use = true; in ice_vsig_alloc_val()
919 return ICE_VSIG_VALUE(idx, hw->pf_id); in ice_vsig_alloc_val()
923 * ice_vsig_alloc - Finds a free entry and allocates a new VSIG
935 if (!hw->blk[blk].xlt2.vsig_tbl[i].in_use) in ice_vsig_alloc()
942 * ice_find_dup_props_vsig - find VSI group with a specified set of properties
952 * matching configuration. In order to make sure that priorities are accounted
953 * for, the list must match exactly, including the order in which the
960 struct ice_xlt2 *xlt2 = &hw->blk[blk].xlt2; in ice_find_dup_props_vsig()
963 for (i = 0; i < xlt2->count; i++) in ice_find_dup_props_vsig()
964 if (xlt2->vsig_tbl[i].in_use && in ice_find_dup_props_vsig()
965 ice_match_prop_lst(chs, &xlt2->vsig_tbl[i].prop_lst)) { in ice_find_dup_props_vsig()
966 *vsig = ICE_VSIG_VALUE(i, hw->pf_id); in ice_find_dup_props_vsig()
970 return -ENOENT; in ice_find_dup_props_vsig()
974 * ice_vsig_free - free VSI group
990 return -EINVAL; in ice_vsig_free()
992 if (!hw->blk[blk].xlt2.vsig_tbl[idx].in_use) in ice_vsig_free()
993 return -ENOENT; in ice_vsig_free()
995 hw->blk[blk].xlt2.vsig_tbl[idx].in_use = false; in ice_vsig_free()
997 vsi_cur = hw->blk[blk].xlt2.vsig_tbl[idx].first_vsi; in ice_vsig_free()
1004 struct ice_vsig_vsi *tmp = vsi_cur->next_vsi; in ice_vsig_free()
1006 vsi_cur->vsig = ICE_DEFAULT_VSIG; in ice_vsig_free()
1007 vsi_cur->changed = 1; in ice_vsig_free()
1008 vsi_cur->next_vsi = NULL; in ice_vsig_free()
1013 hw->blk[blk].xlt2.vsig_tbl[idx].first_vsi = NULL; in ice_vsig_free()
1018 &hw->blk[blk].xlt2.vsig_tbl[idx].prop_lst, in ice_vsig_free()
1020 list_del(&del->list); in ice_vsig_free()
1025 * re-initialize the list head in ice_vsig_free()
1027 INIT_LIST_HEAD(&hw->blk[blk].xlt2.vsig_tbl[idx].prop_lst); in ice_vsig_free()
1033 * ice_vsig_remove_vsi - remove VSI from VSIG
1051 return -EINVAL; in ice_vsig_remove_vsi()
1053 if (!hw->blk[blk].xlt2.vsig_tbl[idx].in_use) in ice_vsig_remove_vsi()
1054 return -ENOENT; in ice_vsig_remove_vsi()
1056 /* entry already in default VSIG, don't have to remove */ in ice_vsig_remove_vsi()
1060 vsi_head = &hw->blk[blk].xlt2.vsig_tbl[idx].first_vsi; in ice_vsig_remove_vsi()
1062 return -EIO; in ice_vsig_remove_vsi()
1064 vsi_tgt = &hw->blk[blk].xlt2.vsis[vsi]; in ice_vsig_remove_vsi()
1070 (*vsi_head) = vsi_cur->next_vsi; in ice_vsig_remove_vsi()
1073 vsi_head = &vsi_cur->next_vsi; in ice_vsig_remove_vsi()
1074 vsi_cur = vsi_cur->next_vsi; in ice_vsig_remove_vsi()
1079 return -ENOENT; in ice_vsig_remove_vsi()
1081 vsi_cur->vsig = ICE_DEFAULT_VSIG; in ice_vsig_remove_vsi()
1082 vsi_cur->changed = 1; in ice_vsig_remove_vsi()
1083 vsi_cur->next_vsi = NULL; in ice_vsig_remove_vsi()
1089 * ice_vsig_add_mv_vsi - add or move a VSI to a VSI group
1110 return -EINVAL; in ice_vsig_add_mv_vsi()
1112 /* if VSIG not in use and VSIG is not default type this VSIG in ice_vsig_add_mv_vsi()
1115 if (!hw->blk[blk].xlt2.vsig_tbl[idx].in_use && in ice_vsig_add_mv_vsi()
1117 return -ENOENT; in ice_vsig_add_mv_vsi()
1138 hw->blk[blk].xlt2.vsis[vsi].vsig = vsig; in ice_vsig_add_mv_vsi()
1139 hw->blk[blk].xlt2.vsis[vsi].changed = 1; in ice_vsig_add_mv_vsi()
1142 tmp = hw->blk[blk].xlt2.vsig_tbl[idx].first_vsi; in ice_vsig_add_mv_vsi()
1143 hw->blk[blk].xlt2.vsig_tbl[idx].first_vsi = in ice_vsig_add_mv_vsi()
1144 &hw->blk[blk].xlt2.vsis[vsi]; in ice_vsig_add_mv_vsi()
1145 hw->blk[blk].xlt2.vsis[vsi].next_vsi = tmp; in ice_vsig_add_mv_vsi()
1146 hw->blk[blk].xlt2.t[vsi] = vsig; in ice_vsig_add_mv_vsi()
1152 * ice_prof_has_mask_idx - determine if profile index masking is identical
1172 /* Scan the enabled masks on this profile, for the specified idx */ in ice_prof_has_mask_idx()
1173 for (i = hw->blk[blk].masks.first; i < hw->blk[blk].masks.first + in ice_prof_has_mask_idx()
1174 hw->blk[blk].masks.count; i++) in ice_prof_has_mask_idx()
1175 if (hw->blk[blk].es.mask_ena[prof] & BIT(i)) in ice_prof_has_mask_idx()
1176 if (hw->blk[blk].masks.masks[i].in_use && in ice_prof_has_mask_idx()
1177 hw->blk[blk].masks.masks[i].idx == idx) { in ice_prof_has_mask_idx()
1179 if (hw->blk[blk].masks.masks[i].mask == mask) in ice_prof_has_mask_idx()
1196 * ice_prof_has_mask - determine if profile masking is identical
1200 * @masks: masks to match
1203 ice_prof_has_mask(struct ice_hw *hw, enum ice_block blk, u8 prof, u16 *masks) in ice_prof_has_mask() argument
1207 /* es->mask_ena[prof] will have the mask */ in ice_prof_has_mask()
1208 for (i = 0; i < hw->blk[blk].es.fvw; i++) in ice_prof_has_mask()
1209 if (!ice_prof_has_mask_idx(hw, blk, prof, i, masks[i])) in ice_prof_has_mask()
1216 * ice_find_prof_id_with_mask - find profile ID for a given field vector
1220 * @masks: masks for FV
1226 struct ice_fv_word *fv, u16 *masks, bool symm, in ice_find_prof_id_with_mask() argument
1229 struct ice_es *es = &hw->blk[blk].es; in ice_find_prof_id_with_mask()
1232 /* For FD, we don't want to re-use a existed profile with the same in ice_find_prof_id_with_mask()
1236 return -ENOENT; in ice_find_prof_id_with_mask()
1238 for (i = 0; i < (u8)es->count; i++) { in ice_find_prof_id_with_mask()
1239 u16 off = i * es->fvw; in ice_find_prof_id_with_mask()
1241 if (blk == ICE_BLK_RSS && es->symm[i] != symm) in ice_find_prof_id_with_mask()
1244 if (memcmp(&es->t[off], fv, es->fvw * sizeof(*fv))) in ice_find_prof_id_with_mask()
1247 /* check if masks settings are the same for this profile */ in ice_find_prof_id_with_mask()
1248 if (masks && !ice_prof_has_mask(hw, blk, i, masks)) in ice_find_prof_id_with_mask()
1255 return -ENOENT; in ice_find_prof_id_with_mask()
1259 * ice_prof_id_rsrc_type - get profile ID resource type for a block type
1279 * ice_tcam_ent_rsrc_type - get TCAM entry resource type for a block type
1299 * ice_alloc_tcam_ent - allocate hardware TCAM entry
1305 * This function allocates a new entry in a Profile ID TCAM for a specific
1315 return -EINVAL; in ice_alloc_tcam_ent()
1321 * ice_free_tcam_ent - free hardware TCAM entry
1326 * This function frees an entry in a Profile ID TCAM for a specific block.
1334 return -EINVAL; in ice_free_tcam_ent()
1340 * ice_alloc_prof_id - allocate profile ID
1355 return -EINVAL; in ice_alloc_prof_id()
1365 * ice_free_prof_id - free profile ID
1378 return -EINVAL; in ice_free_prof_id()
1384 * ice_prof_inc_ref - increment reference count for profile
1391 if (prof_id > hw->blk[blk].es.count) in ice_prof_inc_ref()
1392 return -EINVAL; in ice_prof_inc_ref()
1394 hw->blk[blk].es.ref_count[prof_id]++; in ice_prof_inc_ref()
1400 * ice_write_prof_mask_reg - write profile mask register
1405 * @mask: the 16-bit mask
1426 ice_debug(hw, ICE_DBG_PKG, "No profile masks for block %d\n", in ice_write_prof_mask_reg()
1437 * ice_write_prof_mask_enable_res - write profile mask enable register
1457 ice_debug(hw, ICE_DBG_PKG, "No profile masks for block %d\n", in ice_write_prof_mask_enable_res()
1468 * ice_init_prof_masks - initial prof masks
1477 mutex_init(&hw->blk[blk].masks.lock); in ice_init_prof_masks()
1479 per_pf = ICE_PROF_MASK_COUNT / hw->dev_caps.num_funcs; in ice_init_prof_masks()
1481 hw->blk[blk].masks.count = per_pf; in ice_init_prof_masks()
1482 hw->blk[blk].masks.first = hw->pf_id * per_pf; in ice_init_prof_masks()
1484 memset(hw->blk[blk].masks.masks, 0, sizeof(hw->blk[blk].masks.masks)); in ice_init_prof_masks()
1486 for (i = hw->blk[blk].masks.first; in ice_init_prof_masks()
1487 i < hw->blk[blk].masks.first + hw->blk[blk].masks.count; i++) in ice_init_prof_masks()
1492 * ice_init_all_prof_masks - initialize all prof masks
1502 * ice_alloc_prof_mask - allocate profile mask
1506 * @mask: the 16-bit mask
1515 int status = -ENOSPC; in ice_alloc_prof_mask()
1519 return -EINVAL; in ice_alloc_prof_mask()
1521 mutex_lock(&hw->blk[blk].masks.lock); in ice_alloc_prof_mask()
1523 for (i = hw->blk[blk].masks.first; in ice_alloc_prof_mask()
1524 i < hw->blk[blk].masks.first + hw->blk[blk].masks.count; i++) in ice_alloc_prof_mask()
1525 if (hw->blk[blk].masks.masks[i].in_use) { in ice_alloc_prof_mask()
1526 /* if mask is in use and it exactly duplicates the in ice_alloc_prof_mask()
1527 * desired mask and index, then in can be reused in ice_alloc_prof_mask()
1529 if (hw->blk[blk].masks.masks[i].mask == mask && in ice_alloc_prof_mask()
1530 hw->blk[blk].masks.masks[i].idx == idx) { in ice_alloc_prof_mask()
1536 /* save off unused index, but keep searching in case in ice_alloc_prof_mask()
1554 hw->blk[blk].masks.masks[i].in_use = true; in ice_alloc_prof_mask()
1555 hw->blk[blk].masks.masks[i].mask = mask; in ice_alloc_prof_mask()
1556 hw->blk[blk].masks.masks[i].idx = idx; in ice_alloc_prof_mask()
1557 hw->blk[blk].masks.masks[i].ref = 0; in ice_alloc_prof_mask()
1561 hw->blk[blk].masks.masks[i].ref++; in ice_alloc_prof_mask()
1566 mutex_unlock(&hw->blk[blk].masks.lock); in ice_alloc_prof_mask()
1572 * ice_free_prof_mask - free profile mask
1581 return -EINVAL; in ice_free_prof_mask()
1583 if (!(mask_idx >= hw->blk[blk].masks.first && in ice_free_prof_mask()
1584 mask_idx < hw->blk[blk].masks.first + hw->blk[blk].masks.count)) in ice_free_prof_mask()
1585 return -ENOENT; in ice_free_prof_mask()
1587 mutex_lock(&hw->blk[blk].masks.lock); in ice_free_prof_mask()
1589 if (!hw->blk[blk].masks.masks[mask_idx].in_use) in ice_free_prof_mask()
1592 if (hw->blk[blk].masks.masks[mask_idx].ref > 1) { in ice_free_prof_mask()
1593 hw->blk[blk].masks.masks[mask_idx].ref--; in ice_free_prof_mask()
1598 hw->blk[blk].masks.masks[mask_idx].in_use = false; in ice_free_prof_mask()
1599 hw->blk[blk].masks.masks[mask_idx].mask = 0; in ice_free_prof_mask()
1600 hw->blk[blk].masks.masks[mask_idx].idx = 0; in ice_free_prof_mask()
1608 mutex_unlock(&hw->blk[blk].masks.lock); in ice_free_prof_mask()
1614 * ice_free_prof_masks - free all profile masks for a profile
1626 return -EINVAL; in ice_free_prof_masks()
1628 mask_bm = hw->blk[blk].es.mask_ena[prof_id]; in ice_free_prof_masks()
1637 * ice_shutdown_prof_masks - releases lock for masking
1647 mutex_lock(&hw->blk[blk].masks.lock); in ice_shutdown_prof_masks()
1649 for (i = hw->blk[blk].masks.first; in ice_shutdown_prof_masks()
1650 i < hw->blk[blk].masks.first + hw->blk[blk].masks.count; i++) { in ice_shutdown_prof_masks()
1653 hw->blk[blk].masks.masks[i].in_use = false; in ice_shutdown_prof_masks()
1654 hw->blk[blk].masks.masks[i].idx = 0; in ice_shutdown_prof_masks()
1655 hw->blk[blk].masks.masks[i].mask = 0; in ice_shutdown_prof_masks()
1658 mutex_unlock(&hw->blk[blk].masks.lock); in ice_shutdown_prof_masks()
1659 mutex_destroy(&hw->blk[blk].masks.lock); in ice_shutdown_prof_masks()
1663 * ice_shutdown_all_prof_masks - releases all locks for masking
1675 * ice_update_prof_masking - set registers according to masking
1679 * @masks: masks
1683 u16 *masks) in ice_update_prof_masking() argument
1694 for (i = 0; i < hw->blk[blk].es.fvw; i++) in ice_update_prof_masking()
1695 if (masks[i] && masks[i] != 0xFFFF) { in ice_update_prof_masking()
1696 if (!ice_alloc_prof_mask(hw, blk, i, masks[i], &idx)) { in ice_update_prof_masking()
1711 return -EIO; in ice_update_prof_masking()
1714 /* enable the masks for this profile */ in ice_update_prof_masking()
1717 /* store enabled masks with profile so that they can be freed later */ in ice_update_prof_masking()
1718 hw->blk[blk].es.mask_ena[prof_id] = ena_mask; in ice_update_prof_masking()
1724 * ice_write_es - write an extraction sequence and symmetric setting to hardware
1726 * @blk: the block in which to write the extraction sequence
1728 * @fv: pointer to the extraction sequence to write - NULL to clear extraction
1737 off = prof_id * hw->blk[blk].es.fvw; in ice_write_es()
1739 memset(&hw->blk[blk].es.t[off], 0, in ice_write_es()
1740 hw->blk[blk].es.fvw * sizeof(*fv)); in ice_write_es()
1741 hw->blk[blk].es.written[prof_id] = false; in ice_write_es()
1743 memcpy(&hw->blk[blk].es.t[off], fv, in ice_write_es()
1744 hw->blk[blk].es.fvw * sizeof(*fv)); in ice_write_es()
1748 hw->blk[blk].es.symm[prof_id] = symm; in ice_write_es()
1752 * ice_prof_dec_ref - decrement reference count for profile
1760 if (prof_id > hw->blk[blk].es.count) in ice_prof_dec_ref()
1761 return -EINVAL; in ice_prof_dec_ref()
1763 if (hw->blk[blk].es.ref_count[prof_id] > 0) { in ice_prof_dec_ref()
1764 if (!--hw->blk[blk].es.ref_count[prof_id]) { in ice_prof_dec_ref()
1818 * ice_init_sw_xlt1_db - init software XLT1 database from HW tables
1826 for (pt = 0; pt < hw->blk[blk].xlt1.count; pt++) { in ice_init_sw_xlt1_db()
1829 ptg = hw->blk[blk].xlt1.t[pt]; in ice_init_sw_xlt1_db()
1838 * ice_init_sw_xlt2_db - init software XLT2 database from HW tables
1846 for (vsi = 0; vsi < hw->blk[blk].xlt2.count; vsi++) { in ice_init_sw_xlt2_db()
1849 vsig = hw->blk[blk].xlt2.t[vsi]; in ice_init_sw_xlt2_db()
1856 hw->blk[blk].xlt2.vsis[vsi].changed = 0; in ice_init_sw_xlt2_db()
1862 * ice_init_sw_db - init software database from HW tables
1876 * ice_fill_tbl - Reads content of a single table type into database
1883 * be as large or larger than the data contained in the package. If
1884 * this condition is not met, there is most likely an error in the package
1900 * ice_pkg_enum_section() will fail. In this case the HW tables will in ice_fill_tbl()
1903 if (!hw->seg) { in ice_fill_tbl()
1904 ice_debug(hw, ICE_DBG_PKG, "hw->seg is NULL, tables are not filled\n"); in ice_fill_tbl()
1910 sect = ice_pkg_enum_section(hw->seg, &state, sid); in ice_fill_tbl()
1920 src = xlt1->value; in ice_fill_tbl()
1921 sect_len = le16_to_cpu(xlt1->count) * in ice_fill_tbl()
1922 sizeof(*hw->blk[block_id].xlt1.t); in ice_fill_tbl()
1923 dst = hw->blk[block_id].xlt1.t; in ice_fill_tbl()
1924 dst_len = hw->blk[block_id].xlt1.count * in ice_fill_tbl()
1925 sizeof(*hw->blk[block_id].xlt1.t); in ice_fill_tbl()
1933 src = (__force u8 *)xlt2->value; in ice_fill_tbl()
1934 sect_len = le16_to_cpu(xlt2->count) * in ice_fill_tbl()
1935 sizeof(*hw->blk[block_id].xlt2.t); in ice_fill_tbl()
1936 dst = (u8 *)hw->blk[block_id].xlt2.t; in ice_fill_tbl()
1937 dst_len = hw->blk[block_id].xlt2.count * in ice_fill_tbl()
1938 sizeof(*hw->blk[block_id].xlt2.t); in ice_fill_tbl()
1946 src = (u8 *)pid->entry; in ice_fill_tbl()
1947 sect_len = le16_to_cpu(pid->count) * in ice_fill_tbl()
1948 sizeof(*hw->blk[block_id].prof.t); in ice_fill_tbl()
1949 dst = (u8 *)hw->blk[block_id].prof.t; in ice_fill_tbl()
1950 dst_len = hw->blk[block_id].prof.count * in ice_fill_tbl()
1951 sizeof(*hw->blk[block_id].prof.t); in ice_fill_tbl()
1959 src = pr->redir_value; in ice_fill_tbl()
1960 sect_len = le16_to_cpu(pr->count) * in ice_fill_tbl()
1961 sizeof(*hw->blk[block_id].prof_redir.t); in ice_fill_tbl()
1962 dst = hw->blk[block_id].prof_redir.t; in ice_fill_tbl()
1963 dst_len = hw->blk[block_id].prof_redir.count * in ice_fill_tbl()
1964 sizeof(*hw->blk[block_id].prof_redir.t); in ice_fill_tbl()
1972 src = (u8 *)es->fv; in ice_fill_tbl()
1973 sect_len = (u32)(le16_to_cpu(es->count) * in ice_fill_tbl()
1974 hw->blk[block_id].es.fvw) * in ice_fill_tbl()
1975 sizeof(*hw->blk[block_id].es.t); in ice_fill_tbl()
1976 dst = (u8 *)hw->blk[block_id].es.t; in ice_fill_tbl()
1977 dst_len = (u32)(hw->blk[block_id].es.count * in ice_fill_tbl()
1978 hw->blk[block_id].es.fvw) * in ice_fill_tbl()
1979 sizeof(*hw->blk[block_id].es.t); in ice_fill_tbl()
1997 sect_len = dst_len - offset; in ice_fill_tbl()
2006 * ice_fill_blk_tbls - Read package context for tables
2020 ice_fill_tbl(hw, blk_id, hw->blk[blk_id].xlt1.sid); in ice_fill_blk_tbls()
2021 ice_fill_tbl(hw, blk_id, hw->blk[blk_id].xlt2.sid); in ice_fill_blk_tbls()
2022 ice_fill_tbl(hw, blk_id, hw->blk[blk_id].prof.sid); in ice_fill_blk_tbls()
2023 ice_fill_tbl(hw, blk_id, hw->blk[blk_id].prof_redir.sid); in ice_fill_blk_tbls()
2024 ice_fill_tbl(hw, blk_id, hw->blk[blk_id].es.sid); in ice_fill_blk_tbls()
2031 * ice_free_prof_map - free profile map
2037 struct ice_es *es = &hw->blk[blk_idx].es; in ice_free_prof_map()
2040 mutex_lock(&es->prof_map_lock); in ice_free_prof_map()
2041 list_for_each_entry_safe(del, tmp, &es->prof_map, list) { in ice_free_prof_map()
2042 list_del(&del->list); in ice_free_prof_map()
2045 INIT_LIST_HEAD(&es->prof_map); in ice_free_prof_map()
2046 mutex_unlock(&es->prof_map_lock); in ice_free_prof_map()
2050 * ice_free_flow_profs - free flow profile entries
2058 mutex_lock(&hw->fl_profs_locks[blk_idx]); in ice_free_flow_profs()
2059 list_for_each_entry_safe(p, tmp, &hw->fl_profs[blk_idx], l_entry) { in ice_free_flow_profs()
2062 list_for_each_entry_safe(e, t, &p->entries, l_entry) in ice_free_flow_profs()
2066 list_del(&p->l_entry); in ice_free_flow_profs()
2068 mutex_destroy(&p->entries_lock); in ice_free_flow_profs()
2071 mutex_unlock(&hw->fl_profs_locks[blk_idx]); in ice_free_flow_profs()
2073 /* if driver is in reset and tables are being cleared in ice_free_flow_profs()
2074 * re-initialize the flow profile list heads in ice_free_flow_profs()
2076 INIT_LIST_HEAD(&hw->fl_profs[blk_idx]); in ice_free_flow_profs()
2080 * ice_free_vsig_tbl - free complete VSIG table entries
2088 if (!hw->blk[blk].xlt2.vsig_tbl) in ice_free_vsig_tbl()
2092 if (hw->blk[blk].xlt2.vsig_tbl[i].in_use) in ice_free_vsig_tbl()
2097 * ice_free_hw_tbls - free hardware table memory
2106 if (hw->blk[i].is_list_init) { in ice_free_hw_tbls()
2107 struct ice_es *es = &hw->blk[i].es; in ice_free_hw_tbls()
2110 mutex_destroy(&es->prof_map_lock); in ice_free_hw_tbls()
2113 mutex_destroy(&hw->fl_profs_locks[i]); in ice_free_hw_tbls()
2115 hw->blk[i].is_list_init = false; in ice_free_hw_tbls()
2118 devm_kfree(ice_hw_to_dev(hw), hw->blk[i].xlt1.ptypes); in ice_free_hw_tbls()
2119 devm_kfree(ice_hw_to_dev(hw), hw->blk[i].xlt1.ptg_tbl); in ice_free_hw_tbls()
2120 devm_kfree(ice_hw_to_dev(hw), hw->blk[i].xlt1.t); in ice_free_hw_tbls()
2121 devm_kfree(ice_hw_to_dev(hw), hw->blk[i].xlt2.t); in ice_free_hw_tbls()
2122 devm_kfree(ice_hw_to_dev(hw), hw->blk[i].xlt2.vsig_tbl); in ice_free_hw_tbls()
2123 devm_kfree(ice_hw_to_dev(hw), hw->blk[i].xlt2.vsis); in ice_free_hw_tbls()
2124 devm_kfree(ice_hw_to_dev(hw), hw->blk[i].prof.t); in ice_free_hw_tbls()
2125 devm_kfree(ice_hw_to_dev(hw), hw->blk[i].prof_redir.t); in ice_free_hw_tbls()
2126 devm_kfree(ice_hw_to_dev(hw), hw->blk[i].es.t); in ice_free_hw_tbls()
2127 devm_kfree(ice_hw_to_dev(hw), hw->blk[i].es.ref_count); in ice_free_hw_tbls()
2128 devm_kfree(ice_hw_to_dev(hw), hw->blk[i].es.symm); in ice_free_hw_tbls()
2129 devm_kfree(ice_hw_to_dev(hw), hw->blk[i].es.written); in ice_free_hw_tbls()
2130 devm_kfree(ice_hw_to_dev(hw), hw->blk[i].es.mask_ena); in ice_free_hw_tbls()
2131 devm_kfree(ice_hw_to_dev(hw), hw->blk[i].prof_id.id); in ice_free_hw_tbls()
2134 list_for_each_entry_safe(r, rt, &hw->rss_list_head, l_entry) { in ice_free_hw_tbls()
2135 list_del(&r->l_entry); in ice_free_hw_tbls()
2138 mutex_destroy(&hw->rss_locks); in ice_free_hw_tbls()
2140 memset(hw->blk, 0, sizeof(hw->blk)); in ice_free_hw_tbls()
2144 * ice_init_flow_profs - init flow profile locks and list heads
2150 mutex_init(&hw->fl_profs_locks[blk_idx]); in ice_init_flow_profs()
2151 INIT_LIST_HEAD(&hw->fl_profs[blk_idx]); in ice_init_flow_profs()
2155 * ice_clear_hw_tbls - clear HW tables and flow profiles
2163 struct ice_prof_redir *prof_redir = &hw->blk[i].prof_redir; in ice_clear_hw_tbls()
2164 struct ice_prof_id *prof_id = &hw->blk[i].prof_id; in ice_clear_hw_tbls()
2165 struct ice_prof_tcam *prof = &hw->blk[i].prof; in ice_clear_hw_tbls()
2166 struct ice_xlt1 *xlt1 = &hw->blk[i].xlt1; in ice_clear_hw_tbls()
2167 struct ice_xlt2 *xlt2 = &hw->blk[i].xlt2; in ice_clear_hw_tbls()
2168 struct ice_es *es = &hw->blk[i].es; in ice_clear_hw_tbls()
2170 if (hw->blk[i].is_list_init) { in ice_clear_hw_tbls()
2177 memset(xlt1->ptypes, 0, xlt1->count * sizeof(*xlt1->ptypes)); in ice_clear_hw_tbls()
2178 memset(xlt1->ptg_tbl, 0, in ice_clear_hw_tbls()
2179 ICE_MAX_PTGS * sizeof(*xlt1->ptg_tbl)); in ice_clear_hw_tbls()
2180 memset(xlt1->t, 0, xlt1->count * sizeof(*xlt1->t)); in ice_clear_hw_tbls()
2182 memset(xlt2->vsis, 0, xlt2->count * sizeof(*xlt2->vsis)); in ice_clear_hw_tbls()
2183 memset(xlt2->vsig_tbl, 0, in ice_clear_hw_tbls()
2184 xlt2->count * sizeof(*xlt2->vsig_tbl)); in ice_clear_hw_tbls()
2185 memset(xlt2->t, 0, xlt2->count * sizeof(*xlt2->t)); in ice_clear_hw_tbls()
2187 memset(prof->t, 0, prof->count * sizeof(*prof->t)); in ice_clear_hw_tbls()
2188 memset(prof_redir->t, 0, in ice_clear_hw_tbls()
2189 prof_redir->count * sizeof(*prof_redir->t)); in ice_clear_hw_tbls()
2191 memset(es->t, 0, es->count * sizeof(*es->t) * es->fvw); in ice_clear_hw_tbls()
2192 memset(es->ref_count, 0, es->count * sizeof(*es->ref_count)); in ice_clear_hw_tbls()
2193 memset(es->symm, 0, es->count * sizeof(*es->symm)); in ice_clear_hw_tbls()
2194 memset(es->written, 0, es->count * sizeof(*es->written)); in ice_clear_hw_tbls()
2195 memset(es->mask_ena, 0, es->count * sizeof(*es->mask_ena)); in ice_clear_hw_tbls()
2197 memset(prof_id->id, 0, prof_id->count * sizeof(*prof_id->id)); in ice_clear_hw_tbls()
2202 * ice_init_hw_tbls - init hardware table memory
2209 mutex_init(&hw->rss_locks); in ice_init_hw_tbls()
2210 INIT_LIST_HEAD(&hw->rss_list_head); in ice_init_hw_tbls()
2213 struct ice_prof_redir *prof_redir = &hw->blk[i].prof_redir; in ice_init_hw_tbls()
2214 struct ice_prof_id *prof_id = &hw->blk[i].prof_id; in ice_init_hw_tbls()
2215 struct ice_prof_tcam *prof = &hw->blk[i].prof; in ice_init_hw_tbls()
2216 struct ice_xlt1 *xlt1 = &hw->blk[i].xlt1; in ice_init_hw_tbls()
2217 struct ice_xlt2 *xlt2 = &hw->blk[i].xlt2; in ice_init_hw_tbls()
2218 struct ice_es *es = &hw->blk[i].es; in ice_init_hw_tbls()
2221 if (hw->blk[i].is_list_init) in ice_init_hw_tbls()
2225 mutex_init(&es->prof_map_lock); in ice_init_hw_tbls()
2226 INIT_LIST_HEAD(&es->prof_map); in ice_init_hw_tbls()
2227 hw->blk[i].is_list_init = true; in ice_init_hw_tbls()
2229 hw->blk[i].overwrite = blk_sizes[i].overwrite; in ice_init_hw_tbls()
2230 es->reverse = blk_sizes[i].reverse; in ice_init_hw_tbls()
2232 xlt1->sid = ice_blk_sids[i][ICE_SID_XLT1_OFF]; in ice_init_hw_tbls()
2233 xlt1->count = blk_sizes[i].xlt1; in ice_init_hw_tbls()
2235 xlt1->ptypes = devm_kcalloc(ice_hw_to_dev(hw), xlt1->count, in ice_init_hw_tbls()
2236 sizeof(*xlt1->ptypes), GFP_KERNEL); in ice_init_hw_tbls()
2238 if (!xlt1->ptypes) in ice_init_hw_tbls()
2241 xlt1->ptg_tbl = devm_kcalloc(ice_hw_to_dev(hw), ICE_MAX_PTGS, in ice_init_hw_tbls()
2242 sizeof(*xlt1->ptg_tbl), in ice_init_hw_tbls()
2245 if (!xlt1->ptg_tbl) in ice_init_hw_tbls()
2248 xlt1->t = devm_kcalloc(ice_hw_to_dev(hw), xlt1->count, in ice_init_hw_tbls()
2249 sizeof(*xlt1->t), GFP_KERNEL); in ice_init_hw_tbls()
2250 if (!xlt1->t) in ice_init_hw_tbls()
2253 xlt2->sid = ice_blk_sids[i][ICE_SID_XLT2_OFF]; in ice_init_hw_tbls()
2254 xlt2->count = blk_sizes[i].xlt2; in ice_init_hw_tbls()
2256 xlt2->vsis = devm_kcalloc(ice_hw_to_dev(hw), xlt2->count, in ice_init_hw_tbls()
2257 sizeof(*xlt2->vsis), GFP_KERNEL); in ice_init_hw_tbls()
2259 if (!xlt2->vsis) in ice_init_hw_tbls()
2262 xlt2->vsig_tbl = devm_kcalloc(ice_hw_to_dev(hw), xlt2->count, in ice_init_hw_tbls()
2263 sizeof(*xlt2->vsig_tbl), in ice_init_hw_tbls()
2265 if (!xlt2->vsig_tbl) in ice_init_hw_tbls()
2268 for (j = 0; j < xlt2->count; j++) in ice_init_hw_tbls()
2269 INIT_LIST_HEAD(&xlt2->vsig_tbl[j].prop_lst); in ice_init_hw_tbls()
2271 xlt2->t = devm_kcalloc(ice_hw_to_dev(hw), xlt2->count, in ice_init_hw_tbls()
2272 sizeof(*xlt2->t), GFP_KERNEL); in ice_init_hw_tbls()
2273 if (!xlt2->t) in ice_init_hw_tbls()
2276 prof->sid = ice_blk_sids[i][ICE_SID_PR_OFF]; in ice_init_hw_tbls()
2277 prof->count = blk_sizes[i].prof_tcam; in ice_init_hw_tbls()
2278 prof->max_prof_id = blk_sizes[i].prof_id; in ice_init_hw_tbls()
2279 prof->cdid_bits = blk_sizes[i].prof_cdid_bits; in ice_init_hw_tbls()
2280 prof->t = devm_kcalloc(ice_hw_to_dev(hw), prof->count, in ice_init_hw_tbls()
2281 sizeof(*prof->t), GFP_KERNEL); in ice_init_hw_tbls()
2283 if (!prof->t) in ice_init_hw_tbls()
2286 prof_redir->sid = ice_blk_sids[i][ICE_SID_PR_REDIR_OFF]; in ice_init_hw_tbls()
2287 prof_redir->count = blk_sizes[i].prof_redir; in ice_init_hw_tbls()
2288 prof_redir->t = devm_kcalloc(ice_hw_to_dev(hw), in ice_init_hw_tbls()
2289 prof_redir->count, in ice_init_hw_tbls()
2290 sizeof(*prof_redir->t), in ice_init_hw_tbls()
2293 if (!prof_redir->t) in ice_init_hw_tbls()
2296 es->sid = ice_blk_sids[i][ICE_SID_ES_OFF]; in ice_init_hw_tbls()
2297 es->count = blk_sizes[i].es; in ice_init_hw_tbls()
2298 es->fvw = blk_sizes[i].fvw; in ice_init_hw_tbls()
2299 es->t = devm_kcalloc(ice_hw_to_dev(hw), in ice_init_hw_tbls()
2300 (u32)(es->count * es->fvw), in ice_init_hw_tbls()
2301 sizeof(*es->t), GFP_KERNEL); in ice_init_hw_tbls()
2302 if (!es->t) in ice_init_hw_tbls()
2305 es->ref_count = devm_kcalloc(ice_hw_to_dev(hw), es->count, in ice_init_hw_tbls()
2306 sizeof(*es->ref_count), in ice_init_hw_tbls()
2308 if (!es->ref_count) in ice_init_hw_tbls()
2311 es->symm = devm_kcalloc(ice_hw_to_dev(hw), es->count, in ice_init_hw_tbls()
2312 sizeof(*es->symm), GFP_KERNEL); in ice_init_hw_tbls()
2313 if (!es->symm) in ice_init_hw_tbls()
2316 es->written = devm_kcalloc(ice_hw_to_dev(hw), es->count, in ice_init_hw_tbls()
2317 sizeof(*es->written), GFP_KERNEL); in ice_init_hw_tbls()
2318 if (!es->written) in ice_init_hw_tbls()
2321 es->mask_ena = devm_kcalloc(ice_hw_to_dev(hw), es->count, in ice_init_hw_tbls()
2322 sizeof(*es->mask_ena), GFP_KERNEL); in ice_init_hw_tbls()
2323 if (!es->mask_ena) in ice_init_hw_tbls()
2326 prof_id->count = blk_sizes[i].prof_id; in ice_init_hw_tbls()
2327 prof_id->id = devm_kcalloc(ice_hw_to_dev(hw), prof_id->count, in ice_init_hw_tbls()
2328 sizeof(*prof_id->id), GFP_KERNEL); in ice_init_hw_tbls()
2329 if (!prof_id->id) in ice_init_hw_tbls()
2336 return -ENOMEM; in ice_init_hw_tbls()
2340 * ice_prof_gen_key - generate profile ID key
2342 * @blk: the block in which to write profile ID to
2364 switch (hw->blk[blk].prof.cdid_bits) { in ice_prof_gen_key()
2386 ice_debug(hw, ICE_DBG_PKG, "Error in profile config\n"); in ice_prof_gen_key()
2395 * ice_tcam_write_entry - write TCAM entry
2397 * @blk: the block in which to write profile ID to
2419 dc_msk, nm_msk, hw->blk[blk].prof.t[idx].key); in ice_tcam_write_entry()
2421 hw->blk[blk].prof.t[idx].addr = cpu_to_le16(idx); in ice_tcam_write_entry()
2422 hw->blk[blk].prof.t[idx].prof_id = prof_id; in ice_tcam_write_entry()
2429 * ice_vsig_get_ref - returns number of VSIs belong to a VSIG
2443 if (!hw->blk[blk].xlt2.vsig_tbl[idx].in_use) in ice_vsig_get_ref()
2444 return -ENOENT; in ice_vsig_get_ref()
2446 ptr = hw->blk[blk].xlt2.vsig_tbl[idx].first_vsi; in ice_vsig_get_ref()
2449 ptr = ptr->next_vsi; in ice_vsig_get_ref()
2456 * ice_has_prof_vsig - check to see if VSIG has a specific profile
2468 list_for_each_entry(ent, &hw->blk[blk].xlt2.vsig_tbl[idx].prop_lst, in ice_has_prof_vsig()
2470 if (ent->profile_cookie == hdl) in ice_has_prof_vsig()
2479 * ice_prof_bld_es - build profile ID extraction sequence changes
2483 * @chgs: the list of changes to make in hardware
2489 u16 vec_size = hw->blk[blk].es.fvw * sizeof(struct ice_fv_word); in ice_prof_bld_es()
2493 if (tmp->type == ICE_PTG_ES_ADD && tmp->add_prof) { in ice_prof_bld_es()
2494 u16 off = tmp->prof_id * hw->blk[blk].es.fvw; in ice_prof_bld_es()
2501 vec_size - in ice_prof_bld_es()
2502 sizeof(p->es[0])); in ice_prof_bld_es()
2505 return -ENOSPC; in ice_prof_bld_es()
2507 p->count = cpu_to_le16(1); in ice_prof_bld_es()
2508 p->offset = cpu_to_le16(tmp->prof_id); in ice_prof_bld_es()
2510 memcpy(p->es, &hw->blk[blk].es.t[off], vec_size); in ice_prof_bld_es()
2517 * ice_prof_bld_tcam - build profile ID TCAM changes
2521 * @chgs: the list of changes to make in hardware
2530 if (tmp->type == ICE_TCAM_ADD && tmp->add_tcam_idx) { in ice_prof_bld_tcam()
2539 return -ENOSPC; in ice_prof_bld_tcam()
2541 p->count = cpu_to_le16(1); in ice_prof_bld_tcam()
2542 p->entry[0].addr = cpu_to_le16(tmp->tcam_idx); in ice_prof_bld_tcam()
2543 p->entry[0].prof_id = tmp->prof_id; in ice_prof_bld_tcam()
2545 memcpy(p->entry[0].key, in ice_prof_bld_tcam()
2546 &hw->blk[blk].prof.t[tmp->tcam_idx].key, in ice_prof_bld_tcam()
2547 sizeof(hw->blk[blk].prof.t->key)); in ice_prof_bld_tcam()
2554 * ice_prof_bld_xlt1 - build XLT1 changes
2557 * @chgs: the list of changes to make in hardware
2566 if (tmp->type == ICE_PTG_ES_ADD && tmp->add_ptg) { in ice_prof_bld_xlt1()
2575 return -ENOSPC; in ice_prof_bld_xlt1()
2577 p->count = cpu_to_le16(1); in ice_prof_bld_xlt1()
2578 p->offset = cpu_to_le16(tmp->ptype); in ice_prof_bld_xlt1()
2579 p->value[0] = tmp->ptg; in ice_prof_bld_xlt1()
2586 * ice_prof_bld_xlt2 - build XLT2 changes
2589 * @chgs: the list of changes to make in hardware
2601 switch (tmp->type) { in ice_prof_bld_xlt2()
2610 return -ENOSPC; in ice_prof_bld_xlt2()
2612 p->count = cpu_to_le16(1); in ice_prof_bld_xlt2()
2613 p->offset = cpu_to_le16(tmp->vsi); in ice_prof_bld_xlt2()
2614 p->value[0] = cpu_to_le16(tmp->vsig); in ice_prof_bld_xlt2()
2625 * ice_upd_prof_hw - update hardware using the change list
2628 * @chgs: the list of changes to make in hardware
2646 switch (tmp->type) { in ice_upd_prof_hw()
2648 if (tmp->add_ptg) in ice_upd_prof_hw()
2650 if (tmp->add_prof) in ice_upd_prof_hw()
2673 return -ENOMEM; in ice_upd_prof_hw()
2704 /* After package buffer build check if the section count in buffer is in ice_upd_prof_hw()
2705 * non-zero and matches the number of sections detected for package in ice_upd_prof_hw()
2710 status = -EINVAL; in ice_upd_prof_hw()
2716 if (status == -EIO) in ice_upd_prof_hw()
2725 * ice_update_fd_mask - set Flow Director Field Vector mask for a profile
2730 * This function enable any of the masks selected by the mask select parameter
2748 /* These are defined in pairs */
2777 * ice_update_fd_swap - set register appropriately for a FD FV extraction
2787 #define ICE_FD_FV_NOT_FOUND (-2) in ice_update_fd_swap()
2803 for (i = 0; i < hw->blk[ICE_BLK_FD].es.fvw; i++) { in ice_update_fd_swap()
2809 first_free = i - 1; in ice_update_fd_swap()
2837 return -ENOSPC; in ice_update_fd_swap()
2839 /* place in extraction sequence */ in ice_update_fd_swap()
2841 es[first_free - k].prot_id = in ice_update_fd_swap()
2843 es[first_free - k].off = in ice_update_fd_swap()
2847 return -EIO; in ice_update_fd_swap()
2849 /* keep track of non-relevant fields */ in ice_update_fd_swap()
2850 mask_sel |= BIT(first_free - k); in ice_update_fd_swap()
2854 first_free -= ice_fd_pairs[index].count; in ice_update_fd_swap()
2858 /* fill in the swap array */ in ice_update_fd_swap()
2859 si = hw->blk[ICE_BLK_FD].es.fvw - 1; in ice_update_fd_swap()
2868 si -= indexes_used; in ice_update_fd_swap()
2879 idx = j + ((j % 2) ? -1 : 1); in ice_update_fd_swap()
2883 used[si - k] = (pair_start[idx] - k) | in ice_update_fd_swap()
2890 si -= indexes_used; in ice_update_fd_swap()
2896 for (j = 0; j < hw->blk[ICE_BLK_FD].es.fvw / 4; j++) { in ice_update_fd_swap()
2939 * ice_get_ptype_attrib_info - get PTYPE attribute information
2951 * ice_add_prof_attrib - add any PTG with attributes to profile
2956 * @attr_cnt: number of elements in the attribute array
2969 prof->ptg[prof->ptg_cnt] = ptg; in ice_add_prof_attrib()
2971 &prof->attr[prof->ptg_cnt]); in ice_add_prof_attrib()
2973 if (++prof->ptg_cnt >= ICE_MAX_PTG_PER_PROFILE) in ice_add_prof_attrib()
2974 return -ENOSPC; in ice_add_prof_attrib()
2978 return -ENOENT; in ice_add_prof_attrib()
2984 * ice_disable_fd_swap - set register appropriately to disable FD SWAP
2995 fvw_num = hw->blk[ICE_BLK_FD].es.fvw / ICE_FDIR_REG_SET_SIZE; in ice_disable_fd_swap()
2997 /* Since the SWAP Flag in the Programming Desc doesn't work, in ice_disable_fd_swap()
3028 * ice_add_prof - add profile
3034 * @attr_cnt: number of elements in attr array
3036 * @masks: mask for extraction sequence
3048 struct ice_fv_word *es, u16 *masks, bool symm, bool fd_swap) in ice_add_prof() argument
3059 mutex_lock(&hw->blk[blk].es.prof_map_lock); in ice_add_prof()
3062 status = ice_find_prof_id_with_mask(hw, blk, es, masks, symm, &prof_id); in ice_add_prof()
3070 * need to be altered in the case where there are paired in ice_add_prof()
3082 status = ice_update_prof_masking(hw, blk, prof_id, masks); in ice_add_prof()
3095 status = -ENOMEM; in ice_add_prof()
3099 prof->profile_cookie = id; in ice_add_prof()
3100 prof->prof_id = prof_id; in ice_add_prof()
3101 prof->ptg_cnt = 0; in ice_add_prof()
3102 prof->context = 0; in ice_add_prof()
3105 while (bytes && prof->ptg_cnt < ICE_MAX_PTG_PER_PROFILE) { in ice_add_prof()
3109 bytes--; in ice_add_prof()
3122 /* The package should place all ptypes in a non-zero in ice_add_prof()
3138 if (status == -ENOSPC) in ice_add_prof()
3144 prof->ptg[prof->ptg_cnt] = ptg; in ice_add_prof()
3145 prof->attr[prof->ptg_cnt].flags = 0; in ice_add_prof()
3146 prof->attr[prof->ptg_cnt].mask = 0; in ice_add_prof()
3148 if (++prof->ptg_cnt >= in ice_add_prof()
3154 bytes--; in ice_add_prof()
3158 list_add(&prof->list, &hw->blk[blk].es.prof_map); in ice_add_prof()
3162 mutex_unlock(&hw->blk[blk].es.prof_map_lock); in ice_add_prof()
3167 * ice_search_prof_id - Search for a profile tracking ID
3181 list_for_each_entry(map, &hw->blk[blk].es.prof_map, list) in ice_search_prof_id()
3182 if (map->profile_cookie == id) { in ice_search_prof_id()
3191 * ice_vsig_prof_id_count - count profiles in a VSIG
3202 list_for_each_entry(p, &hw->blk[blk].xlt2.vsig_tbl[idx].prop_lst, in ice_vsig_prof_id_count()
3210 * ice_rel_tcam_idx - release a TCAM index
3217 /* Masks to invoke a never match entry */ in ice_rel_tcam_idx()
3236 * ice_rem_prof_id - remove one profile from a VSIG
3248 for (i = 0; i < prof->tcam_count; i++) in ice_rem_prof_id()
3249 if (prof->tcam[i].in_use) { in ice_rem_prof_id()
3250 prof->tcam[i].in_use = false; in ice_rem_prof_id()
3252 prof->tcam[i].tcam_idx); in ice_rem_prof_id()
3254 return -EIO; in ice_rem_prof_id()
3261 * ice_rem_vsig - remove VSIG
3277 &hw->blk[blk].xlt2.vsig_tbl[idx].prop_lst, in ice_rem_vsig()
3285 list_del(&d->list); in ice_rem_vsig()
3290 vsi_cur = hw->blk[blk].xlt2.vsig_tbl[idx].first_vsi; in ice_rem_vsig()
3296 struct ice_vsig_vsi *tmp = vsi_cur->next_vsi; in ice_rem_vsig()
3302 return -ENOMEM; in ice_rem_vsig()
3304 p->type = ICE_VSIG_REM; in ice_rem_vsig()
3305 p->orig_vsig = vsig; in ice_rem_vsig()
3306 p->vsig = ICE_DEFAULT_VSIG; in ice_rem_vsig()
3307 p->vsi = vsi_cur - hw->blk[blk].xlt2.vsis; in ice_rem_vsig()
3309 list_add(&p->list_entry, chg); in ice_rem_vsig()
3318 * ice_rem_prof_id_vsig - remove a specific profile from a VSIG
3333 &hw->blk[blk].xlt2.vsig_tbl[idx].prop_lst, in ice_rem_prof_id_vsig()
3335 if (p->profile_cookie == hdl) { in ice_rem_prof_id_vsig()
3344 list_del(&p->list); in ice_rem_prof_id_vsig()
3350 return -ENOENT; in ice_rem_prof_id_vsig()
3354 * ice_rem_flow_all - remove all flows with a particular profile
3369 if (hw->blk[blk].xlt2.vsig_tbl[i].in_use) { in ice_rem_flow_all()
3382 list_del(&del->list_entry); in ice_rem_flow_all()
3390 * ice_rem_prof - remove profile
3404 mutex_lock(&hw->blk[blk].es.prof_map_lock); in ice_rem_prof()
3408 status = -ENOENT; in ice_rem_prof()
3413 status = ice_rem_flow_all(hw, blk, pmap->profile_cookie); in ice_rem_prof()
3418 ice_prof_dec_ref(hw, blk, pmap->prof_id); in ice_rem_prof()
3420 list_del(&pmap->list); in ice_rem_prof()
3424 mutex_unlock(&hw->blk[blk].es.prof_map_lock); in ice_rem_prof()
3429 * ice_get_prof - get profile
3444 mutex_lock(&hw->blk[blk].es.prof_map_lock); in ice_get_prof()
3448 status = -ENOENT; in ice_get_prof()
3452 for (i = 0; i < map->ptg_cnt; i++) in ice_get_prof()
3453 if (!hw->blk[blk].es.written[map->prof_id]) { in ice_get_prof()
3458 status = -ENOMEM; in ice_get_prof()
3462 p->type = ICE_PTG_ES_ADD; in ice_get_prof()
3463 p->ptype = 0; in ice_get_prof()
3464 p->ptg = map->ptg[i]; in ice_get_prof()
3465 p->add_ptg = 0; in ice_get_prof()
3467 p->add_prof = 1; in ice_get_prof()
3468 p->prof_id = map->prof_id; in ice_get_prof()
3470 hw->blk[blk].es.written[map->prof_id] = true; in ice_get_prof()
3472 list_add(&p->list_entry, chg); in ice_get_prof()
3476 mutex_unlock(&hw->blk[blk].es.prof_map_lock); in ice_get_prof()
3482 * ice_get_profs_vsig - get a copy of the list of profiles from a VSIG
3488 * This routine makes a copy of the list of profiles in the specified VSIG.
3497 list_for_each_entry(ent1, &hw->blk[blk].xlt2.vsig_tbl[idx].prop_lst, in ice_get_profs_vsig()
3507 list_add_tail(&p->list, lst); in ice_get_profs_vsig()
3514 list_del(&ent1->list); in ice_get_profs_vsig()
3518 return -ENOMEM; in ice_get_profs_vsig()
3522 * ice_add_prof_to_lst - add profile entry to a list
3537 mutex_lock(&hw->blk[blk].es.prof_map_lock); in ice_add_prof_to_lst()
3540 status = -ENOENT; in ice_add_prof_to_lst()
3546 status = -ENOMEM; in ice_add_prof_to_lst()
3550 p->profile_cookie = map->profile_cookie; in ice_add_prof_to_lst()
3551 p->prof_id = map->prof_id; in ice_add_prof_to_lst()
3552 p->tcam_count = map->ptg_cnt; in ice_add_prof_to_lst()
3554 for (i = 0; i < map->ptg_cnt; i++) { in ice_add_prof_to_lst()
3555 p->tcam[i].prof_id = map->prof_id; in ice_add_prof_to_lst()
3556 p->tcam[i].tcam_idx = ICE_INVALID_TCAM; in ice_add_prof_to_lst()
3557 p->tcam[i].ptg = map->ptg[i]; in ice_add_prof_to_lst()
3560 list_add(&p->list, lst); in ice_add_prof_to_lst()
3563 mutex_unlock(&hw->blk[blk].es.prof_map_lock); in ice_add_prof_to_lst()
3568 * ice_move_vsi - move VSI to another VSIG
3585 return -ENOMEM; in ice_move_vsi()
3596 p->type = ICE_VSI_MOVE; in ice_move_vsi()
3597 p->vsi = vsi; in ice_move_vsi()
3598 p->orig_vsig = orig_vsig; in ice_move_vsi()
3599 p->vsig = vsig; in ice_move_vsi()
3601 list_add(&p->list_entry, chg); in ice_move_vsi()
3607 * ice_rem_chg_tcam_ent - remove a specific TCAM entry from change list
3618 if (tmp->type == ICE_TCAM_ADD && tmp->tcam_idx == idx) { in ice_rem_chg_tcam_ent()
3619 list_del(&tmp->list_entry); in ice_rem_chg_tcam_ent()
3625 * ice_prof_tcam_ena_dis - add enable or disable TCAM change
3633 * This function appends an enable or disable TCAM entry in the change log
3649 status = ice_rel_tcam_idx(hw, blk, tcam->tcam_idx); in ice_prof_tcam_ena_dis()
3652 * we need to remove that entry, in order to prevent writing to in ice_prof_tcam_ena_dis()
3655 ice_rem_chg_tcam_ent(hw, tcam->tcam_idx, chg); in ice_prof_tcam_ena_dis()
3656 tcam->tcam_idx = 0; in ice_prof_tcam_ena_dis()
3657 tcam->in_use = 0; in ice_prof_tcam_ena_dis()
3661 /* for re-enabling, reallocate a TCAM */ in ice_prof_tcam_ena_dis()
3662 /* for entries with empty attribute masks, allocate entry from in ice_prof_tcam_ena_dis()
3664 * top of the table in order to give it higher priority in ice_prof_tcam_ena_dis()
3666 status = ice_alloc_tcam_ent(hw, blk, tcam->attr.mask == 0, in ice_prof_tcam_ena_dis()
3667 &tcam->tcam_idx); in ice_prof_tcam_ena_dis()
3674 return -ENOMEM; in ice_prof_tcam_ena_dis()
3676 status = ice_tcam_write_entry(hw, blk, tcam->tcam_idx, tcam->prof_id, in ice_prof_tcam_ena_dis()
3677 tcam->ptg, vsig, 0, tcam->attr.flags, in ice_prof_tcam_ena_dis()
3682 tcam->in_use = 1; in ice_prof_tcam_ena_dis()
3684 p->type = ICE_TCAM_ADD; in ice_prof_tcam_ena_dis()
3685 p->add_tcam_idx = true; in ice_prof_tcam_ena_dis()
3686 p->prof_id = tcam->prof_id; in ice_prof_tcam_ena_dis()
3687 p->ptg = tcam->ptg; in ice_prof_tcam_ena_dis()
3688 p->vsig = 0; in ice_prof_tcam_ena_dis()
3689 p->tcam_idx = tcam->tcam_idx; in ice_prof_tcam_ena_dis()
3692 list_add(&p->list_entry, chg); in ice_prof_tcam_ena_dis()
3702 * ice_adj_prof_priorities - adjust profile based on priorities
3720 /* Priority is based on the order in which the profiles are added. The in ice_adj_prof_priorities()
3724 * in order and enables the first of each PTG that it finds (that is not in ice_adj_prof_priorities()
3726 * in the older profiles (that are currently enabled). in ice_adj_prof_priorities()
3729 list_for_each_entry(t, &hw->blk[blk].xlt2.vsig_tbl[idx].prop_lst, in ice_adj_prof_priorities()
3733 for (i = 0; i < t->tcam_count; i++) { in ice_adj_prof_priorities()
3737 if (test_bit(t->tcam[i].ptg, ptgs_used) && in ice_adj_prof_priorities()
3738 t->tcam[i].in_use) { in ice_adj_prof_priorities()
3740 * was already in use and therefore duplicate in ice_adj_prof_priorities()
3745 &t->tcam[i], in ice_adj_prof_priorities()
3749 } else if (!test_bit(t->tcam[i].ptg, ptgs_used) && in ice_adj_prof_priorities()
3750 !t->tcam[i].in_use) { in ice_adj_prof_priorities()
3751 /* need to enable this PTG, as it in not in use in ice_adj_prof_priorities()
3756 &t->tcam[i], in ice_adj_prof_priorities()
3763 __set_bit(t->tcam[i].ptg, ptgs_used); in ice_adj_prof_priorities()
3771 * ice_add_prof_id_vsig - add profile to VSIG
3783 /* Masks that ignore flags */ in ice_add_prof_id_vsig()
3795 return -EEXIST; in ice_add_prof_id_vsig()
3800 return -ENOMEM; in ice_add_prof_id_vsig()
3802 mutex_lock(&hw->blk[blk].es.prof_map_lock); in ice_add_prof_id_vsig()
3806 status = -ENOENT; in ice_add_prof_id_vsig()
3810 t->profile_cookie = map->profile_cookie; in ice_add_prof_id_vsig()
3811 t->prof_id = map->prof_id; in ice_add_prof_id_vsig()
3812 t->tcam_count = map->ptg_cnt; in ice_add_prof_id_vsig()
3815 for (i = 0; i < map->ptg_cnt; i++) { in ice_add_prof_id_vsig()
3821 status = -ENOMEM; in ice_add_prof_id_vsig()
3826 /* for entries with empty attribute masks, allocate entry from in ice_add_prof_id_vsig()
3828 * top of the table in order to give it higher priority in ice_add_prof_id_vsig()
3830 status = ice_alloc_tcam_ent(hw, blk, map->attr[i].mask == 0, in ice_add_prof_id_vsig()
3837 t->tcam[i].ptg = map->ptg[i]; in ice_add_prof_id_vsig()
3838 t->tcam[i].prof_id = map->prof_id; in ice_add_prof_id_vsig()
3839 t->tcam[i].tcam_idx = tcam_idx; in ice_add_prof_id_vsig()
3840 t->tcam[i].attr = map->attr[i]; in ice_add_prof_id_vsig()
3841 t->tcam[i].in_use = true; in ice_add_prof_id_vsig()
3843 p->type = ICE_TCAM_ADD; in ice_add_prof_id_vsig()
3844 p->add_tcam_idx = true; in ice_add_prof_id_vsig()
3845 p->prof_id = t->tcam[i].prof_id; in ice_add_prof_id_vsig()
3846 p->ptg = t->tcam[i].ptg; in ice_add_prof_id_vsig()
3847 p->vsig = vsig; in ice_add_prof_id_vsig()
3848 p->tcam_idx = t->tcam[i].tcam_idx; in ice_add_prof_id_vsig()
3851 status = ice_tcam_write_entry(hw, blk, t->tcam[i].tcam_idx, in ice_add_prof_id_vsig()
3852 t->tcam[i].prof_id, in ice_add_prof_id_vsig()
3853 t->tcam[i].ptg, vsig, 0, 0, in ice_add_prof_id_vsig()
3861 list_add(&p->list_entry, chg); in ice_add_prof_id_vsig()
3867 list_add_tail(&t->list, in ice_add_prof_id_vsig()
3868 &hw->blk[blk].xlt2.vsig_tbl[vsig_idx].prop_lst); in ice_add_prof_id_vsig()
3870 list_add(&t->list, in ice_add_prof_id_vsig()
3871 &hw->blk[blk].xlt2.vsig_tbl[vsig_idx].prop_lst); in ice_add_prof_id_vsig()
3873 mutex_unlock(&hw->blk[blk].es.prof_map_lock); in ice_add_prof_id_vsig()
3877 mutex_unlock(&hw->blk[blk].es.prof_map_lock); in ice_add_prof_id_vsig()
3884 * ice_create_prof_id_vsig - add a new VSIG with a single profile
3887 * @vsi: the initial VSI that will be in VSIG
3901 return -ENOMEM; in ice_create_prof_id_vsig()
3905 status = -EIO; in ice_create_prof_id_vsig()
3917 p->type = ICE_VSIG_ADD; in ice_create_prof_id_vsig()
3918 p->vsi = vsi; in ice_create_prof_id_vsig()
3919 p->orig_vsig = ICE_DEFAULT_VSIG; in ice_create_prof_id_vsig()
3920 p->vsig = new_vsig; in ice_create_prof_id_vsig()
3922 list_add(&p->list_entry, chg); in ice_create_prof_id_vsig()
3933 * ice_create_vsig_from_lst - create a new VSIG with a list of profiles
3936 * @vsi: the initial VSI that will be in VSIG
3952 return -EIO; in ice_create_vsig_from_lst()
3960 status = ice_add_prof_id_vsig(hw, blk, vsig, t->profile_cookie, in ice_create_vsig_from_lst()
3972 * ice_find_prof_vsig - find a VSIG with a specific profile handle
3991 t->profile_cookie = hdl; in ice_find_prof_vsig()
3992 list_add(&t->list, &lst); in ice_find_prof_vsig()
3996 list_del(&t->list); in ice_find_prof_vsig()
4003 * ice_add_prof_id_flow - add profile flow
4010 * profile indicated by the ID parameter for the VSIs specified in the VSI
4038 /* found in VSIG */ in ice_add_prof_id_flow()
4046 status = -EEXIST; in ice_add_prof_id_flow()
4050 /* last VSI in the VSIG? */ in ice_add_prof_id_flow()
4085 * will be the requesting VSI. In this case the VSI is in ice_add_prof_id_flow()
4136 list_del(&del->list_entry); in ice_add_prof_id_flow()
4141 list_del(&del1->list); in ice_add_prof_id_flow()
4149 * ice_flow_assoc_fdir_prof - add an FDIR profile for main/ctrl VSI
4169 return -EINVAL; in ice_flow_assoc_fdir_prof()
4197 * ice_rem_prof_from_list - remove a profile from list
4208 if (ent->profile_cookie == hdl) { in ice_rem_prof_from_list()
4209 list_del(&ent->list); in ice_rem_prof_from_list()
4214 return -ENOENT; in ice_rem_prof_from_list()
4218 * ice_rem_prof_id_flow - remove flow
4225 * profile indicated by the ID parameter for the VSIs specified in the VSI
4247 /* found in VSIG */ in ice_rem_prof_id_flow()
4329 status = -ENOENT; in ice_rem_prof_id_flow()
4338 list_del(&del->list_entry); in ice_rem_prof_id_flow()
4343 list_del(&del1->list); in ice_rem_prof_id_flow()