net/ixgbe: flush all the filter list

This patch adds a function to flush all the filter list
filter on a port.

Signed-off-by: Wei Zhao <wei.zhao1@intel.com>
Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
Acked-by: Beilei Xing <beilei.xing@intel.com>
Acked-by: Wei Dai <wei.dai@intel.com>
This commit is contained in:
Wei Zhao 2017-01-13 16:13:12 +08:00 committed by Ferruh Yigit
parent a14de8b498
commit 6ff773e102
3 changed files with 60 additions and 0 deletions

View File

@ -1392,6 +1392,9 @@ eth_ixgbe_dev_uninit(struct rte_eth_dev *eth_dev)
/* Remove all ntuple filters of the device */
ixgbe_ntuple_filter_uninit(eth_dev);
/* clear all the filters list */
ixgbe_filterlist_flush();
return 0;
}

View File

@ -592,6 +592,7 @@ ixgbe_dev_l2_tunnel_filter_add(struct rte_eth_dev *dev,
int
ixgbe_dev_l2_tunnel_filter_del(struct rte_eth_dev *dev,
struct rte_eth_l2_tunnel_conf *l2_tunnel);
void ixgbe_filterlist_flush(void);
/*
* Flow director function prototypes
*/

View File

@ -2444,6 +2444,60 @@ ixgbe_parse_fdir_filter(const struct rte_flow_attr *attr,
return ret;
}
void
ixgbe_filterlist_flush(void)
{
struct ixgbe_ntuple_filter_ele *ntuple_filter_ptr;
struct ixgbe_ethertype_filter_ele *ethertype_filter_ptr;
struct ixgbe_eth_syn_filter_ele *syn_filter_ptr;
struct ixgbe_eth_l2_tunnel_conf_ele *l2_tn_filter_ptr;
struct ixgbe_fdir_rule_ele *fdir_rule_ptr;
struct ixgbe_flow_mem *ixgbe_flow_mem_ptr;
while ((ntuple_filter_ptr = TAILQ_FIRST(&filter_ntuple_list))) {
TAILQ_REMOVE(&filter_ntuple_list,
ntuple_filter_ptr,
entries);
rte_free(ntuple_filter_ptr);
}
while ((ethertype_filter_ptr = TAILQ_FIRST(&filter_ethertype_list))) {
TAILQ_REMOVE(&filter_ethertype_list,
ethertype_filter_ptr,
entries);
rte_free(ethertype_filter_ptr);
}
while ((syn_filter_ptr = TAILQ_FIRST(&filter_syn_list))) {
TAILQ_REMOVE(&filter_syn_list,
syn_filter_ptr,
entries);
rte_free(syn_filter_ptr);
}
while ((l2_tn_filter_ptr = TAILQ_FIRST(&filter_l2_tunnel_list))) {
TAILQ_REMOVE(&filter_l2_tunnel_list,
l2_tn_filter_ptr,
entries);
rte_free(l2_tn_filter_ptr);
}
while ((fdir_rule_ptr = TAILQ_FIRST(&filter_fdir_list))) {
TAILQ_REMOVE(&filter_fdir_list,
fdir_rule_ptr,
entries);
rte_free(fdir_rule_ptr);
}
while ((ixgbe_flow_mem_ptr = TAILQ_FIRST(&ixgbe_flow_list))) {
TAILQ_REMOVE(&ixgbe_flow_list,
ixgbe_flow_mem_ptr,
entries);
rte_free(ixgbe_flow_mem_ptr->flow);
rte_free(ixgbe_flow_mem_ptr);
}
}
/**
* Create or destroy a flow rule.
* Theorically one rule can match more than one filters.
@ -2818,5 +2872,7 @@ ixgbe_flow_flush(struct rte_eth_dev *dev,
return ret;
}
ixgbe_filterlist_flush();
return 0;
}