Skip to content

Commit

Permalink
ice: Add function to set trust mode bit on reset
Browse files Browse the repository at this point in the history
As the title says, use a function to set trust mode bit on reset.

Signed-off-by: Brett Creeley <brett.creeley@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
  • Loading branch information
Brett Creeley authored and Jeff Kirsher committed May 28, 2020
1 parent a06325a commit eb2af3e
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions drivers/net/ethernet/intel/ice/ice_virtchnl_pf.c
Original file line number Diff line number Diff line change
Expand Up @@ -610,6 +610,18 @@ static int ice_alloc_vsi_res(struct ice_vf *vf)
return status;
}

/**
* ice_vf_set_host_trust_cfg - set trust setting based on pre-reset value
* @vf: VF to configure trust setting for
*/
static void ice_vf_set_host_trust_cfg(struct ice_vf *vf)
{
if (vf->trusted)
set_bit(ICE_VIRTCHNL_VF_CAP_PRIVILEGE, &vf->vf_caps);
else
clear_bit(ICE_VIRTCHNL_VF_CAP_PRIVILEGE, &vf->vf_caps);
}

/**
* ice_alloc_vf_res - Allocate VF resources
* @vf: pointer to the VF structure
Expand All @@ -635,10 +647,7 @@ static int ice_alloc_vf_res(struct ice_vf *vf)
if (status)
goto ice_alloc_vf_res_exit;

if (vf->trusted)
set_bit(ICE_VIRTCHNL_VF_CAP_PRIVILEGE, &vf->vf_caps);
else
clear_bit(ICE_VIRTCHNL_VF_CAP_PRIVILEGE, &vf->vf_caps);
ice_vf_set_host_trust_cfg(vf);

/* VF is now completely initialized */
set_bit(ICE_VF_STATE_INIT, vf->vf_states);
Expand Down

0 comments on commit eb2af3e

Please sign in to comment.