Skip to content

Commit 83c911d

Browse files
Liu-Ivy-LingYuanguy11
authored andcommitted
ice: Reset FDIR counter in FDIR init stage
Reset the FDIR counters when FDIR inits. Without this patch, when VF initializes or resets, all the FDIR counters are not cleaned, which may cause unexpected behaviors for future FDIR rule create (e.g., rule conflict). Fixes: 1f7ea1c ("ice: Enable FDIR Configure for AVF") Signed-off-by: Junfeng Guo <[email protected]> Signed-off-by: Lingyu Liu <[email protected]> Tested-by: Rafal Romanowski <[email protected]> Signed-off-by: Tony Nguyen <[email protected]>
1 parent b4a01ac commit 83c911d

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

drivers/net/ethernet/intel/ice/ice_virtchnl_fdir.c

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -541,6 +541,21 @@ static void ice_vc_fdir_rem_prof_all(struct ice_vf *vf)
541541
}
542542
}
543543

544+
/**
545+
* ice_vc_fdir_reset_cnt_all - reset all FDIR counters for this VF FDIR
546+
* @fdir: pointer to the VF FDIR structure
547+
*/
548+
static void ice_vc_fdir_reset_cnt_all(struct ice_vf_fdir *fdir)
549+
{
550+
enum ice_fltr_ptype flow;
551+
552+
for (flow = ICE_FLTR_PTYPE_NONF_NONE;
553+
flow < ICE_FLTR_PTYPE_MAX; flow++) {
554+
fdir->fdir_fltr_cnt[flow][0] = 0;
555+
fdir->fdir_fltr_cnt[flow][1] = 0;
556+
}
557+
}
558+
544559
/**
545560
* ice_vc_fdir_has_prof_conflict
546561
* @vf: pointer to the VF structure
@@ -1998,6 +2013,7 @@ void ice_vf_fdir_init(struct ice_vf *vf)
19982013
spin_lock_init(&fdir->ctx_lock);
19992014
fdir->ctx_irq.flags = 0;
20002015
fdir->ctx_done.flags = 0;
2016+
ice_vc_fdir_reset_cnt_all(fdir);
20012017
}
20022018

20032019
/**

0 commit comments

Comments
 (0)