[dpdk-dev,23/24] net/i40e: flush macvlan filters
Checks
Commit Message
This patch is to flush all macvlan filters.
Signed-off-by: Beilei Xing <beilei.xing@intel.com>
---
drivers/net/i40e/i40e_ethdev.c | 24 ++++++++++++++++++++++++
1 file changed, 24 insertions(+)
@@ -528,6 +528,7 @@ static int i40e_flow_destroy(struct rte_eth_dev *dev,
struct rte_flow *flow,
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_flow_flush(struct rte_eth_dev *dev,
struct rte_flow_error *error);
@@ -11831,6 +11832,23 @@ i40e_ethertype_filter_flush(struct i40e_pf *pf)
return ret;
}
+/* Flush all macvlan filters */
+static int
+i40e_macvlan_filter_flush(struct i40e_pf *pf)
+{
+ struct i40e_mac_filter *f;
+ struct i40e_vsi *vsi;
+ int i, ret = 0;
+
+ for (i = 0; i < pf->vf_num; i++) {
+ vsi = pf->vfs[i].vsi;
+ while ((f = TAILQ_FIRST(&vsi->mac_list)))
+ ret = i40e_dev_destroy_macvlan_filter(pf, vsi, f);
+ }
+
+ return ret;
+}
+
static int
i40e_flow_flush(struct rte_eth_dev *dev, struct rte_flow_error *error)
{
@@ -11849,5 +11867,11 @@ i40e_flow_flush(struct rte_eth_dev *dev, struct rte_flow_error *error)
return ret;
}
+ ret = i40e_macvlan_filter_flush(pf);
+ if (ret) {
+ error->type = RTE_FLOW_ERROR_TYPE_HANDLE;
+ return ret;
+ }
+
return ret;
}