src/dpdk/drivers/net/igc/igc_flow.c
static int
igc_flow_validate(struct rte_eth_dev *dev,
		const struct rte_flow_attr *attr,
		const struct rte_flow_item patterns[],
		const struct rte_flow_action actions[],
		struct rte_flow_error *error)
{
	struct igc_all_filter filter;
	int ret;

	ret = igc_parse_flow(dev, attr, patterns, actions, error, &filter);
	if (ret)
		return ret;

	switch (filter.mask) {
	case IGC_FILTER_MASK_NTUPLE:
		/* Check n-tuple filter is valid */
		if (filter.ntuple.tuple_info.dst_port_mask == 0 &&
			filter.ntuple.tuple_info.proto_mask == 0)
			return rte_flow_error_set(error, EINVAL,
					RTE_FLOW_ERROR_TYPE_NONE, NULL,
					"Flow can't be recognized");
		break;
	}

	return 0;
}
/**
 * Check if the flow rule is supported by the device.
 * It only checks the format. Don't guarantee the rule can be programmed into
 * the HW. Because there can be no enough room for the rule.
 **/
Check if the flow rule is supported by the device.
It only checks the format. Don't guarantee the rule can be programmed into
the HW. Because there can be no enough room for the rule.
Check if the flow rule is supported by the device . It only checks the format . Don ' t guarantee the rule can be programmed into the HW . Because there can be no enough room for the rule .
static int
igc_flow_validate(struct rte_eth_dev *dev,
		const struct rte_flow_attr *attr,
		const struct rte_flow_item patterns[],
		const struct rte_flow_action actions[],
		struct rte_flow_error *error)
{
	struct igc_all_filter filter;
	int ret;
	ret = igc_parse_flow(dev, attr, patterns, actions, error, &filter);
	if (ret)
		return ret;
	switch (filter.mask) {
	case IGC_FILTER_MASK_NTUPLE:
		if (filter.ntuple.tuple_info.dst_port_mask == 0 &&
			filter.ntuple.tuple_info.proto_mask == 0)
			return rte_flow_error_set(error, EINVAL,
					RTE_FLOW_ERROR_TYPE_NONE, NULL,
					"Flow can't be recognized");
		break;
	}
	return 0;
}
static int igc_flow_validate ( struct rte_eth_dev * dev , const struct rte_flow_attr * attr , const struct rte_flow_item patterns [ ] , const struct rte_flow_action actions [ ] , struct rte_flow_error * error ) { struct igc_all_filter filter ; int ret ; ret = igc_parse_flow ( dev , attr , patterns , actions , error , & filter ) ; if ( ret ) return ret ; switch ( filter . mask ) { case IGC_FILTER_MASK_NTUPLE : if ( filter . ntuple . tuple_info . dst_port_mask == 0 && filter . ntuple . tuple_info . proto_mask == 0 ) return rte_flow_error_set ( error , EINVAL , RTE_FLOW_ERROR_TYPE_NONE , NULL , " " ) ; break ; } return 0 ; }
Check if the flow rule is supported by the device.
Check if the flow rule is supported by the device .
/* Check n-tuple filter is valid */