src/dpdk/drivers/net/ice/base/ice_acl_ctrl.c
static enum ice_status ice_acl_init_tbl(struct ice_hw *hw)
{
	struct ice_aqc_actpair act_buf;
	struct ice_aqc_acl_data buf;
	enum ice_status status = ICE_SUCCESS;
	struct ice_acl_tbl *tbl;
	u8 tcam_idx, i;
	u16 idx;

	tbl = hw->acl_tbl;
	if (!tbl)
		return ICE_ERR_CFG;

	ice_memset(&buf, 0, sizeof(buf), ICE_NONDMA_MEM);
	ice_memset(&act_buf, 0, sizeof(act_buf), ICE_NONDMA_MEM);

	tcam_idx = tbl->first_tcam;
	idx = tbl->first_entry;
	while (tcam_idx < tbl->last_tcam ||
	       (tcam_idx == tbl->last_tcam && idx <= tbl->last_entry)) {
		/* Use the same value for entry_key and entry_key_inv since
		 * we are initializing the fields to 0
		 */
		status = ice_aq_program_acl_entry(hw, tcam_idx, idx, &buf,
						  NULL);
		if (status)
			return status;

		if (++idx > tbl->last_entry) {
			tcam_idx++;
			idx = tbl->first_entry;
		}
	}

	for (i = 0; i < ICE_AQC_MAX_ACTION_MEMORIES; i++) {
		u16 act_entry_idx, start, end;

		if (tbl->act_mems[i].act_mem == ICE_ACL_ACT_PAIR_MEM_INVAL)
			continue;

		start = tbl->first_entry;
		end = tbl->last_entry;

		for (act_entry_idx = start; act_entry_idx <= end;
		     act_entry_idx++) {
			/* Invalidate all allocated action pairs */
			status = ice_aq_program_actpair(hw, i, act_entry_idx,
							&act_buf, NULL);
			if (status)
				return status;
		}
	}

	return status;
}
/**
 * ice_acl_init_tbl
 * @hw: pointer to the hardware structure
 *
 * Initialize the ACL table by invalidating TCAM entries and action pairs.
 */
ice_acl_init_tbl
@hw: pointer to the hardware structure

Initialize the ACL table by invalidating TCAM entries and action pairs.
ice_acl_init_tbl @hw : pointer to the hardware structure Initialize the ACL table by invalidating TCAM entries and action pairs .
static enum ice_status ice_acl_init_tbl(struct ice_hw *hw)
{
	struct ice_aqc_actpair act_buf;
	struct ice_aqc_acl_data buf;
	enum ice_status status = ICE_SUCCESS;
	struct ice_acl_tbl *tbl;
	u8 tcam_idx, i;
	u16 idx;
	tbl = hw->acl_tbl;
	if (!tbl)
		return ICE_ERR_CFG;
	ice_memset(&buf, 0, sizeof(buf), ICE_NONDMA_MEM);
	ice_memset(&act_buf, 0, sizeof(act_buf), ICE_NONDMA_MEM);
	tcam_idx = tbl->first_tcam;
	idx = tbl->first_entry;
	while (tcam_idx < tbl->last_tcam ||
	       (tcam_idx == tbl->last_tcam && idx <= tbl->last_entry)) {
		status = ice_aq_program_acl_entry(hw, tcam_idx, idx, &buf,
						  NULL);
		if (status)
			return status;
		if (++idx > tbl->last_entry) {
			tcam_idx++;
			idx = tbl->first_entry;
		}
	}
	for (i = 0; i < ICE_AQC_MAX_ACTION_MEMORIES; i++) {
		u16 act_entry_idx, start, end;
		if (tbl->act_mems[i].act_mem == ICE_ACL_ACT_PAIR_MEM_INVAL)
			continue;
		start = tbl->first_entry;
		end = tbl->last_entry;
		for (act_entry_idx = start; act_entry_idx <= end;
		     act_entry_idx++) {
			status = ice_aq_program_actpair(hw, i, act_entry_idx,
							&act_buf, NULL);
			if (status)
				return status;
		}
	}
	return status;
}
static enum ice_status ice_acl_init_tbl ( struct ice_hw * hw ) { struct ice_aqc_actpair act_buf ; struct ice_aqc_acl_data buf ; enum ice_status status = ICE_SUCCESS ; struct ice_acl_tbl * tbl ; u8 tcam_idx , i ; u16 idx ; tbl = hw -> acl_tbl ; if ( ! tbl ) return ICE_ERR_CFG ; ice_memset ( & buf , 0 , sizeof ( buf ) , ICE_NONDMA_MEM ) ; ice_memset ( & act_buf , 0 , sizeof ( act_buf ) , ICE_NONDMA_MEM ) ; tcam_idx = tbl -> first_tcam ; idx = tbl -> first_entry ; while ( tcam_idx < tbl -> last_tcam || ( tcam_idx == tbl -> last_tcam && idx <= tbl -> last_entry ) ) { status = ice_aq_program_acl_entry ( hw , tcam_idx , idx , & buf , NULL ) ; if ( status ) return status ; if ( ++ idx > tbl -> last_entry ) { tcam_idx ++ ; idx = tbl -> first_entry ; } } for ( i = 0 ; i < ICE_AQC_MAX_ACTION_MEMORIES ; i ++ ) { u16 act_entry_idx , start , end ; if ( tbl -> act_mems [ i ] . act_mem == ICE_ACL_ACT_PAIR_MEM_INVAL ) continue ; start = tbl -> first_entry ; end = tbl -> last_entry ; for ( act_entry_idx = start ; act_entry_idx <= end ; act_entry_idx ++ ) { status = ice_aq_program_actpair ( hw , i , act_entry_idx , & act_buf , NULL ) ; if ( status ) return status ; } } return status ; }
ice_acl_init_tbl
 @hw: pointer to the hardware structure
ice_acl_init_tbl @hw : pointer to the hardware structure
/* Use the same value for entry_key and entry_key_inv since
		 * we are initializing the fields to 0
		 */ /* Invalidate all allocated action pairs */