[dpdk-dev] [PATCH 18/18] net/ixgbe: flush consistent filter

Wei Zhao wei.zhao1 at intel.com
Fri Dec 2 11:43:14 CET 2016


From: wei zhao1 <wei.zhao1 at intel.com>

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

Signed-off-by: wei zhao1 <wei.zhao1 at intel.com>
Signed-off-by: Wenzhuo Lu <wenzhuo.lu at intel.com>
---
 drivers/net/ixgbe/ixgbe_ethdev.c | 20 +++++++++++++++++++-
 1 file changed, 19 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c
index 23efc57..e420a3f 100644
--- a/drivers/net/ixgbe/ixgbe_ethdev.c
+++ b/drivers/net/ixgbe/ixgbe_ethdev.c
@@ -458,6 +458,8 @@ struct ixgbe_flow *ixgbe_flow_create(struct rte_eth_dev *dev,
 int ixgbe_flow_destroy(struct rte_eth_dev *dev,
 		struct rte_flow *flow,
 		struct rte_flow_error *error);
+int ixgbe_flow_flush(struct rte_eth_dev *dev,
+		struct rte_flow_error *error);
 
 /*
  * Define VF Stats MACRO for Non "cleared on read" register
@@ -847,7 +849,7 @@ static const struct rte_flow_ops ixgbe_flow_ops = {
 	ixgbe_flow_validate,
 	(void *)ixgbe_flow_create,
 	ixgbe_flow_destroy,
-	NULL,
+	ixgbe_flow_flush,
 	NULL,
 };
 /* ntuple filter list structure */
@@ -9946,6 +9948,22 @@ ixgbe_flow_destroy(struct rte_eth_dev *dev,
 
 }
 
+/*  Destroy all flow rules associated with a port on ixgbe. */
+int
+ixgbe_flow_flush(struct rte_eth_dev *dev,
+		struct rte_flow_error *error)
+{
+	int ret = 0;
+
+	error->type = RTE_FLOW_ERROR_TYPE_NONE;
+	if((ret = ixgbe_flush_all_filter(dev)) != 0) {
+		error->type = RTE_FLOW_ERROR_TYPE_HANDLE;
+		return ret;
+	}
+
+	return ret;
+}
+
 RTE_PMD_REGISTER_PCI(net_ixgbe, rte_ixgbe_pmd.pci_drv);
 RTE_PMD_REGISTER_PCI_TABLE(net_ixgbe, pci_id_ixgbe_map);
 RTE_PMD_REGISTER_PCI(net_ixgbe_vf, rte_ixgbevf_pmd.pci_drv);
-- 
2.5.5



More information about the dev mailing list