src/dpdk/drivers/net/txgbe/txgbe_flow.c
static int
txgbe_flow_validate(struct rte_eth_dev *dev,
		const struct rte_flow_attr *attr,
		const struct rte_flow_item pattern[],
		const struct rte_flow_action actions[],
		struct rte_flow_error *error)
{
	struct rte_eth_ntuple_filter ntuple_filter;
	struct rte_eth_ethertype_filter ethertype_filter;
	struct rte_eth_syn_filter syn_filter;
	struct txgbe_l2_tunnel_conf l2_tn_filter;
	struct txgbe_fdir_rule fdir_rule;
	struct txgbe_rte_flow_rss_conf rss_conf;
	int ret = 0;

	memset(&ntuple_filter, 0, sizeof(struct rte_eth_ntuple_filter));
	ret = txgbe_parse_ntuple_filter(dev, attr, pattern,
				actions, &ntuple_filter, error);
	if (!ret)
		return 0;

	memset(&ethertype_filter, 0, sizeof(struct rte_eth_ethertype_filter));
	ret = txgbe_parse_ethertype_filter(dev, attr, pattern,
				actions, &ethertype_filter, error);
	if (!ret)
		return 0;

	memset(&syn_filter, 0, sizeof(struct rte_eth_syn_filter));
	ret = txgbe_parse_syn_filter(dev, attr, pattern,
				actions, &syn_filter, error);
	if (!ret)
		return 0;

	memset(&fdir_rule, 0, sizeof(struct txgbe_fdir_rule));
	ret = txgbe_parse_fdir_filter(dev, attr, pattern,
				actions, &fdir_rule, error);
	if (!ret)
		return 0;

	memset(&l2_tn_filter, 0, sizeof(struct txgbe_l2_tunnel_conf));
	ret = txgbe_parse_l2_tn_filter(dev, attr, pattern,
				actions, &l2_tn_filter, error);
	if (!ret)
		return 0;

	memset(&rss_conf, 0, sizeof(struct txgbe_rte_flow_rss_conf));
	ret = txgbe_parse_rss_filter(dev, attr,
					actions, &rss_conf, error);

	return ret;
}
/**
 * Check if the flow rule is supported by txgbe.
 * 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 txgbe.
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 txgbe . 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
txgbe_flow_validate(struct rte_eth_dev *dev,
		const struct rte_flow_attr *attr,
		const struct rte_flow_item pattern[],
		const struct rte_flow_action actions[],
		struct rte_flow_error *error)
{
	struct rte_eth_ntuple_filter ntuple_filter;
	struct rte_eth_ethertype_filter ethertype_filter;
	struct rte_eth_syn_filter syn_filter;
	struct txgbe_l2_tunnel_conf l2_tn_filter;
	struct txgbe_fdir_rule fdir_rule;
	struct txgbe_rte_flow_rss_conf rss_conf;
	int ret = 0;
	memset(&ntuple_filter, 0, sizeof(struct rte_eth_ntuple_filter));
	ret = txgbe_parse_ntuple_filter(dev, attr, pattern,
				actions, &ntuple_filter, error);
	if (!ret)
		return 0;
	memset(&ethertype_filter, 0, sizeof(struct rte_eth_ethertype_filter));
	ret = txgbe_parse_ethertype_filter(dev, attr, pattern,
				actions, &ethertype_filter, error);
	if (!ret)
		return 0;
	memset(&syn_filter, 0, sizeof(struct rte_eth_syn_filter));
	ret = txgbe_parse_syn_filter(dev, attr, pattern,
				actions, &syn_filter, error);
	if (!ret)
		return 0;
	memset(&fdir_rule, 0, sizeof(struct txgbe_fdir_rule));
	ret = txgbe_parse_fdir_filter(dev, attr, pattern,
				actions, &fdir_rule, error);
	if (!ret)
		return 0;
	memset(&l2_tn_filter, 0, sizeof(struct txgbe_l2_tunnel_conf));
	ret = txgbe_parse_l2_tn_filter(dev, attr, pattern,
				actions, &l2_tn_filter, error);
	if (!ret)
		return 0;
	memset(&rss_conf, 0, sizeof(struct txgbe_rte_flow_rss_conf));
	ret = txgbe_parse_rss_filter(dev, attr,
					actions, &rss_conf, error);
	return ret;
}
static int txgbe_flow_validate ( struct rte_eth_dev * dev , const struct rte_flow_attr * attr , const struct rte_flow_item pattern [ ] , const struct rte_flow_action actions [ ] , struct rte_flow_error * error ) { struct rte_eth_ntuple_filter ntuple_filter ; struct rte_eth_ethertype_filter ethertype_filter ; struct rte_eth_syn_filter syn_filter ; struct txgbe_l2_tunnel_conf l2_tn_filter ; struct txgbe_fdir_rule fdir_rule ; struct txgbe_rte_flow_rss_conf rss_conf ; int ret = 0 ; memset ( & ntuple_filter , 0 , sizeof ( struct rte_eth_ntuple_filter ) ) ; ret = txgbe_parse_ntuple_filter ( dev , attr , pattern , actions , & ntuple_filter , error ) ; if ( ! ret ) return 0 ; memset ( & ethertype_filter , 0 , sizeof ( struct rte_eth_ethertype_filter ) ) ; ret = txgbe_parse_ethertype_filter ( dev , attr , pattern , actions , & ethertype_filter , error ) ; if ( ! ret ) return 0 ; memset ( & syn_filter , 0 , sizeof ( struct rte_eth_syn_filter ) ) ; ret = txgbe_parse_syn_filter ( dev , attr , pattern , actions , & syn_filter , error ) ; if ( ! ret ) return 0 ; memset ( & fdir_rule , 0 , sizeof ( struct txgbe_fdir_rule ) ) ; ret = txgbe_parse_fdir_filter ( dev , attr , pattern , actions , & fdir_rule , error ) ; if ( ! ret ) return 0 ; memset ( & l2_tn_filter , 0 , sizeof ( struct txgbe_l2_tunnel_conf ) ) ; ret = txgbe_parse_l2_tn_filter ( dev , attr , pattern , actions , & l2_tn_filter , error ) ; if ( ! ret ) return 0 ; memset ( & rss_conf , 0 , sizeof ( struct txgbe_rte_flow_rss_conf ) ) ; ret = txgbe_parse_rss_filter ( dev , attr , actions , & rss_conf , error ) ; return ret ; }
Check if the flow rule is supported by txgbe.
Check if the flow rule is supported by txgbe .