FreeBSD/sys/dev/ixl/ixl_pf_iov.c
/* Handle any VFs that have reset themselves via a Function Level Reset(FLR). */
Handle any VFs that have reset themselves via a Function Level Reset(FLR).
Handle any VFs that have reset themselves via a Function Level Reset ( FLR ) .
void
ixl_handle_vflr(void *arg, int pending)
{
	struct ixl_pf *pf;
	struct ixl_vf *vf;
	struct i40e_hw *hw;
	uint16_t global_vf_num;
	uint32_t vflrstat_index, vflrstat_mask, vflrstat, icr0;
	int i;
	pf = arg;
	hw = &pf->hw;
	IXL_PF_LOCK(pf);
	for (i = 0; i < pf->num_vfs; i++) {
		global_vf_num = hw->func_caps.vf_base_id + i;
		vf = &pf->vfs[i];
		if (!(vf->vf_flags & VF_FLAG_ENABLED))
			continue;
		vflrstat_index = IXL_GLGEN_VFLRSTAT_INDEX(global_vf_num);
		vflrstat_mask = IXL_GLGEN_VFLRSTAT_MASK(global_vf_num);
		vflrstat = rd32(hw, I40E_GLGEN_VFLRSTAT(vflrstat_index));
		if (vflrstat & vflrstat_mask) {
			wr32(hw, I40E_GLGEN_VFLRSTAT(vflrstat_index),
			    vflrstat_mask);
			ixl_reinit_vf(pf, vf);
		}
	}
	icr0 = rd32(hw, I40E_PFINT_ICR0_ENA);
	icr0 |= I40E_PFINT_ICR0_ENA_VFLR_MASK;
	wr32(hw, I40E_PFINT_ICR0_ENA, icr0);
	ixl_flush(hw);
	IXL_PF_UNLOCK(pf);
}
void ixl_handle_vflr ( void * arg , int pending ) { struct ixl_pf * pf ; struct ixl_vf * vf ; struct i40e_hw * hw ; uint16_t global_vf_num ; uint32_t vflrstat_index , vflrstat_mask , vflrstat , icr0 ; int i ; pf = arg ; hw = & pf -> hw ; IXL_PF_LOCK ( pf ) ; for ( i = 0 ; i < pf -> num_vfs ; i ++ ) { global_vf_num = hw -> func_caps . vf_base_id + i ; vf = & pf -> vfs [ i ] ; if ( ! ( vf -> vf_flags & VF_FLAG_ENABLED ) ) continue ; vflrstat_index = IXL_GLGEN_VFLRSTAT_INDEX ( global_vf_num ) ; vflrstat_mask = IXL_GLGEN_VFLRSTAT_MASK ( global_vf_num ) ; vflrstat = rd32 ( hw , I40E_GLGEN_VFLRSTAT ( vflrstat_index ) ) ; if ( vflrstat & vflrstat_mask ) { wr32 ( hw , I40E_GLGEN_VFLRSTAT ( vflrstat_index ) , vflrstat_mask ) ; ixl_reinit_vf ( pf , vf ) ; } } icr0 = rd32 ( hw , I40E_PFINT_ICR0_ENA ) ; icr0 |= I40E_PFINT_ICR0_ENA_VFLR_MASK ; wr32 ( hw , I40E_PFINT_ICR0_ENA , icr0 ) ; ixl_flush ( hw ) ; IXL_PF_UNLOCK ( pf ) ; }
Handle any VFs that have reset themselves via a Function Level Reset(FLR).
Handle any VFs that have reset themselves via a Function Level Reset ( FLR ) .