i40e: flush flow director table
authorJingjing Wu <jingjing.wu@intel.com>
Fri, 21 Nov 2014 00:46:46 +0000 (08:46 +0800)
committerThomas Monjalon <thomas.monjalon@6wind.com>
Mon, 24 Nov 2014 23:06:04 +0000 (00:06 +0100)
implement operation to flush flow director table

Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
lib/librte_pmd_i40e/i40e_fdir.c

index 2cfbc75..143754a 100644 (file)
@@ -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;