[Intel-wired-lan] [PATCH net v2] ice: add FDIR counter reset in FDIR init stage

Paul Menzel pmenzel at molgen.mpg.de
Mon Mar 27 09:08:55 UTC 2023


Dear Lingyu, dear Junfeng,


Thank you for the patch.

Am 09.03.23 um 03:49 schrieb Lingyu Liu:
> From: Junfeng Guo <junfeng.guo at intel.com>

A shorter commit message summary/title would be:

Reset FDIR counter in FDIR init stage

> This patch added the missing FDIR counters reset process when

What commit do you reference? If it’s about the current change, please use:

Add the missing FDIR counters reset process …

Better:

Reset the FDIR counters when …

> FDIR inits. Without this patch, when VF initializes or resets,
> all the FDIR counters will not be cleaned, which may cause

… are not cleaned …

> unexpected behaviors for future FDIR rule create (e.g., rule
> conflict).
> 
> Fixes: 1f7ea1cd6a37 ("ice: Enable FDIR Configure for AVF")
> Signed-off-by: Junfeng Guo <junfeng.guo at intel.com>
> Signed-off-by: Lingyu Liu <lingyu.liu at intel.com>
> ---
> v2: change commit message to apply more to a kernel use
> ---
>   drivers/net/ethernet/intel/ice/ice_virtchnl_fdir.c | 15 +++++++++++++++
>   1 file changed, 15 insertions(+)
> 
> diff --git a/drivers/net/ethernet/intel/ice/ice_virtchnl_fdir.c b/drivers/net/ethernet/intel/ice/ice_virtchnl_fdir.c
> index e6ef6b303222..60c9da4aac1d 100644
> --- a/drivers/net/ethernet/intel/ice/ice_virtchnl_fdir.c
> +++ b/drivers/net/ethernet/intel/ice/ice_virtchnl_fdir.c
> @@ -541,6 +541,20 @@ static void ice_vc_fdir_rem_prof_all(struct ice_vf *vf)
>   	}
>   }
>   
> +/**
> + * ice_vc_fdir_reset_cnt_all - reset all FDIR counters for this VF FDIR
> + * @fdir: pointer to the VF FDIR structure
> + */
> +static void ice_vc_fdir_reset_cnt_all(struct ice_vf_fdir *fdir)
> +{
> +	enum ice_fltr_ptype flow = ICE_FLTR_PTYPE_NONF_NONE;
> +
> +	for (; flow < ICE_FLTR_PTYPE_MAX; flow++) {
> +		fdir->fdir_fltr_cnt[flow][0] = 0;
> +		fdir->fdir_fltr_cnt[flow][1] = 0;
> +	}

In all other places this construct is written like:

	enum ice_fltr_ptype flow;

	for (flow = ICE_FLTR_PTYPE_NONF_NONE; flow < … ) {
		…
	}

> +}
> +
>   /**
>    * ice_vc_fdir_write_flow_prof
>    * @vf: pointer to the VF structure
> @@ -1924,6 +1938,7 @@ void ice_vf_fdir_init(struct ice_vf *vf)
>   	spin_lock_init(&fdir->ctx_lock);
>   	fdir->ctx_irq.flags = 0;
>   	fdir->ctx_done.flags = 0;
> +	ice_vc_fdir_reset_cnt_all(fdir);
>   }
>   
>   /**


Kind regards,

Paul


More information about the Intel-wired-lan mailing list