Commit 772dec64 authored by Brett Creeley's avatar Brett Creeley Committed by Tony Nguyen

ice: Add more usage of existing function ice_get_vf_vsi(vf)

Extend the usage of function ice_get_vf_vsi(vf) in multiple places
instead of VF's VSI by using a long string of dereferences
(i.e. vf->pf->vsi[vf->lan_vsi_idx]).
Signed-off-by: default avatarBrett Creeley <brett.creeley@intel.com>
Signed-off-by: default avatarKalyan Kodamagula <kalyan.kodamagula@intel.com>
Tested-by: default avatarPiotr Tyda <piotr.tyda@intel.com>
Signed-off-by: default avatarTony Nguyen <anthony.l.nguyen@intel.com>
parent c21adf25
...@@ -113,7 +113,7 @@ ice_vc_fdir_param_check(struct ice_vf *vf, u16 vsi_id) ...@@ -113,7 +113,7 @@ ice_vc_fdir_param_check(struct ice_vf *vf, u16 vsi_id)
if (!ice_vc_isvalid_vsi_id(vf, vsi_id)) if (!ice_vc_isvalid_vsi_id(vf, vsi_id))
return -EINVAL; return -EINVAL;
if (!pf->vsi[vf->lan_vsi_idx]) if (!ice_get_vf_vsi(vf))
return -EINVAL; return -EINVAL;
return 0; return 0;
...@@ -494,7 +494,7 @@ ice_vc_fdir_rem_prof(struct ice_vf *vf, enum ice_fltr_ptype flow, int tun) ...@@ -494,7 +494,7 @@ ice_vc_fdir_rem_prof(struct ice_vf *vf, enum ice_fltr_ptype flow, int tun)
vf_prof = fdir->fdir_prof[flow]; vf_prof = fdir->fdir_prof[flow];
vf_vsi = pf->vsi[vf->lan_vsi_idx]; vf_vsi = ice_get_vf_vsi(vf);
if (!vf_vsi) { if (!vf_vsi) {
dev_dbg(dev, "NULL vf %d vsi pointer\n", vf->vf_id); dev_dbg(dev, "NULL vf %d vsi pointer\n", vf->vf_id);
return; return;
...@@ -572,7 +572,7 @@ ice_vc_fdir_write_flow_prof(struct ice_vf *vf, enum ice_fltr_ptype flow, ...@@ -572,7 +572,7 @@ ice_vc_fdir_write_flow_prof(struct ice_vf *vf, enum ice_fltr_ptype flow,
pf = vf->pf; pf = vf->pf;
dev = ice_pf_to_dev(pf); dev = ice_pf_to_dev(pf);
hw = &pf->hw; hw = &pf->hw;
vf_vsi = pf->vsi[vf->lan_vsi_idx]; vf_vsi = ice_get_vf_vsi(vf);
if (!vf_vsi) if (!vf_vsi)
return -EINVAL; return -EINVAL;
...@@ -1205,7 +1205,7 @@ static int ice_vc_fdir_write_fltr(struct ice_vf *vf, ...@@ -1205,7 +1205,7 @@ static int ice_vc_fdir_write_fltr(struct ice_vf *vf,
pf = vf->pf; pf = vf->pf;
dev = ice_pf_to_dev(pf); dev = ice_pf_to_dev(pf);
hw = &pf->hw; hw = &pf->hw;
vsi = pf->vsi[vf->lan_vsi_idx]; vsi = ice_get_vf_vsi(vf);
if (!vsi) { if (!vsi) {
dev_dbg(dev, "Invalid vsi for VF %d\n", vf->vf_id); dev_dbg(dev, "Invalid vsi for VF %d\n", vf->vf_id);
return -EINVAL; return -EINVAL;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment