net/ice/base: fix duplicate flow rules

Message ID 20221013062113.96088-1-yidingx.zhou@intel.com (mailing list archive)
State Accepted, archived
Delegated to: Qi Zhang
Headers
Series net/ice/base: fix duplicate flow rules |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation success Compilation OK
ci/intel-Testing success Testing PASS
ci/iol-mellanox-Performance success Performance Testing PASS
ci/iol-aarch64-unit-testing success Testing PASS
ci/github-robot: build success github build: passed
ci/iol-x86_64-unit-testing success Testing PASS
ci/iol-aarch64-compile-testing success Testing PASS
ci/iol-intel-Functional success Functional Testing PASS
ci/iol-x86_64-compile-testing success Testing PASS
ci/iol-intel-Performance success Performance Testing PASS

Commit Message

Yiding Zhou Oct. 13, 2022, 6:21 a.m. UTC
  When a vsi that already exists in the created vsi_list subscribes to the
same filter again, the return value ICE_SUCCESS results in duplicate flow
rules to be stored, which will cause 'flush' and 'destroy' errors.

Fixes: fed0c5ca5f19 ("net/ice/base: support programming a new switch recipe")
Cc: stable@dpdk.org

Signed-off-by: Yiding Zhou <yidingx.zhou@intel.com>
---
 drivers/net/ice/base/ice_switch.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Comments

Ke Xu Oct. 19, 2022, 12:19 p.m. UTC | #1
> -----Original Message-----
> From: Yiding Zhou <yidingx.zhou@intel.com>
> Sent: Thursday, October 13, 2022 2:21 PM
> To: dev@dpdk.org
> Cc: Zhou, YidingX <yidingx.zhou@intel.com>; stable@dpdk.org
> Subject: [PATCH] net/ice/base: fix duplicate flow rules
> 
> When a vsi that already exists in the created vsi_list subscribes to the same
> filter again, the return value ICE_SUCCESS results in duplicate flow rules to be
> stored, which will cause 'flush' and 'destroy' errors.
> 
> Fixes: fed0c5ca5f19 ("net/ice/base: support programming a new switch
> recipe")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Yiding Zhou <yidingx.zhou@intel.com>

Validated and passed on DPDK 22.11 rc1.
Also managed applying and passed validation on DPDK 20.11.

Tested-by: Ke Xu <ke1.xu@intel.com>

> ---
>  drivers/net/ice/base/ice_switch.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> 2.34.1
  
Yiding Zhou Nov. 8, 2022, 6:37 a.m. UTC | #2
Hi, Qi

This  patch has been merged to kernel driver.
Should  it be merged to dpdk now? 

> -----Original Message-----
> From: Zhou, YidingX <yidingx.zhou@intel.com>
> Sent: Thursday, October 13, 2022 2:21 PM
> To: dev@dpdk.org
> Cc: Zhou, YidingX <yidingx.zhou@intel.com>; stable@dpdk.org
> Subject: [PATCH] net/ice/base: fix duplicate flow rules
> 
> When a vsi that already exists in the created vsi_list subscribes to the same
> filter again, the return value ICE_SUCCESS results in duplicate flow rules to be
> stored, which will cause 'flush' and 'destroy' errors.
> 
> Fixes: fed0c5ca5f19 ("net/ice/base: support programming a new switch recipe")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Yiding Zhou <yidingx.zhou@intel.com>
> ---
>  drivers/net/ice/base/ice_switch.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/net/ice/base/ice_switch.c
> b/drivers/net/ice/base/ice_switch.c
> index 4b115ce660..a2581f404d 100644
> --- a/drivers/net/ice/base/ice_switch.c
> +++ b/drivers/net/ice/base/ice_switch.c
> @@ -8786,7 +8786,7 @@ ice_adv_add_update_vsi_list(struct ice_hw *hw,
> 
>  		/* A rule already exists with the new VSI being added */
>  		if (ice_is_bit_set(m_entry->vsi_list_info->vsi_map, vsi_handle))
> -			return ICE_SUCCESS;
> +			return ICE_ERR_ALREADY_EXISTS;
> 
>  		/* Update the previously created VSI list set with
>  		 * the new VSI ID passed in
> --
> 2.34.1
  
Qi Zhang Nov. 9, 2022, 12:40 a.m. UTC | #3
> -----Original Message-----
> From: Xu, Ke1 <ke1.xu@intel.com>
> Sent: Wednesday, October 19, 2022 8:20 PM
> To: Zhou, YidingX <yidingx.zhou@intel.com>; dev@dpdk.org
> Cc: Zhou, YidingX <yidingx.zhou@intel.com>; stable@dpdk.org
> Subject: RE: [PATCH] net/ice/base: fix duplicate flow rules
> 
> 
> > -----Original Message-----
> > From: Yiding Zhou <yidingx.zhou@intel.com>
> > Sent: Thursday, October 13, 2022 2:21 PM
> > To: dev@dpdk.org
> > Cc: Zhou, YidingX <yidingx.zhou@intel.com>; stable@dpdk.org
> > Subject: [PATCH] net/ice/base: fix duplicate flow rules
> >
> > When a vsi that already exists in the created vsi_list subscribes to
> > the same filter again, the return value ICE_SUCCESS results in
> > duplicate flow rules to be stored, which will cause 'flush' and 'destroy'
> errors.
> >
> > Fixes: fed0c5ca5f19 ("net/ice/base: support programming a new switch
> > recipe")
> > Cc: stable@dpdk.org
> >
> > Signed-off-by: Yiding Zhou <yidingx.zhou@intel.com>
> 
> Validated and passed on DPDK 22.11 rc1.
> Also managed applying and passed validation on DPDK 20.11.
> 
> Tested-by: Ke Xu <ke1.xu@intel.com>

Applied to dpdk-next-net-intel.

Thanks
Qi
> 
> > ---
> >  drivers/net/ice/base/ice_switch.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > 2.34.1
  

Patch

diff --git a/drivers/net/ice/base/ice_switch.c b/drivers/net/ice/base/ice_switch.c
index 4b115ce660..a2581f404d 100644
--- a/drivers/net/ice/base/ice_switch.c
+++ b/drivers/net/ice/base/ice_switch.c
@@ -8786,7 +8786,7 @@  ice_adv_add_update_vsi_list(struct ice_hw *hw,
 
 		/* A rule already exists with the new VSI being added */
 		if (ice_is_bit_set(m_entry->vsi_list_info->vsi_map, vsi_handle))
-			return ICE_SUCCESS;
+			return ICE_ERR_ALREADY_EXISTS;
 
 		/* Update the previously created VSI list set with
 		 * the new VSI ID passed in