src/dpdk/drivers/net/ice/base/ice_fdir.c
bool ice_fdir_is_dup_fltr(struct ice_hw *hw, struct ice_fdir_fltr *input)
{
	struct ice_fdir_fltr *rule;
	bool ret = false;

	LIST_FOR_EACH_ENTRY(rule, &hw->fdir_list_head, ice_fdir_fltr,
			    fltr_node) {
		enum ice_fltr_ptype flow_type;

		if (rule->flow_type != input->flow_type)
			continue;

		flow_type = input->flow_type;
		if (flow_type == ICE_FLTR_PTYPE_NONF_IPV4_TCP ||
		    flow_type == ICE_FLTR_PTYPE_NONF_IPV4_UDP ||
		    flow_type == ICE_FLTR_PTYPE_NONF_IPV4_SCTP ||
		    flow_type == ICE_FLTR_PTYPE_NONF_IPV4_OTHER)
			ret = ice_fdir_comp_rules(rule, input, false);
		else
			ret = ice_fdir_comp_rules(rule, input, true);
		if (ret) {
			if (rule->fltr_id == input->fltr_id &&
			    rule->q_index != input->q_index)
				ret = false;
			else
				break;
		}
	}

	return ret;
}
/**
 * ice_fdir_is_dup_fltr - test if filter is already in list for PF
 * @hw: hardware data structure
 * @input: Flow Director filter data structure
 *
 * Returns true if the filter is found in the list
 */
test if filter is already in list for PF
@hw: hardware data structure
@input: Flow Director filter data structure

Returns true if the filter is found in the list
test if filter is already in list for PF @hw : hardware data structure @input : Flow Director filter data structure Returns true if the filter is found in the list
bool ice_fdir_is_dup_fltr(struct ice_hw *hw, struct ice_fdir_fltr *input)
{
	struct ice_fdir_fltr *rule;
	bool ret = false;
	LIST_FOR_EACH_ENTRY(rule, &hw->fdir_list_head, ice_fdir_fltr,
			    fltr_node) {
		enum ice_fltr_ptype flow_type;
		if (rule->flow_type != input->flow_type)
			continue;
		flow_type = input->flow_type;
		if (flow_type == ICE_FLTR_PTYPE_NONF_IPV4_TCP ||
		    flow_type == ICE_FLTR_PTYPE_NONF_IPV4_UDP ||
		    flow_type == ICE_FLTR_PTYPE_NONF_IPV4_SCTP ||
		    flow_type == ICE_FLTR_PTYPE_NONF_IPV4_OTHER)
			ret = ice_fdir_comp_rules(rule, input, false);
		else
			ret = ice_fdir_comp_rules(rule, input, true);
		if (ret) {
			if (rule->fltr_id == input->fltr_id &&
			    rule->q_index != input->q_index)
				ret = false;
			else
				break;
		}
	}
	return ret;
}
bool ice_fdir_is_dup_fltr ( struct ice_hw * hw , struct ice_fdir_fltr * input ) { struct ice_fdir_fltr * rule ; bool ret = false ; LIST_FOR_EACH_ENTRY ( rule , & hw -> fdir_list_head , ice_fdir_fltr , fltr_node ) { enum ice_fltr_ptype flow_type ; if ( rule -> flow_type != input -> flow_type ) continue ; flow_type = input -> flow_type ; if ( flow_type == ICE_FLTR_PTYPE_NONF_IPV4_TCP || flow_type == ICE_FLTR_PTYPE_NONF_IPV4_UDP || flow_type == ICE_FLTR_PTYPE_NONF_IPV4_SCTP || flow_type == ICE_FLTR_PTYPE_NONF_IPV4_OTHER ) ret = ice_fdir_comp_rules ( rule , input , false ) ; else ret = ice_fdir_comp_rules ( rule , input , true ) ; if ( ret ) { if ( rule -> fltr_id == input -> fltr_id && rule -> q_index != input -> q_index ) ret = false ; else break ; } } return ret ; }
ice_fdir_is_dup_fltr - test if filter is already in list for PF
 @hw: hardware data structure
 @input: Flow Director filter data structure
ice_fdir_is_dup_fltr - test if filter is already in list for PF @hw : hardware data structure @input : Flow Director filter data structure