diff mbox

[dpdk-dev,v6,12/22] i40e: implement operation to flush flow director table

Message ID 1416530816-2159-13-git-send-email-jingjing.wu@intel.com (mailing list archive)
State Accepted, archived
Headers show

Commit Message

Jingjing Wu Nov. 21, 2014, 12:46 a.m. UTC
implement operation to flush flow director table

Signed-off-by: jingjing.wu <jingjing.wu@intel.com>
---
 lib/librte_pmd_i40e/i40e_fdir.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
diff mbox

Patch

diff --git a/lib/librte_pmd_i40e/i40e_fdir.c b/lib/librte_pmd_i40e/i40e_fdir.c
index 5205530..93aa8a1 100644
--- a/lib/librte_pmd_i40e/i40e_fdir.c
+++ b/lib/librte_pmd_i40e/i40e_fdir.c
@@ -832,7 +832,7 @@  i40e_fdir_flush(struct rte_eth_dev *dev)
 	struct i40e_hw *hw = I40E_PF_TO_HW(pf);
 	uint32_t reg;
 	uint16_t guarant_cnt, best_cnt;
-	int i;
+	uint16_t i;
 
 	I40E_WRITE_REG(hw, I40E_PFQF_CTL_1, I40E_PFQF_CTL_1_CLEARFDTABLE_MASK);
 	I40E_WRITE_FLUSH(hw);
@@ -881,7 +881,7 @@  i40e_fdir_ctrl_func(struct rte_eth_dev *dev,
 		return ret;
 	}
 
-	if (arg == NULL)
+	if (arg == NULL && filter_op != RTE_ETH_FILTER_FLUSH)
 		return -EINVAL;
 
 	switch (filter_op) {
@@ -895,6 +895,9 @@  i40e_fdir_ctrl_func(struct rte_eth_dev *dev,
 			(struct rte_eth_fdir_filter *)arg,
 			FALSE);
 		break;
+	case RTE_ETH_FILTER_FLUSH:
+		ret = i40e_fdir_flush(dev);
+		break;
 	default:
 		PMD_DRV_LOG(ERR, "unknown operation %u.", filter_op);
 		ret = -EINVAL;