net/i40e: fix flow FDIR enable issue
PATCH 1/1 net/i40e: fix flow FDIR enable issue
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 FDRI for all queues. And also, disable FDIR for queues should be done in function i40e_flow_flush_fdir_filter().
--- drivers/net/i40e/i40e_flow.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-)
drivers/net/i40e/i40e_flow.c +9 -3
@@ -3462,6 +3462,12 @@ i40e_flow_parse_fdir_filter(struct rte_eth_dev *dev, } } +/* If the flow list is empty, it is the first time to create +* rule after flush fdir filter, so enable fdir. +*/ +if (TAILQ_EMPTY (&pf->fdir.fdir_list)) +i40e_fdir_rx_proc_enable (dev,1 ); +return 0 ; err:i40e_fdir_teardown (pf);
@@ -5330,9 +5336,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 +5371,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;
Signature · 1 line
2.19.1
Quoted 66 lines
-----Original Message-----
From: dev [mailto:[email protected]] On Behalf Of Wei Zhao
Sent: Tuesday, May 19, 2020 3:17 PM
To: [email protected]
Cc: [email protected]; Xing, Beilei <[email protected]>; Guo, Jia <[email protected]>; Zhao1, Wei <[email protected]>
Subject: [dpdk-dev] [PATCH] net/i40e: fix flow FDIR enable issueWhen 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 FDRI for all queues. And also, disable FDIR for queues should be done in functioni40e_flow_flush_fdir_filter().Fixes 1491f63c7559 ("net/i40e: fix flush of flow director filter")Fixes 6ae9b2b5e8c2 ("net/i40e: cache flow director enable value in Rxqueue")
Signed-off-by Wei Zhao <[email protected]>--- drivers/net/i40e/i40e_flow.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-)drivers/net/i40e/i40e_flow.c +6
-0@@ -3462,6 +3462,12 @@ i40e_flow_parse_fdir_filter(struct rte_eth_dev *dev, } } +/* If the flow list is empty, it is the first time to create +* rule after flush fdir filter, so enable fdir. +*/ +if (TAILQ_EMPTY (&pf->fdir.fdir_list)) +i40e_fdir_rx_proc_enable (dev,1 ); +return 0 ; err:drivers/net/i40e/i40e_flow.c +3
-3i40e_fdir_teardown (pf);@@ -5330,9 +5336,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 +5371,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;
--
2.19.1
hi, zhaowei
Quoted 4 lines · Wei Zhao
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 FDRI for all queues. And also, disable FDIR
typo: FDRI -> FDIR, and could you modify something commit if you agree on below inline comment. Thanks.
Quoted 16 lines
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")Signed-off-by Wei Zhao <[email protected]>--- drivers/net/i40e/i40e_flow.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-)drivers/net/i40e/i40e_flow.c +0
-0
drivers/net/i40e/i40e_flow.c i40e_flow_parse_fdir_filter(struct rte_eth_dev *dev, · line 3467
Quoted 6 lines
drivers/net/i40e/i40e_flow.c +3
-0@@ -3462,6 +3462,12 @@ i40e_flow_parse_fdir_filter(struct rte_eth_dev *dev, } } +/* If the flow list is empty, it is the first time to create +* rule after flush fdir filter, so enable fdir. +*/
So either flush fdir filter or destroy the last fdir, it will result the flow list to be empty, could it simply as "If create the first fdir rule, enable fdir" or?
Quoted 26 lines
drivers/net/i40e/i40e_flow.c +6
-3+if (TAILQ_EMPTY (&pf->fdir.fdir_list)) +i40e_fdir_rx_proc_enable (dev,1 ); +return 0 ; err:i40e_fdir_teardown (pf);@@ -5330,9 +5336,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 +5371,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;
Hi, guojia
Quoted 10 lines
-----Original Message-----
From: Guo, Jia <[email protected]>
Sent: Wednesday, May 20, 2020 11:19 AM
To: Zhao1, Wei <[email protected]>; [email protected]
Cc: [email protected]; Xing, Beilei <[email protected]>
Subject: Re: [PATCH] net/i40e: fix flow FDIR enable issuehi, zhaowei
On 5/19/2020 3:16 PM, Wei Zhao wrote:
Quoted 8 lines
Quoted 4 lines
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 FDRI for all queues. And also, disable FDIR
typo: FDRI -> FDIR, and could you modify something commit if you agree on below inline comment. Thanks.
Ok,
Quoted 23 lines
Quoted 7 lines
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 Rxqueue")
drivers/net/i40e/i40e_flow.c i40e_flow_parse_fdir_filter(struct rte_eth_dev
Quoted 11 lines
Signed-off-by Wei Zhao <[email protected]>--- drivers/net/i40e/i40e_flow.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-)drivers/net/i40e/i40e_flow.c +0
-0@@ -3462,6 +3462,12 @@ i40e_flow_parse_fdir_filter(struct rte_eth_dev*dev,
Quoted 3 lines
drivers/net/i40e/i40e_flow.c +0
-0} }
Quoted 8 lines
drivers/net/i40e/i40e_flow.c i40e_flow_parse_fdir_filter(struct rte_eth_dev *dev, · line 3467
Quoted 3 lines
drivers/net/i40e/i40e_flow.c +3
-0+/* If the flow list is empty, it is the first time to create +* rule after flush fdir filter, so enable fdir. +*/ So either flush fdir filter or destroy the last fdir, it will result the flow list to be empty, could it simply as "If create the first fdir rule, enable fdir" or?
Ok
Quoted 29 lines
drivers/net/i40e/i40e_flow.c i40e_flow_flush(struct rte_eth_dev *dev, struct
Quoted 9 lines
drivers/net/i40e/i40e_flow.c +3
-0+if (TAILQ_EMPTY (&pf->fdir.fdir_list)) +i40e_fdir_rx_proc_enable (dev,1 ); +return 0 ; err:i40e_fdir_teardown (pf);@@ -5330,9 +5336,6 @@ i40e_flow_flush(struct rte_eth_dev *dev, struct
rte_flow_error*error)Quoted 19 lines
drivers/net/i40e/i40e_flow.c +3
-3return -rte_errno; } -/* Disable FDIR processing as all FDIR rules are now flushed */ -i40e_fdir_rx_proc_enable (dev,0 ); -return ret; }@@ -5368,6 +5371,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;
Quoted 31 lines
-----Original Message-----
From: Zhao1, Wei <[email protected]>
Sent: Tuesday, May 19, 2020 3:17 PM
To: [email protected]
Cc: [email protected]; Xing, Beilei <[email protected]>; Guo, Jia <[email protected]>; Zhao1, Wei <[email protected]>
Subject: [PATCH] net/i40e: fix flow FDIR enable issueWhen 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 FDRI for all queues. And also, disable FDIR for queues should be done in functioni40e_flow_flush_fdir_filter().Fixes 1491f63c7559 ("net/i40e: fix flush of flow director filter")Fixes 6ae9b2b5e8c2 ("net/i40e: cache flow director enable value in Rxqueue")
Signed-off-by Wei Zhao <[email protected]>--- drivers/net/i40e/i40e_flow.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-)drivers/net/i40e/i40e_flow.c index renamed from drivers/net/i40e/i40e_flow.c +0
-0
25c77e7aa..94fc73092100644
drivers/net/i40e/i40e_flow.c i40e_flow_parse_fdir_filter(struct rte_eth_dev · line 3471
Quoted 10 lines
drivers/net/i40e/i40e_flow.c +6
-0@@ -3462,6 +3462,12 @@ i40e_flow_parse_fdir_filter(struct rte_eth_dev *dev, } } +/* If the flow list is empty, it is the first time to create +* rule after flush fdir filter, so enable fdir. +*/ +if (TAILQ_EMPTY (&pf->fdir.fdir_list)) +i40e_fdir_rx_proc_enable (dev,1 ); +
i40e_fdir_rx_proc_enable is called in i40e_fdir_configure, so could you check if we can optimize this and if statement (pf->fdir.fdir_vsi == NULL) above?
Quoted 26 lines
drivers/net/i40e/i40e_flow.c +0
-0return 0 ; err:drivers/net/i40e/i40e_flow.c +3
-4i40e_fdir_teardown (pf);@@ -5330,9 +5336,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 +5371,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; --2.19.1
Quoted 45 lines
-----Original Message-----
From: Xing, Beilei <[email protected]>
Sent: Wednesday, May 20, 2020 12:14 PM
To: Zhao1, Wei <[email protected]>; [email protected]
Cc: [email protected]; Guo, Jia <[email protected]>
Subject: RE: [PATCH] net/i40e: fix flow FDIR enable issueQuoted 34 lines
-----Original Message-----
From: Zhao1, Wei <[email protected]>
Sent: Tuesday, May 19, 2020 3:17 PM
To: [email protected]
Cc: [email protected]; Xing, Beilei <[email protected]>; Guo, Jia <[email protected]>; Zhao1, Wei <[email protected]>
Subject: [PATCH] net/i40e: fix flow FDIR enable issueWhen 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 FDRI 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 Rxqueue")
Signed-off-by Wei Zhao <[email protected]>--- drivers/net/i40e/i40e_flow.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-)(quoted diff) +0
-0
b/drivers/net/i40e/i40e_flow.cindex25c77e7aa..94fc73092100644drivers/net/i40e/i40e_flow.c +0
-0@@ -3462,6 +3462,12 @@ i40e_flow_parse_fdir_filter(struct rte_eth_dev *dev, } }
Quoted 9 lines
drivers/net/i40e/i40e_flow.c i40e_flow_parse_fdir_filter(struct rte_eth_dev *dev, · line 3470
Quoted 6 lines
drivers/net/i40e/i40e_flow.c +6
-0+/* If the flow list is empty, it is the first time to create +* rule after flush fdir filter, so enable fdir. +*/ +if (TAILQ_EMPTY (&pf->fdir.fdir_list)) +i40e_fdir_rx_proc_enable (dev,1 ); +
i40e_fdir_rx_proc_enableis called ini40e_fdir_configure, so could you check if we can optimize this and if statement (pf->fdir.fdir_vsi== NULL) above?
No, when "flow flush 0", the pf->fdir.fdir_vs is not NULL, but list pf->fdir.fdir_list is empty.
Quoted 27 lines
Quoted 27 lines
drivers/net/i40e/i40e_flow.c +0
-0return 0 ; err:drivers/net/i40e/i40e_flow.c +3
-4i40e_fdir_teardown (pf);@@ -5330,9 +5336,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 +5371,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; --2.19.1
Quoted 64 lines
-----Original Message-----
From: Zhao1, Wei <[email protected]>
Sent: Wednesday, May 20, 2020 1:13 PM
To: Xing, Beilei <[email protected]>; [email protected]
Cc: [email protected]; Guo, Jia <[email protected]>
Subject: RE: [PATCH] net/i40e: fix flow FDIR enable issueQuoted 44 lines
-----Original Message-----
From: Xing, Beilei <[email protected]>
Sent: Wednesday, May 20, 2020 12:14 PM
To: Zhao1, Wei <[email protected]>; [email protected]
Cc: [email protected]; Guo, Jia <[email protected]>
Subject: RE: [PATCH] net/i40e: fix flow FDIR enable issueQuoted 35 lines
-----Original Message-----
From: Zhao1, Wei <[email protected]>
Sent: Tuesday, May 19, 2020 3:17 PM
To: [email protected]
Cc: [email protected]; Xing, Beilei <[email protected]>; Guo, Jia <[email protected]>; Zhao1, Wei <[email protected]>
Subject: [PATCH] net/i40e: fix flow FDIR enable issueWhen 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 FDRI 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 inRx
queue")Signed-off-by Wei Zhao <[email protected]>--- drivers/net/i40e/i40e_flow.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-)(quoted diff) +0
-0
b/drivers/net/i40e/i40e_flow.cindex25c77e7aa..94fc73092100644drivers/net/i40e/i40e_flow.c +0
-0@@ -3462,6 +3462,12 @@ i40e_flow_parse_fdir_filter(struct rte_eth_dev *dev, } }Quoted 9 lines
drivers/net/i40e/i40e_flow.c i40e_flow_parse_fdir_filter(struct rte_eth_dev *dev, · line 3470
Quoted 6 lines
drivers/net/i40e/i40e_flow.c +6
-0+/* If the flow list is empty, it is the first time to create +* rule after flush fdir filter, so enable fdir. +*/ +if (TAILQ_EMPTY (&pf->fdir.fdir_list)) +i40e_fdir_rx_proc_enable (dev,1 ); +
i40e_fdir_rx_proc_enableis called ini40e_fdir_configure, so could you check if we can optimize this and if statement (pf->fdir.fdir_vsi== NULL)
Quoted 4 lines
above?
No, when "flow flush 0", the
pf->fdir.fdir_vsis not NULL, but list pf-Quoted 1 line
fdir.fdir_list is empty.
Then seems i40e_fdir_rx_proc_enable(dev, 1) can be removed from i40e_fdir_configure, since i40e_fdir_rx_proc_enable(dev, 1) will always be called when the first FDIR rule is created and fdir_list is empty. Or we can use 'else if (TAILQ_EMPTY(&pf->fdir.fdir_list))' to avoid duplicate execution of i40e_fdir_rx_proc_enable(dev, 1).
Quoted 29 lines
Quoted 16 lines
Quoted 16 lines
drivers/net/i40e/i40e_flow.c +0
-0return 0 ; err:drivers/net/i40e/i40e_flow.c +0
-3i40e_fdir_teardown (pf);@@ -5330,9 +5336,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; }Quoted 6 lines
drivers/net/i40e/i40e_flow.c i40e_flow_flush_fdir_filter(struct i40e_pf *pf) · line 5375
Quoted 6 lines
drivers/net/i40e/i40e_flow.c +2
-0@@ -5368,6 +5371,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 */
Quoted 6 lines
Quoted 6 lines
drivers/net/i40e/i40e_flow.c +1
-1+i40e_fdir_rx_proc_enable (dev,0 ); }return ret; --2.19.1
Hi beilei
Quoted 77 lines
-----Original Message-----
From: Xing, Beilei <[email protected]>
Sent: Wednesday, May 20, 2020 3:37 PM
To: Zhao1, Wei <[email protected]>; [email protected]
Cc: [email protected]; Guo, Jia <[email protected]>
Subject: RE: [PATCH] net/i40e: fix flow FDIR enable issueQuoted 68 lines
-----Original Message-----
From: Zhao1, Wei <[email protected]>
Sent: Wednesday, May 20, 2020 1:13 PM
To: Xing, Beilei <[email protected]>; [email protected]
Cc: [email protected]; Guo, Jia <[email protected]>
Subject: RE: [PATCH] net/i40e: fix flow FDIR enable issueQuoted 45 lines
-----Original Message-----
From: Xing, Beilei <[email protected]>
Sent: Wednesday, May 20, 2020 12:14 PM
To: Zhao1, Wei <[email protected]>; [email protected]
Cc: [email protected]; Guo, Jia <[email protected]>
Subject: RE: [PATCH] net/i40e: fix flow FDIR enable issueQuoted 36 lines
-----Original Message-----
From: Zhao1, Wei <[email protected]>
Sent: Tuesday, May 19, 2020 3:17 PM
To: [email protected]
Cc: [email protected]; Xing, Beilei <[email protected]>; Guo, Jia <[email protected]>; Zhao1, Wei <[email protected]>
Subject: [PATCH] net/i40e: fix flow FDIR enable issueWhen 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 FDRI 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 directorfilter")
Fixes 6ae9b2b5e8c2 ("net/i40e: cache flow director enable valuein Rx
queue")Signed-off-by Wei Zhao <[email protected]>--- drivers/net/i40e/i40e_flow.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-)(quoted diff) +0
-0
b/drivers/net/i40e/i40e_flow.cindex25c77e7aa..94fc73092100644drivers/net/i40e/i40e_flow.c +0
-0@@ -3462,6 +3462,12 @@ i40e_flow_parse_fdir_filter(struct rte_eth_dev *dev, } }Quoted 10 lines
drivers/net/i40e/i40e_flow.c i40e_flow_parse_fdir_filter(struct rte_eth_dev *dev, · line 3470
Quoted 6 lines
drivers/net/i40e/i40e_flow.c +6
-0+/* If the flow list is empty, it is the first time to create +* rule after flush fdir filter, so enable fdir. +*/ +if (TAILQ_EMPTY (&pf->fdir.fdir_list)) +i40e_fdir_rx_proc_enable (dev,1 ); +
i40e_fdir_rx_proc_enableis called ini40e_fdir_configure, so could you check if we can optimize this and if statement (pf->fdir.fdir_vsi== NULL)above?
No, when "flow flush 0", the
pf->fdir.fdir_vsis not NULL, but list pf-
Quoted 7 lines
Quoted 1 line
Quoted 1 line
fdir.fdir_list is empty.
Then seems
i40e_fdir_rx_proc_enable(dev, 1)can be removed fromi40e_fdir_configure, sincei40e_fdir_rx_proc_enable(dev, 1)will always be called when the first FDIR rule is created andfdir_listis empty. Or we can use 'else if (TAILQ_EMPTY(&pf->fdir.fdir_list))' to avoid duplicate execution ofi40e_fdir_rx_proc_enable(dev, 1).
i40e_fdir_rx_proc_enable(dev, 1) can not be remove by now, because i40e_fdir_configure() will be used by legacy fdir. We can remove it only after i40 legacy API disappear. May be some user not using rte-flow FDIR.
Quoted 30 lines
Quoted 30 lines
Quoted 17 lines
Quoted 17 lines
drivers/net/i40e/i40e_flow.c +0
-0return 0 ; err:drivers/net/i40e/i40e_flow.c +0
-3i40e_fdir_teardown (pf);@@ -5330,9 +5336,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; }Quoted 6 lines
drivers/net/i40e/i40e_flow.c i40e_flow_flush_fdir_filter(struct i40e_pf *pf) · line 5375
Quoted 6 lines
drivers/net/i40e/i40e_flow.c +2
-0@@ -5368,6 +5371,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 */
Quoted 6 lines
Quoted 6 lines
drivers/net/i40e/i40e_flow.c +1
-1+i40e_fdir_rx_proc_enable (dev,0 ); }return ret; --2.19.1
PATCH v2 1/1 net/i40e: fix flow FDIR enable issue
In reply to Wei ZhaoWhen 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().
---
v2:
update log info
--- drivers/net/i40e/i40e_flow.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-)
drivers/net/i40e/i40e_flow.c +7 -3
@@ -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;
Signature · 1 line
2.19.1
hi, zhaowei
Quoted 25 lines · Wei Zhao
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")Signed-off-by Wei Zhao <[email protected]>---
v2:
update log info--- drivers/net/i40e/i40e_flow.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-)drivers/net/i40e/i40e_flow.c +0
-0
drivers/net/i40e/i40e_flow.c i40e_flow_parse_fdir_filter(struct rte_eth_dev *dev, · line 3468
Quoted 7 lines
drivers/net/i40e/i40e_flow.c +4
-0@@ -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 ); +
Do you think it is make sense that move the configure out of the priors condition? If so the list empty check is no need here.
if (pf->fdir.fdir_vsi == NULL) {
.....
}
ret = i40e_fdir_configure(dev);
Quoted 23 lines
drivers/net/i40e/i40e_flow.c +3
-3return 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;
Hi, jia
Quoted 50 lines
-----Original Message-----
From: Guo, Jia <[email protected]>
Sent: Thursday, May 21, 2020 10:27 PM
To: Zhao1, Wei <[email protected]>; [email protected]
Cc: [email protected]; Xing, Beilei <[email protected]>; Ye, Xiaolong <[email protected]>
Subject: Re: [PATCH v2] net/i40e: fix flow FDIR enable issuehi, zhaowei
drivers/net/i40e/i40e_flow.c i40e_flow_parse_fdir_filter(struct rte_eth_dev
Quoted 26 lines · Wei Zhao
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 Rxqueue")
Cc: [email protected]Signed-off-by Wei Zhao <[email protected]>---
v2:
update log info--- drivers/net/i40e/i40e_flow.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-)(quoted diff) +0
-0
b/drivers/net/i40e/i40e_flow.cindex25c77e7aa..8f8df6fae100644drivers/net/i40e/i40e_flow.c +0
-0@@ -3462,6 +3462,10 @@ i40e_flow_parse_fdir_filter(struct rte_eth_dev*dev,
drivers/net/i40e/i40e_flow.c i40e_flow_parse_fdir_filter(struct rte_eth_dev *dev, · line 3468
Quoted 7 lines
drivers/net/i40e/i40e_flow.c +4
-0} } +/* 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 ); +Do you think it is make sense that move the configure out of the priors condition? If so the list empty check is no need here.
Quoted 6 lines
if (
pf->fdir.fdir_vsi== NULL) {
.....
}ret =
i40e_fdir_configure(dev);
That seems more reasonable, but I do not know what will happen for this , because That will cause i40e_fdir_configure() be called every time when download rule. I dare not make this change for fear of introducing more problems.
Quoted 25 lines
drivers/net/i40e/i40e_flow.c i40e_flow_flush(struct rte_eth_dev *dev, struct
Quoted 5 lines
drivers/net/i40e/i40e_flow.c +0
-0return 0 ; err:i40e_fdir_teardown (pf);@@ -5330,9 +5334,6 @@ i40e_flow_flush(struct rte_eth_dev *dev, struct
rte_flow_error*error)Quoted 19 lines
drivers/net/i40e/i40e_flow.c +3
-3return -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;
Jeff Guo
Reviewed-byhi, zhaowei
Quoted 55 lines · Wei
Hi, jia
Quoted 53 lines
-----Original Message-----
From: Guo, Jia <[email protected]>
Sent: Thursday, May 21, 2020 10:27 PM
To: Zhao1, Wei <[email protected]>; [email protected]
Cc: [email protected]; Xing, Beilei <[email protected]>; Ye, Xiaolong <[email protected]>
Subject: Re: [PATCH v2] net/i40e: fix flow FDIR enable issuehi, zhaowei
drivers/net/i40e/i40e_flow.c i40e_flow_parse_fdir_filter(struct rte_eth_dev
Quoted 26 lines · Wei Zhao
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 Rxqueue")
Cc: [email protected]Signed-off-by Wei Zhao <[email protected]>---
v2:
update log info--- drivers/net/i40e/i40e_flow.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-)(quoted diff) +0
-0
b/drivers/net/i40e/i40e_flow.cindex25c77e7aa..8f8df6fae100644drivers/net/i40e/i40e_flow.c +0
-0@@ -3462,6 +3462,10 @@ i40e_flow_parse_fdir_filter(struct rte_eth_dev*dev,
drivers/net/i40e/i40e_flow.c i40e_flow_parse_fdir_filter(struct rte_eth_dev *dev, · line 3468
Quoted 7 lines
drivers/net/i40e/i40e_flow.c +4
-0} } +/* 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 ); +Do you think it is make sense that move the configure out of the priors condition? If so the list empty check is no need here.
if (pf->fdir.fdir_vsi == NULL) { ..... }
Quoted 5 lines
Quoted 2 lines
ret = i40e_fdir_configure(dev);That seems more reasonable, but I do not know what will happen for this , because That will cause
i40e_fdir_configure()be called every time when download rule. I dare not make this change for fear of introducing more problems.
make sense.
Quoted 23 lines
Quoted 23 lines
drivers/net/i40e/i40e_flow.c i40e_flow_flush(struct rte_eth_dev *dev, struct
Quoted 4 lines
drivers/net/i40e/i40e_flow.c +0
-0return 0 ; err:i40e_fdir_teardown (pf);@@ -5330,9 +5334,6 @@ i40e_flow_flush(struct rte_eth_dev *dev, struct
rte_flow_error*error)Quoted 18 lines
drivers/net/i40e/i40e_flow.c +3
-3return -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 ); }
Quoted 1 line
Quoted 1 line
drivers/net/i40e/i40e_flow.c i40e_flow_flush_fdir_filter(struct i40e_pf *pf) · line 5377
Quoted 1 line
drivers/net/i40e/i40e_flow.c +0
-0return ret;
Ye Xiaolong
AppliedQuoted 58 lines · Wei Zhao
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")Signed-off-by Wei Zhao <[email protected]>---
v2:
update log info
---drivers/net/i40e/i40e_flow.c| 10 +++++++---1 file changed, 7 insertions(+), 3 deletions(-)drivers/net/i40e/i40e_flow.c +4
-0@@ -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);drivers/net/i40e/i40e_flow.c +3
-3@@ -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;Signature · 1 line
2.19.1
Applied to dpdk-next-net-intel, Thanks.