All of lore.kernel.org
 help / color / mirror / Atom feed
* [Intel-wired-lan] [PATCH net v1] ice: add FDIR counter reset in FDIR init stage
@ 2023-02-13  5:54 Lingyu Liu
  2023-02-22  9:36 ` Tyda, Piotr
  0 siblings, 1 reply; 2+ messages in thread
From: Lingyu Liu @ 2023-02-13  5:54 UTC (permalink / raw)
  To: intel-wired-lan; +Cc: Junfeng Guo

From: Junfeng Guo <junfeng.guo@intel.com>

When FDIR exited under abnormal circumstances (e.g., kill -9), all
the FDIR counters will not be cleaned, which will cause unexpected
behaviors for future FDIR rule create (e.g., rule conflict). This
patch fixed the issue via resetting all the FDIR counters in FDIR
init stage.

Fixes: 1f7ea1cd6a37 ("ice: Enable FDIR Configure for AVF")
Signed-off-by: Junfeng Guo <junfeng.guo@intel.com>
Signed-off-by: Lingyu Liu <lingyu.liu@intel.com>
---
 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;
+	}
+}
+
 /**
  * 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);
 }
 
 /**
-- 
2.25.1

_______________________________________________
Intel-wired-lan mailing list
Intel-wired-lan@osuosl.org
https://lists.osuosl.org/mailman/listinfo/intel-wired-lan

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [Intel-wired-lan] [PATCH net v1] ice: add FDIR counter reset in FDIR init stage
  2023-02-13  5:54 [Intel-wired-lan] [PATCH net v1] ice: add FDIR counter reset in FDIR init stage Lingyu Liu
@ 2023-02-22  9:36 ` Tyda, Piotr
  0 siblings, 0 replies; 2+ messages in thread
From: Tyda, Piotr @ 2023-02-22  9:36 UTC (permalink / raw)
  To: intel-wired-lan

> -----Original Message-----
> From: Intel-wired-lan <intel-wired-lan-bounces@osuosl.org> On Behalf Of
> Lingyu Liu
> Sent: Monday, February 13, 2023 6:54 AM
> To: intel-wired-lan@lists.osuosl.org
> Cc: Guo, Junfeng <junfeng.guo@intel.com>
> Subject: [Intel-wired-lan] [PATCH net v1] ice: add FDIR counter reset in FDIR
> init stage
> 
> From: Junfeng Guo <junfeng.guo@intel.com>
> 
> When FDIR exited under abnormal circumstances (e.g., kill -9), all the FDIR
> counters will not be cleaned, which will cause unexpected behaviors for
> future FDIR rule create (e.g., rule conflict). This patch fixed the issue via
> resetting all the FDIR counters in FDIR init stage.
> 
> Fixes: 1f7ea1cd6a37 ("ice: Enable FDIR Configure for AVF")
> Signed-off-by: Junfeng Guo <junfeng.guo@intel.com>
> Signed-off-by: Lingyu Liu <lingyu.liu@intel.com>
> ---
>  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

Tested-by: Piotr Tyda <piotr.tyda@intel.com>
_______________________________________________
Intel-wired-lan mailing list
Intel-wired-lan@osuosl.org
https://lists.osuosl.org/mailman/listinfo/intel-wired-lan

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-02-22  9:37 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-02-13  5:54 [Intel-wired-lan] [PATCH net v1] ice: add FDIR counter reset in FDIR init stage Lingyu Liu
2023-02-22  9:36 ` Tyda, Piotr

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.