[v5,2/4] net/ice: fix removal of FDIR profile

Message ID 20191113013758.39664-3-shougangx.wang@intel.com (mailing list archive)
State Accepted, archived
Delegated to: xiaolong ye
Headers
Series net/ice: fix memory release in FDIR |

Checks

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

Commit Message

Shougang Wang Nov. 13, 2019, 1:37 a.m. UTC
  The removal of FDIR profile should start from the next
of ICE_FLTR_PTYPE_NONF_NONE.

Fixes: 109e8e06249e ("net/ice: configure HW flow director rule")

Signed-off-by: Wang ShougangX <shougangx.wang@intel.com>
---
 drivers/net/ice/ice_fdir_filter.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
  

Comments

Qiming Yang Nov. 13, 2019, 8:44 a.m. UTC | #1
Hi,

> -----Original Message-----
> From: Wang, ShougangX
> Sent: Wednesday, November 13, 2019 9:38 AM
> To: dev@dpdk.org
> Cc: Yang, Qiming <qiming.yang@intel.com>; Zhang, Qi Z
> <qi.z.zhang@intel.com>; Wang, ShougangX <shougangx.wang@intel.com>
> Subject: [PATCH v5 2/4] net/ice: fix removal of FDIR profile
> 
> The removal of FDIR profile should start from the next of
> ICE_FLTR_PTYPE_NONF_NONE.
> 
> Fixes: 109e8e06249e ("net/ice: configure HW flow director rule")
> 
> Signed-off-by: Wang ShougangX <shougangx.wang@intel.com>
> ---
>  drivers/net/ice/ice_fdir_filter.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/net/ice/ice_fdir_filter.c b/drivers/net/ice/ice_fdir_filter.c
> index a89c506c0..39c0efbdc 100644
> --- a/drivers/net/ice/ice_fdir_filter.c
> +++ b/drivers/net/ice/ice_fdir_filter.c
> @@ -152,7 +152,7 @@ ice_fdir_prof_alloc(struct ice_hw *hw)
>  		if (!hw->fdir_prof)
>  			return -ENOMEM;
>  	}
> -	for (ptype = ICE_FLTR_PTYPE_NONF_IPV4_UDP;
> +	for (ptype = ICE_FLTR_PTYPE_NONF_NONE + 1;
>  	     ptype < ICE_FLTR_PTYPE_MAX;
>  	     ptype++) {
>  		if (!hw->fdir_prof[ptype]) {
> @@ -165,7 +165,7 @@ ice_fdir_prof_alloc(struct ice_hw *hw)
>  	return 0;
> 
>  fail_mem:
> -	for (fltr_ptype = ICE_FLTR_PTYPE_NONF_IPV4_UDP;
> +	for (fltr_ptype = ICE_FLTR_PTYPE_NONF_NONE + 1;
>  	     fltr_ptype < ptype;
>  	     fltr_ptype++)
>  		rte_free(hw->fdir_prof[fltr_ptype]);
> @@ -521,7 +521,7 @@ ice_fdir_prof_free(struct ice_hw *hw)  {
>  	enum ice_fltr_ptype ptype;
> 
> -	for (ptype = ICE_FLTR_PTYPE_NONF_IPV4_UDP;
> +	for (ptype = ICE_FLTR_PTYPE_NONF_NONE + 1;
>  	     ptype < ICE_FLTR_PTYPE_MAX;
>  	     ptype++)
>  		rte_free(hw->fdir_prof[ptype]);
> @@ -571,7 +571,7 @@ ice_fdir_prof_rm_all(struct ice_pf *pf)  {
>  	enum ice_fltr_ptype ptype;
> 
> -	for (ptype = ICE_FLTR_PTYPE_NONF_NONE;
> +	for (ptype = ICE_FLTR_PTYPE_NONF_NONE + 1;
>  	     ptype < ICE_FLTR_PTYPE_MAX;
>  	     ptype++) {
>  		ice_fdir_prof_rm(pf, ptype, false);
> --
> 2.17.1

Acked-by: Qiming Yang <Qiming.yang@intel.com>
  

Patch

diff --git a/drivers/net/ice/ice_fdir_filter.c b/drivers/net/ice/ice_fdir_filter.c
index a89c506c0..39c0efbdc 100644
--- a/drivers/net/ice/ice_fdir_filter.c
+++ b/drivers/net/ice/ice_fdir_filter.c
@@ -152,7 +152,7 @@  ice_fdir_prof_alloc(struct ice_hw *hw)
 		if (!hw->fdir_prof)
 			return -ENOMEM;
 	}
-	for (ptype = ICE_FLTR_PTYPE_NONF_IPV4_UDP;
+	for (ptype = ICE_FLTR_PTYPE_NONF_NONE + 1;
 	     ptype < ICE_FLTR_PTYPE_MAX;
 	     ptype++) {
 		if (!hw->fdir_prof[ptype]) {
@@ -165,7 +165,7 @@  ice_fdir_prof_alloc(struct ice_hw *hw)
 	return 0;
 
 fail_mem:
-	for (fltr_ptype = ICE_FLTR_PTYPE_NONF_IPV4_UDP;
+	for (fltr_ptype = ICE_FLTR_PTYPE_NONF_NONE + 1;
 	     fltr_ptype < ptype;
 	     fltr_ptype++)
 		rte_free(hw->fdir_prof[fltr_ptype]);
@@ -521,7 +521,7 @@  ice_fdir_prof_free(struct ice_hw *hw)
 {
 	enum ice_fltr_ptype ptype;
 
-	for (ptype = ICE_FLTR_PTYPE_NONF_IPV4_UDP;
+	for (ptype = ICE_FLTR_PTYPE_NONF_NONE + 1;
 	     ptype < ICE_FLTR_PTYPE_MAX;
 	     ptype++)
 		rte_free(hw->fdir_prof[ptype]);
@@ -571,7 +571,7 @@  ice_fdir_prof_rm_all(struct ice_pf *pf)
 {
 	enum ice_fltr_ptype ptype;
 
-	for (ptype = ICE_FLTR_PTYPE_NONF_NONE;
+	for (ptype = ICE_FLTR_PTYPE_NONF_NONE + 1;
 	     ptype < ICE_FLTR_PTYPE_MAX;
 	     ptype++) {
 		ice_fdir_prof_rm(pf, ptype, false);