* [Intel-wired-lan] [PATCH net-next v2] ice: Add more usage of existing function ice_get_vf_vsi(vf)
@ 2022-11-30 8:08 Kalyan Kodamagula
2022-11-30 19:02 ` Tony Nguyen
0 siblings, 1 reply; 2+ messages in thread
From: Kalyan Kodamagula @ 2022-11-30 8:08 UTC (permalink / raw)
To: intel-wired-lan; +Cc: Brett Creeley
From: Brett Creeley <brett.creeley@intel.com>
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]).
Fixes: c5afbe99b778c ("ice: Add helper function to get the VF's VSIq")
Signed-off-by: Brett Creeley <brett.creeley@intel.com>
Signed-off-by: Kalyan Kodamagula <kalyan.kodamagula@intel.com>
---
drivers/net/ethernet/intel/ice/ice_virtchnl_fdir.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/net/ethernet/intel/ice/ice_virtchnl_fdir.c b/drivers/net/ethernet/intel/ice/ice_virtchnl_fdir.c
index c6a58343d81d..e6ef6b303222 100644
--- a/drivers/net/ethernet/intel/ice/ice_virtchnl_fdir.c
+++ b/drivers/net/ethernet/intel/ice/ice_virtchnl_fdir.c
@@ -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))
return -EINVAL;
- if (!pf->vsi[vf->lan_vsi_idx])
+ if (!ice_get_vf_vsi(vf))
return -EINVAL;
return 0;
@@ -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_vsi = pf->vsi[vf->lan_vsi_idx];
+ vf_vsi = ice_get_vf_vsi(vf);
if (!vf_vsi) {
dev_dbg(dev, "NULL vf %d vsi pointer\n", vf->vf_id);
return;
@@ -572,7 +572,7 @@ ice_vc_fdir_write_flow_prof(struct ice_vf *vf, enum ice_fltr_ptype flow,
pf = vf->pf;
dev = ice_pf_to_dev(pf);
hw = &pf->hw;
- vf_vsi = pf->vsi[vf->lan_vsi_idx];
+ vf_vsi = ice_get_vf_vsi(vf);
if (!vf_vsi)
return -EINVAL;
@@ -1205,7 +1205,7 @@ static int ice_vc_fdir_write_fltr(struct ice_vf *vf,
pf = vf->pf;
dev = ice_pf_to_dev(pf);
hw = &pf->hw;
- vsi = pf->vsi[vf->lan_vsi_idx];
+ vsi = ice_get_vf_vsi(vf);
if (!vsi) {
dev_dbg(dev, "Invalid vsi for VF %d\n", vf->vf_id);
return -EINVAL;
--
2.38.1
_______________________________________________
Intel-wired-lan mailing list
Intel-wired-lan@osuosl.org
https://lists.osuosl.org/mailman/listinfo/intel-wired-lan
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [Intel-wired-lan] [PATCH net-next v2] ice: Add more usage of existing function ice_get_vf_vsi(vf)
2022-11-30 8:08 [Intel-wired-lan] [PATCH net-next v2] ice: Add more usage of existing function ice_get_vf_vsi(vf) Kalyan Kodamagula
@ 2022-11-30 19:02 ` Tony Nguyen
0 siblings, 0 replies; 2+ messages in thread
From: Tony Nguyen @ 2022-11-30 19:02 UTC (permalink / raw)
To: Kalyan Kodamagula, intel-wired-lan; +Cc: Brett Creeley
On 11/30/2022 12:08 AM, Kalyan Kodamagula wrote:
> From: Brett Creeley <brett.creeley@intel.com>
>
> 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]).
>
> Fixes: c5afbe99b778c ("ice: Add helper function to get the VF's VSIq")
WARNING: Please use correct Fixes: style 'Fixes: <12 chars of sha1>
("<title line>")' - ie: 'Fixes: c5afbe99b778 ("ice: Add helper function
to get the VF's VSI")'
However, what's the bug that this is fixing? Seems like a refactor and
not a bug fix.
> Signed-off-by: Brett Creeley <brett.creeley@intel.com>
> Signed-off-by: Kalyan Kodamagula <kalyan.kodamagula@intel.com>
> ---
Please include changelogs
> drivers/net/ethernet/intel/ice/ice_virtchnl_fdir.c | 8 ++++----
> 1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/net/ethernet/intel/ice/ice_virtchnl_fdir.c b/drivers/net/ethernet/intel/ice/ice_virtchnl_fdir.c
> index c6a58343d81d..e6ef6b303222 100644
> --- a/drivers/net/ethernet/intel/ice/ice_virtchnl_fdir.c
> +++ b/drivers/net/ethernet/intel/ice/ice_virtchnl_fdir.c
> @@ -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))
> return -EINVAL;
>
> - if (!pf->vsi[vf->lan_vsi_idx])
> + if (!ice_get_vf_vsi(vf))
> return -EINVAL;
>
> return 0;
> @@ -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_vsi = pf->vsi[vf->lan_vsi_idx];
> + vf_vsi = ice_get_vf_vsi(vf);
> if (!vf_vsi) {
> dev_dbg(dev, "NULL vf %d vsi pointer\n", vf->vf_id);
> return;
> @@ -572,7 +572,7 @@ ice_vc_fdir_write_flow_prof(struct ice_vf *vf, enum ice_fltr_ptype flow,
> pf = vf->pf;
> dev = ice_pf_to_dev(pf);
> hw = &pf->hw;
> - vf_vsi = pf->vsi[vf->lan_vsi_idx];
> + vf_vsi = ice_get_vf_vsi(vf);
> if (!vf_vsi)
> return -EINVAL;
>
> @@ -1205,7 +1205,7 @@ static int ice_vc_fdir_write_fltr(struct ice_vf *vf,
> pf = vf->pf;
> dev = ice_pf_to_dev(pf);
> hw = &pf->hw;
> - vsi = pf->vsi[vf->lan_vsi_idx];
> + vsi = ice_get_vf_vsi(vf);
> if (!vsi) {
> dev_dbg(dev, "Invalid vsi for VF %d\n", vf->vf_id);
> return -EINVAL;
_______________________________________________
Intel-wired-lan mailing list
Intel-wired-lan@osuosl.org
https://lists.osuosl.org/mailman/listinfo/intel-wired-lan
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2022-11-30 19:03 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-11-30 8:08 [Intel-wired-lan] [PATCH net-next v2] ice: Add more usage of existing function ice_get_vf_vsi(vf) Kalyan Kodamagula
2022-11-30 19:02 ` Tony Nguyen
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox