]> git.droids-corp.org - dpdk.git/commitdiff
net/i40e: fix flow director enabling
authorWei Zhao <wei.zhao1@intel.com>
Thu, 21 May 2020 08:03:06 +0000 (16:03 +0800)
committerFerruh Yigit <ferruh.yigit@intel.com>
Fri, 22 May 2020 15:10:15 +0000 (17:10 +0200)
When we flush flow FDIR, all queues are disabled for FDIR.
If FDIR rule is created again, then the flow list is empty,
as it is the first time to create rule after flush fdir filter,
so we need to enable FDIR for all queues.
And also, disable FDIR for queues should be done in function
i40e_flow_flush_fdir_filter().

Fixes: 1491f63c7559 ("net/i40e: fix flush of flow director filter")
Fixes: 6ae9b2b5e8c2 ("net/i40e: cache flow director enable value in Rx queue")
Cc: stable@dpdk.org
Signed-off-by: Wei Zhao <wei.zhao1@intel.com>
Reviewed-by: Jeff Guo <jia.guo@intel.com>
drivers/net/i40e/i40e_flow.c

index 25c77e7aa6e60feb9c34343adaee0e6592b6ab3b..8f8df6fae9a12eb7aa7a37338a71199dc8940036 100644 (file)
@@ -3462,6 +3462,10 @@ i40e_flow_parse_fdir_filter(struct rte_eth_dev *dev,
                }
        }
 
+       /* If create the first fdir rule, enable fdir check for rx queues */
+       if (TAILQ_EMPTY(&pf->fdir.fdir_list))
+               i40e_fdir_rx_proc_enable(dev, 1);
+
        return 0;
 err:
        i40e_fdir_teardown(pf);
@@ -5330,9 +5334,6 @@ i40e_flow_flush(struct rte_eth_dev *dev, struct rte_flow_error *error)
                return -rte_errno;
        }
 
-       /* Disable FDIR processing as all FDIR rules are now flushed */
-       i40e_fdir_rx_proc_enable(dev, 0);
-
        return ret;
 }
 
@@ -5368,6 +5369,9 @@ i40e_flow_flush_fdir_filter(struct i40e_pf *pf)
                for (pctype = I40E_FILTER_PCTYPE_NONF_IPV4_UDP;
                     pctype <= I40E_FILTER_PCTYPE_L2_PAYLOAD; pctype++)
                        pf->fdir.inset_flag[pctype] = 0;
+
+               /* Disable FDIR processing as all FDIR rules are now flushed */
+               i40e_fdir_rx_proc_enable(dev, 0);
        }
 
        return ret;