[2/2] net/i40e: fix fdir rule destroy failure

Message ID 20190722120639.62468-2-xiaolong.ye@intel.com (mailing list archive)
State Accepted, archived
Delegated to: Qi Zhang
Headers
Series [1/2] net/i40e: fix ether pattern rule for fdir |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation fail Compilation issues

Commit Message

Xiaolong Ye July 22, 2019, 12:06 p.m. UTC
  We should tear down the fdir when the last flow is destroyed, current
logic is opposite to expected behavior, this patch fixes this issue.

Fixes: 2e67a7fbf3ff ("net/i40e: config flow director automatically")
Cc: stable@dpdk.org
Cc: xiaoyun.li@intel.com

Signed-off-by: Xiaolong Ye <xiaolong.ye@intel.com>
---
 drivers/net/i40e/i40e_flow.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Comments

Xing, Beilei July 23, 2019, 7:11 a.m. UTC | #1
> -----Original Message-----
> From: Ye, Xiaolong
> Sent: Monday, July 22, 2019 8:07 PM
> To: Yigit, Ferruh <ferruh.yigit@intel.com>; Xing, Beilei
> <beilei.xing@intel.com>; Zhang, Qi Z <qi.z.zhang@intel.com>
> Cc: dev@dpdk.org; Ye, Xiaolong <xiaolong.ye@intel.com>; stable@dpdk.org;
> Li, Xiaoyun <xiaoyun.li@intel.com>
> Subject: [PATCH 2/2] net/i40e: fix fdir rule destroy failure
> 
> We should tear down the fdir when the last flow is destroyed, current logic is
> opposite to expected behavior, this patch fixes this issue.
> 
> Fixes: 2e67a7fbf3ff ("net/i40e: config flow director automatically")
> Cc: stable@dpdk.org
> Cc: xiaoyun.li@intel.com
> 
> Signed-off-by: Xiaolong Ye <xiaolong.ye@intel.com>
> ---
>  drivers/net/i40e/i40e_flow.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/net/i40e/i40e_flow.c b/drivers/net/i40e/i40e_flow.c index
> 3c0af70c0..c60c9e240 100644
> --- a/drivers/net/i40e/i40e_flow.c
> +++ b/drivers/net/i40e/i40e_flow.c
> @@ -4771,7 +4771,7 @@ i40e_flow_destroy(struct rte_eth_dev *dev,
>  		       &((struct i40e_fdir_filter *)flow->rule)->fdir, 0);
> 
>  		/* If the last flow is destroyed, disable fdir. */
> -		if (!ret && !TAILQ_EMPTY(&pf->fdir.fdir_list)) {
> +		if (!ret && TAILQ_EMPTY(&pf->fdir.fdir_list)) {
>  			i40e_fdir_teardown(pf);
>  			dev->data->dev_conf.fdir_conf.mode =
>  				   RTE_FDIR_MODE_NONE;
> --
> 2.17.0

Acked-by: Beilei Xing <beilei.xing@intel.com>
  
Qi Zhang July 23, 2019, 7:16 a.m. UTC | #2
> -----Original Message-----
> From: Xing, Beilei
> Sent: Tuesday, July 23, 2019 3:12 PM
> To: Ye, Xiaolong <xiaolong.ye@intel.com>; Yigit, Ferruh
> <ferruh.yigit@intel.com>; Zhang, Qi Z <qi.z.zhang@intel.com>
> Cc: dev@dpdk.org; stable@dpdk.org; Li, Xiaoyun <xiaoyun.li@intel.com>
> Subject: RE: [PATCH 2/2] net/i40e: fix fdir rule destroy failure
> 
> 
> 
> > -----Original Message-----
> > From: Ye, Xiaolong
> > Sent: Monday, July 22, 2019 8:07 PM
> > To: Yigit, Ferruh <ferruh.yigit@intel.com>; Xing, Beilei
> > <beilei.xing@intel.com>; Zhang, Qi Z <qi.z.zhang@intel.com>
> > Cc: dev@dpdk.org; Ye, Xiaolong <xiaolong.ye@intel.com>;
> > stable@dpdk.org; Li, Xiaoyun <xiaoyun.li@intel.com>
> > Subject: [PATCH 2/2] net/i40e: fix fdir rule destroy failure
> >
> > We should tear down the fdir when the last flow is destroyed, current
> > logic is opposite to expected behavior, this patch fixes this issue.
> >
> > Fixes: 2e67a7fbf3ff ("net/i40e: config flow director automatically")
> > Cc: stable@dpdk.org
> > Cc: xiaoyun.li@intel.com
> >
> > Signed-off-by: Xiaolong Ye <xiaolong.ye@intel.com>
> > ---
> Acked-by: Beilei Xing <beilei.xing@intel.com>

Applied to dpdk-next-net-intel.

Thanks
Qi
  

Patch

diff --git a/drivers/net/i40e/i40e_flow.c b/drivers/net/i40e/i40e_flow.c
index 3c0af70c0..c60c9e240 100644
--- a/drivers/net/i40e/i40e_flow.c
+++ b/drivers/net/i40e/i40e_flow.c
@@ -4771,7 +4771,7 @@  i40e_flow_destroy(struct rte_eth_dev *dev,
 		       &((struct i40e_fdir_filter *)flow->rule)->fdir, 0);
 
 		/* If the last flow is destroyed, disable fdir. */
-		if (!ret && !TAILQ_EMPTY(&pf->fdir.fdir_list)) {
+		if (!ret && TAILQ_EMPTY(&pf->fdir.fdir_list)) {
 			i40e_fdir_teardown(pf);
 			dev->data->dev_conf.fdir_conf.mode =
 				   RTE_FDIR_MODE_NONE;