net/ixgbe: fix fdir mask not be reset
authorQi Zhang <qi.z.zhang@intel.com>
Thu, 1 Jun 2017 17:36:44 +0000 (13:36 -0400)
committerFerruh Yigit <ferruh.yigit@intel.com>
Mon, 12 Jun 2017 09:41:27 +0000 (10:41 +0100)
When the last fdir flow be destroyed, the flag "mask_added"
should be reset, so the remain mask info will not take effect
when a new flow be added.

Fixes: a14de8b498d1 ("net/ixgbe: destroy consistent filter")
Cc: stable@dpdk.org
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
drivers/net/ixgbe/ixgbe_flow.c

index ba6c0d3..c893ba6 100644 (file)
@@ -2639,6 +2639,8 @@ ixgbe_flow_destroy(struct rte_eth_dev *dev,
        struct ixgbe_eth_l2_tunnel_conf_ele *l2_tn_filter_ptr;
        struct ixgbe_fdir_rule_ele *fdir_rule_ptr;
        struct ixgbe_flow_mem *ixgbe_flow_mem_ptr;
+       struct ixgbe_hw_fdir_info *fdir_info =
+               IXGBE_DEV_PRIVATE_TO_FDIR_INFO(dev->data->dev_private);
 
        switch (filter_type) {
        case RTE_ETH_FILTER_NTUPLE:
@@ -2691,6 +2693,8 @@ ixgbe_flow_destroy(struct rte_eth_dev *dev,
                        TAILQ_REMOVE(&filter_fdir_list,
                                fdir_rule_ptr, entries);
                        rte_free(fdir_rule_ptr);
+                       if (TAILQ_EMPTY(&filter_fdir_list))
+                               fdir_info->mask_added = false;
                }
                break;
        case RTE_ETH_FILTER_L2_TUNNEL: