src/dpdk/drivers/net/ice/base/ice_acl_ctrl.c
enum ice_status ice_acl_destroy_tbl(struct ice_hw *hw)
{
	struct ice_acl_scen *pos_scen, *tmp_scen;
	struct ice_aqc_acl_generic resp_buf;
	struct ice_aqc_acl_scen buf;
	enum ice_status status;
	u8 i;

	if (!hw->acl_tbl)
		return ICE_ERR_DOES_NOT_EXIST;

	/* Mark all the created scenario's TCAM to stop the packet lookup and
	 * delete them afterward
	 */
	LIST_FOR_EACH_ENTRY_SAFE(pos_scen, tmp_scen, &hw->acl_tbl->scens,
				 ice_acl_scen, list_entry) {
		status = ice_aq_query_acl_scen(hw, pos_scen->id, &buf, NULL);
		if (status) {
			ice_debug(hw, ICE_DBG_ACL, "ice_aq_query_acl_scen() failed. status: %d\n",
				  status);
			return status;
		}

		for (i = 0; i < ICE_AQC_ACL_SLICES; i++) {
			buf.tcam_cfg[i].chnk_msk = 0;
			buf.tcam_cfg[i].start_cmp_set =
					ICE_AQC_ACL_ALLOC_SCE_START_CMP;
		}

		for (i = 0; i < ICE_AQC_MAX_ACTION_MEMORIES; i++)
			buf.act_mem_cfg[i] = 0;

		status = ice_aq_update_acl_scen(hw, pos_scen->id, &buf, NULL);
		if (status) {
			ice_debug(hw, ICE_DBG_ACL, "ice_aq_update_acl_scen() failed. status: %d\n",
				  status);
			return status;
		}

		status = ice_acl_destroy_scen(hw, pos_scen->id);
		if (status) {
			ice_debug(hw, ICE_DBG_ACL, "deletion of scenario failed. status: %d\n",
				  status);
			return status;
		}
	}

	/* call the AQ command to destroy the ACL table */
	status = ice_aq_dealloc_acl_tbl(hw, hw->acl_tbl->id, &resp_buf, NULL);
	if (status) {
		ice_debug(hw, ICE_DBG_ACL, "AQ de-allocation of ACL failed. status: %d\n",
			  status);
		return status;
	}

	ice_free(hw, hw->acl_tbl);
	hw->acl_tbl = NULL;

	return ICE_SUCCESS;
}
/**
 * ice_acl_destroy_tbl - Destroy a previously created LEM table for ACL
 * @hw: pointer to the HW struct
 */
Destroy a previously created LEM table for ACL
@hw: pointer to the HW struct
Destroy a previously created LEM table for ACL @hw : pointer to the HW struct
enum ice_status ice_acl_destroy_tbl(struct ice_hw *hw)
{
	struct ice_acl_scen *pos_scen, *tmp_scen;
	struct ice_aqc_acl_generic resp_buf;
	struct ice_aqc_acl_scen buf;
	enum ice_status status;
	u8 i;
	if (!hw->acl_tbl)
		return ICE_ERR_DOES_NOT_EXIST;
	LIST_FOR_EACH_ENTRY_SAFE(pos_scen, tmp_scen, &hw->acl_tbl->scens,
				 ice_acl_scen, list_entry) {
		status = ice_aq_query_acl_scen(hw, pos_scen->id, &buf, NULL);
		if (status) {
			ice_debug(hw, ICE_DBG_ACL, "ice_aq_query_acl_scen() failed. status: %d\n",
				  status);
			return status;
		}
		for (i = 0; i < ICE_AQC_ACL_SLICES; i++) {
			buf.tcam_cfg[i].chnk_msk = 0;
			buf.tcam_cfg[i].start_cmp_set =
					ICE_AQC_ACL_ALLOC_SCE_START_CMP;
		}
		for (i = 0; i < ICE_AQC_MAX_ACTION_MEMORIES; i++)
			buf.act_mem_cfg[i] = 0;
		status = ice_aq_update_acl_scen(hw, pos_scen->id, &buf, NULL);
		if (status) {
			ice_debug(hw, ICE_DBG_ACL, "ice_aq_update_acl_scen() failed. status: %d\n",
				  status);
			return status;
		}
		status = ice_acl_destroy_scen(hw, pos_scen->id);
		if (status) {
			ice_debug(hw, ICE_DBG_ACL, "deletion of scenario failed. status: %d\n",
				  status);
			return status;
		}
	}
	status = ice_aq_dealloc_acl_tbl(hw, hw->acl_tbl->id, &resp_buf, NULL);
	if (status) {
		ice_debug(hw, ICE_DBG_ACL, "AQ de-allocation of ACL failed. status: %d\n",
			  status);
		return status;
	}
	ice_free(hw, hw->acl_tbl);
	hw->acl_tbl = NULL;
	return ICE_SUCCESS;
}
enum ice_status ice_acl_destroy_tbl ( struct ice_hw * hw ) { struct ice_acl_scen * pos_scen , * tmp_scen ; struct ice_aqc_acl_generic resp_buf ; struct ice_aqc_acl_scen buf ; enum ice_status status ; u8 i ; if ( ! hw -> acl_tbl ) return ICE_ERR_DOES_NOT_EXIST ; LIST_FOR_EACH_ENTRY_SAFE ( pos_scen , tmp_scen , & hw -> acl_tbl -> scens , ice_acl_scen , list_entry ) { status = ice_aq_query_acl_scen ( hw , pos_scen -> id , & buf , NULL ) ; if ( status ) { ice_debug ( hw , ICE_DBG_ACL , " \n " , status ) ; return status ; } for ( i = 0 ; i < ICE_AQC_ACL_SLICES ; i ++ ) { buf . tcam_cfg [ i ] . chnk_msk = 0 ; buf . tcam_cfg [ i ] . start_cmp_set = ICE_AQC_ACL_ALLOC_SCE_START_CMP ; } for ( i = 0 ; i < ICE_AQC_MAX_ACTION_MEMORIES ; i ++ ) buf . act_mem_cfg [ i ] = 0 ; status = ice_aq_update_acl_scen ( hw , pos_scen -> id , & buf , NULL ) ; if ( status ) { ice_debug ( hw , ICE_DBG_ACL , " \n " , status ) ; return status ; } status = ice_acl_destroy_scen ( hw , pos_scen -> id ) ; if ( status ) { ice_debug ( hw , ICE_DBG_ACL , " \n " , status ) ; return status ; } } status = ice_aq_dealloc_acl_tbl ( hw , hw -> acl_tbl -> id , & resp_buf , NULL ) ; if ( status ) { ice_debug ( hw , ICE_DBG_ACL , " \n " , status ) ; return status ; } ice_free ( hw , hw -> acl_tbl ) ; hw -> acl_tbl = NULL ; return ICE_SUCCESS ; }
ice_acl_destroy_tbl - Destroy a previously created LEM table for ACL
 @hw: pointer to the HW struct
ice_acl_destroy_tbl - Destroy a previously created LEM table for ACL @hw : pointer to the HW struct
/* Mark all the created scenario's TCAM to stop the packet lookup and
	 * delete them afterward
	 */ /* call the AQ command to destroy the ACL table */