[dpdk-dev,24/24] net/i40e: flush tunnel filters
Checks
Commit Message
This patch is to flush all tunnel filters.
Signed-off-by: Beilei Xing <beilei.xing@intel.com>
---
drivers/net/i40e/i40e_ethdev.c | 22 ++++++++++++++++++++++
1 file changed, 22 insertions(+)
@@ -529,6 +529,7 @@ static int i40e_flow_destroy(struct rte_eth_dev *dev,
struct rte_flow_error *error);
static int i40e_ethertype_filter_flush(struct i40e_pf *pf);
static int i40e_macvlan_filter_flush(struct i40e_pf *pf);
+static int i40e_tunnel_filter_flush(struct i40e_pf *pf);
static int i40e_flow_flush(struct rte_eth_dev *dev,
struct rte_flow_error *error);
@@ -11849,6 +11850,21 @@ i40e_macvlan_filter_flush(struct i40e_pf *pf)
return ret;
}
+/* Flush all tunnel filters */
+static int
+i40e_tunnel_filter_flush(struct i40e_pf *pf)
+{
+ struct i40e_tunnel_filter_list
+ *tunnel_list = &pf->tunnel.tunnel_list;
+ struct i40e_tunnel_filter *f;
+ int ret = 0;
+
+ while ((f = TAILQ_FIRST(tunnel_list)))
+ ret = i40e_dev_destroy_tunnel_filter(pf, f);
+
+ return ret;
+}
+
static int
i40e_flow_flush(struct rte_eth_dev *dev, struct rte_flow_error *error)
{
@@ -11873,5 +11889,11 @@ i40e_flow_flush(struct rte_eth_dev *dev, struct rte_flow_error *error)
return ret;
}
+ ret = i40e_tunnel_filter_flush(pf);
+ if (ret) {
+ error->type = RTE_FLOW_ERROR_TYPE_HANDLE;
+ return ret;
+ }
+
return ret;
}