summaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/intel
diff options
context:
space:
mode:
authorBrett Creeley <brett.creeley@intel.com>2020-05-15 17:51:12 -0700
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>2020-05-28 16:07:21 -0700
commiteb2af3ee94de7f493745adc34bb9d170ced8c5a9 (patch)
tree36ba7dce725ffcee588dae57b601fff77fd5ef5a /drivers/net/ethernet/intel
parenta06325a0901a887009d28e9fa06168d05c35c941 (diff)
downloadlinux-eb2af3ee94de7f493745adc34bb9d170ced8c5a9.tar.bz2
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 <brett.creeley@intel.com> Tested-by: Andrew Bowers <andrewx.bowers@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Diffstat (limited to 'drivers/net/ethernet/intel')
-rw-r--r--drivers/net/ethernet/intel/ice/ice_virtchnl_pf.c17
1 files changed, 13 insertions, 4 deletions
diff --git a/drivers/net/ethernet/intel/ice/ice_virtchnl_pf.c b/drivers/net/ethernet/intel/ice/ice_virtchnl_pf.c
index 92a442ec7314..4005a4caf2f0 100644
--- a/drivers/net/ethernet/intel/ice/ice_virtchnl_pf.c
+++ b/drivers/net/ethernet/intel/ice/ice_virtchnl_pf.c
@@ -611,6 +611,18 @@ ice_alloc_vsi_res_exit:
}
/**
+ * 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
*/
@@ -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);