net/i40e: fix recreating flexible flow director rule
authorGuinan Sun <guinanx.sun@intel.com>
Tue, 15 Sep 2020 06:52:25 +0000 (06:52 +0000)
committerFerruh Yigit <ferruh.yigit@intel.com>
Fri, 18 Sep 2020 16:55:11 +0000 (18:55 +0200)
This patch fixes the failure of recreate flexible fdir rule.
The root cause is that the flex_mask_flag is not reset during
flow destroy and flow flush.

Fixes: 6ced3dd72f5f ("net/i40e: support flexible payload parsing for FDIR")
Cc: stable@dpdk.org
Signed-off-by: Guinan Sun <guinanx.sun@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
drivers/net/i40e/i40e_fdir.c
drivers/net/i40e/i40e_flow.c

index 8e87b4a..aa8e729 100644 (file)
@@ -1882,6 +1882,8 @@ i40e_flow_add_del_fdir_filter(struct rte_eth_dev *dev,
                        return -EINVAL;
                }
 
+               pf->fdir.flex_mask_flag[pctype] = 0;
+
                if (fdir_info->fdir_invalprio == 1)
                        wait_status = false;
        }
index 51d8fdd..adc5da1 100644 (file)
@@ -5679,8 +5679,10 @@ i40e_flow_flush_fdir_filter(struct i40e_pf *pf)
                        I40E_MAX_FDIR_FILTER_NUM);
 
                for (pctype = I40E_FILTER_PCTYPE_NONF_IPV4_UDP;
-                    pctype <= I40E_FILTER_PCTYPE_L2_PAYLOAD; pctype++)
+                    pctype <= I40E_FILTER_PCTYPE_L2_PAYLOAD; pctype++) {
                        pf->fdir.inset_flag[pctype] = 0;
+                       pf->fdir.flex_mask_flag[pctype] = 0;
+               }
 
                /* Disable FDIR processing as all FDIR rules are now flushed */
                i40e_fdir_rx_proc_enable(dev, 0);