[dpdk-dev] [PATCH v2 16/18] net/ixgbe: create consistent filter

Xing, Beilei beilei.xing at intel.com
Tue Jan 3 03:04:19 CET 2017



> -----Original Message-----
> From: dev [mailto:dev-bounces at dpdk.org] On Behalf Of Wei Zhao
> Sent: Friday, December 30, 2016 3:53 PM
> To: dev at dpdk.org
> Cc: Zhao1, Wei <wei.zhao1 at intel.com>; Lu, Wenzhuo
> <wenzhuo.lu at intel.com>
> Subject: [dpdk-dev] [PATCH v2 16/18] net/ixgbe: create consistent filter
> 
> This patch adds a function to create the flow directory filter.
> 
> Signed-off-by: Wei Zhao <wei.zhao1 at intel.com>
> Signed-off-by: Wenzhuo Lu <wenzhuo.lu at intel.com>
> 
> ---
> 
> v2:
> --add new error set function
> ---
>  drivers/net/ixgbe/ixgbe_ethdev.c | 240
> ++++++++++++++++++++++++++++++++++++++-
>  drivers/net/ixgbe/ixgbe_ethdev.h |   5 +
>  2 files changed, 244 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c
> b/drivers/net/ixgbe/ixgbe_ethdev.c
> index c98aa0d..1c857fc 100644
> --- a/drivers/net/ixgbe/ixgbe_ethdev.c
> +++ b/drivers/net/ixgbe/ixgbe_ethdev.c
> @@ -468,6 +468,11 @@ ixgbe_flow_validate(__rte_unused struct
> rte_eth_dev *dev,
>  		const struct rte_flow_item pattern[],
>  		const struct rte_flow_action actions[],
>  		struct rte_flow_error *error);
> +static struct rte_flow *ixgbe_flow_create(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);
>  static int ixgbe_flow_flush(struct rte_eth_dev *dev,
>  		struct rte_flow_error *error);
>  /*
> @@ -850,11 +855,55 @@ static const struct rte_ixgbe_xstats_name_off
> rte_ixgbevf_stats_strings[] = {
>  		sizeof(rte_ixgbevf_stats_strings[0]))
>  static const struct rte_flow_ops ixgbe_flow_ops = {
>  	ixgbe_flow_validate,
> -	NULL,
> +	ixgbe_flow_create,
>  	NULL,
>  	ixgbe_flow_flush,
>  	NULL,
>  };
> +/* ntuple filter list structure */
> +struct ixgbe_ntuple_filter_ele {
> +	TAILQ_ENTRY(ixgbe_ntuple_filter_ele) entries;
> +	struct rte_eth_ntuple_filter filter_info; };
> +/* ethertype filter list structure */
> +struct ixgbe_ethertype_filter_ele {
> +	TAILQ_ENTRY(ixgbe_ethertype_filter_ele) entries;
> +	struct rte_eth_ethertype_filter filter_info; };
> +/* syn filter list structure */
> +struct ixgbe_eth_syn_filter_ele {
> +	TAILQ_ENTRY(ixgbe_eth_syn_filter_ele) entries;
> +	struct rte_eth_syn_filter filter_info; };
> +/* fdir filter list structure */
> +struct ixgbe_fdir_rule_ele {
> +	TAILQ_ENTRY(ixgbe_fdir_rule_ele) entries;
> +	struct ixgbe_fdir_rule filter_info;
> +};
> +/* l2_tunnel filter list structure */
> +struct ixgbe_eth_l2_tunnel_conf_ele {
> +	TAILQ_ENTRY(ixgbe_eth_l2_tunnel_conf_ele) entries;
> +	struct rte_eth_l2_tunnel_conf filter_info; };
> +/* ixgbe_flow memory list structure */

Why need to define these structures? There has been structures to store the filter before, isn't it?

> +struct ixgbe_flow_mem {
> +	TAILQ_ENTRY(ixgbe_flow_mem) entries;
> +	struct ixgbe_flow *flow;
> +};
> +
> +TAILQ_HEAD(ixgbe_ntuple_filter_list, ixgbe_ntuple_filter_ele); struct
> +ixgbe_ntuple_filter_list filter_ntuple_list;
> +TAILQ_HEAD(ixgbe_ethertype_filter_list, ixgbe_ethertype_filter_ele);
> +struct ixgbe_ethertype_filter_list filter_ethertype_list;
> +TAILQ_HEAD(ixgbe_syn_filter_list, ixgbe_eth_syn_filter_ele); struct
> +ixgbe_syn_filter_list filter_syn_list;
> +TAILQ_HEAD(ixgbe_fdir_rule_filter_list, ixgbe_fdir_rule_ele); struct
> +ixgbe_fdir_rule_filter_list filter_fdir_list;
> +TAILQ_HEAD(ixgbe_l2_tunnel_filter_list, ixgbe_eth_l2_tunnel_conf_ele);
> +struct ixgbe_l2_tunnel_filter_list filter_l2_tunnel_list;
> +TAILQ_HEAD(ixgbe_flow_mem_list, ixgbe_flow_mem); struct
> +ixgbe_flow_mem_list ixgbe_flow_list;
> +
>  /**
>   * Atomically reads the link status information from global
>   * structure rte_eth_dev.
> @@ -1380,6 +1429,14 @@ eth_ixgbe_dev_init(struct rte_eth_dev *eth_dev)
> 
>  	/* initialize l2 tunnel filter list & hash */
>  	ixgbe_l2_tn_filter_init(eth_dev);
> +
> +	TAILQ_INIT(&filter_ntuple_list);
> +	TAILQ_INIT(&filter_ethertype_list);
> +	TAILQ_INIT(&filter_syn_list);
> +	TAILQ_INIT(&filter_fdir_list);
> +	TAILQ_INIT(&filter_l2_tunnel_list);
> +	TAILQ_INIT(&ixgbe_flow_list);
> +
>  	return 0;
>  }
> 


More information about the dev mailing list