Skip to content

Commit eb2af3e

Browse files
bcreeley13Jeff Kirsher
authored andcommitted
ice: Add function to set trust mode bit on reset
As the title says, use a function to set trust mode bit on reset. Signed-off-by: Brett Creeley <[email protected]> Tested-by: Andrew Bowers <[email protected]> Signed-off-by: Jeff Kirsher <[email protected]>
1 parent a06325a commit eb2af3e

File tree

1 file changed

+13
-4
lines changed

1 file changed

+13
-4
lines changed

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

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -610,6 +610,18 @@ static int ice_alloc_vsi_res(struct ice_vf *vf)
610610
return status;
611611
}
612612

613+
/**
614+
* ice_vf_set_host_trust_cfg - set trust setting based on pre-reset value
615+
* @vf: VF to configure trust setting for
616+
*/
617+
static void ice_vf_set_host_trust_cfg(struct ice_vf *vf)
618+
{
619+
if (vf->trusted)
620+
set_bit(ICE_VIRTCHNL_VF_CAP_PRIVILEGE, &vf->vf_caps);
621+
else
622+
clear_bit(ICE_VIRTCHNL_VF_CAP_PRIVILEGE, &vf->vf_caps);
623+
}
624+
613625
/**
614626
* ice_alloc_vf_res - Allocate VF resources
615627
* @vf: pointer to the VF structure
@@ -635,10 +647,7 @@ static int ice_alloc_vf_res(struct ice_vf *vf)
635647
if (status)
636648
goto ice_alloc_vf_res_exit;
637649

638-
if (vf->trusted)
639-
set_bit(ICE_VIRTCHNL_VF_CAP_PRIVILEGE, &vf->vf_caps);
640-
else
641-
clear_bit(ICE_VIRTCHNL_VF_CAP_PRIVILEGE, &vf->vf_caps);
650+
ice_vf_set_host_trust_cfg(vf);
642651

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

0 commit comments

Comments
 (0)