Lines Matching refs:snap
236 struct ice_mbx_snapshot *snap = &hw->mbx_snapshot; in ice_mbx_detect_malvf() local
238 if (vf_id >= snap->mbx_vf.vfcntr_len) in ice_mbx_detect_malvf()
242 snap->mbx_vf.vf_cntr[vf_id]++; in ice_mbx_detect_malvf()
244 if (snap->mbx_vf.vf_cntr[vf_id] >= ICE_ASYNC_VF_MSG_THRESHOLD) in ice_mbx_detect_malvf()
259 static void ice_mbx_reset_snapshot(struct ice_mbx_snapshot *snap) in ice_mbx_reset_snapshot() argument
263 if (!snap || !snap->mbx_vf.vf_cntr) in ice_mbx_reset_snapshot()
267 vfcntr_len = snap->mbx_vf.vfcntr_len; in ice_mbx_reset_snapshot()
269 memset(snap->mbx_vf.vf_cntr, 0, in ice_mbx_reset_snapshot()
270 (vfcntr_len * sizeof(*snap->mbx_vf.vf_cntr))); in ice_mbx_reset_snapshot()
273 memset(&snap->mbx_buf, 0, sizeof(snap->mbx_buf)); in ice_mbx_reset_snapshot()
274 snap->mbx_buf.state = ICE_MAL_VF_DETECT_STATE_NEW_SNAPSHOT; in ice_mbx_reset_snapshot()
305 struct ice_mbx_snapshot *snap = &hw->mbx_snapshot; in ice_mbx_vf_state_handler() local
335 snap_buf = &snap->mbx_buf; in ice_mbx_vf_state_handler()
340 ice_mbx_reset_snapshot(snap); in ice_mbx_vf_state_handler()
445 ice_mbx_clear_malvf(struct ice_mbx_snapshot *snap, unsigned long *all_malvfs, in ice_mbx_clear_malvf() argument
448 if (!snap || !all_malvfs) in ice_mbx_clear_malvf()
451 if (bitmap_len < snap->mbx_vf.vfcntr_len) in ice_mbx_clear_malvf()
455 if (vf_id >= bitmap_len || vf_id >= snap->mbx_vf.vfcntr_len) in ice_mbx_clear_malvf()
467 snap->mbx_vf.vf_cntr[vf_id] = 0; in ice_mbx_clear_malvf()
487 struct ice_mbx_snapshot *snap = &hw->mbx_snapshot; in ice_mbx_init_snapshot() local
496 snap->mbx_vf.vf_cntr = devm_kcalloc(ice_hw_to_dev(hw), vf_count, in ice_mbx_init_snapshot()
497 sizeof(*snap->mbx_vf.vf_cntr), in ice_mbx_init_snapshot()
499 if (!snap->mbx_vf.vf_cntr) in ice_mbx_init_snapshot()
505 snap->mbx_vf.vfcntr_len = vf_count; in ice_mbx_init_snapshot()
510 memset(&snap->mbx_buf, 0, sizeof(snap->mbx_buf)); in ice_mbx_init_snapshot()
511 snap->mbx_buf.state = ICE_MAL_VF_DETECT_STATE_NEW_SNAPSHOT; in ice_mbx_init_snapshot()
524 struct ice_mbx_snapshot *snap = &hw->mbx_snapshot; in ice_mbx_deinit_snapshot() local
527 devm_kfree(ice_hw_to_dev(hw), snap->mbx_vf.vf_cntr); in ice_mbx_deinit_snapshot()
528 snap->mbx_vf.vfcntr_len = 0; in ice_mbx_deinit_snapshot()
531 memset(&snap->mbx_buf, 0, sizeof(snap->mbx_buf)); in ice_mbx_deinit_snapshot()