[dpdk-dev,v6,12/22] i40e: implement operation to flush flow director table
Commit Message
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(-)
@@ -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;