netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Tony Nguyen <anthony.l.nguyen@intel.com>
To: davem@davemloft.net, kuba@kernel.org, pabeni@redhat.com,
	edumazet@google.com
Cc: Brett Creeley <brett.creeley@intel.com>,
	netdev@vger.kernel.org, anthony.l.nguyen@intel.com,
	Kalyan Kodamagula <kalyan.kodamagula@intel.com>,
	Piotr Tyda <piotr.tyda@intel.com>
Subject: [PATCH net-next 01/13] ice: Add more usage of existing function ice_get_vf_vsi(vf)
Date: Mon,  6 Feb 2023 13:48:01 -0800	[thread overview]
Message-ID: <20230206214813.20107-2-anthony.l.nguyen@intel.com> (raw)
In-Reply-To: <20230206214813.20107-1-anthony.l.nguyen@intel.com>

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]).

Signed-off-by: Brett Creeley <brett.creeley@intel.com>
Signed-off-by: Kalyan Kodamagula <kalyan.kodamagula@intel.com>
Tested-by: Piotr Tyda <piotr.tyda@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@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


  reply	other threads:[~2023-02-06 21:48 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-06 21:48 [PATCH net-next 00/13][pull request] ice: various virtualization cleanups Tony Nguyen
2023-02-06 21:48 ` Tony Nguyen [this message]
2023-02-06 21:48 ` [PATCH net-next 02/13] ice: fix function comment referring to ice_vsi_alloc Tony Nguyen
2023-02-06 21:48 ` [PATCH net-next 03/13] ice: drop unnecessary VF parameter from several VSI functions Tony Nguyen
2023-02-06 21:48 ` [PATCH net-next 04/13] ice: refactor VSI setup to use parameter structure Tony Nguyen
2023-02-06 21:48 ` [PATCH net-next 05/13] ice: move vsi_type assignment from ice_vsi_alloc to ice_vsi_cfg Tony Nguyen
2023-02-06 21:48 ` [PATCH net-next 06/13] ice: move ice_vf_vsi_release into ice_vf_lib.c Tony Nguyen
2023-02-06 21:48 ` [PATCH net-next 07/13] ice: Pull common tasks into ice_vf_post_vsi_rebuild Tony Nguyen
2023-02-06 21:48 ` [PATCH net-next 08/13] ice: add a function to initialize vf entry Tony Nguyen
2023-02-06 21:48 ` [PATCH net-next 09/13] ice: introduce ice_vf_init_host_cfg function Tony Nguyen
2023-02-06 21:48 ` [PATCH net-next 10/13] ice: convert vf_ops .vsi_rebuild to .create_vsi Tony Nguyen
2023-02-06 21:48 ` [PATCH net-next 11/13] ice: introduce clear_reset_state operation Tony Nguyen
2023-02-06 21:48 ` [PATCH net-next 12/13] ice: introduce .irq_close VF operation Tony Nguyen
2023-02-06 21:48 ` [PATCH net-next 13/13] ice: remove unnecessary virtchnl_ether_addr struct use Tony Nguyen
2023-02-08  6:00 ` [PATCH net-next 00/13][pull request] ice: various virtualization cleanups patchwork-bot+netdevbpf

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230206214813.20107-2-anthony.l.nguyen@intel.com \
    --to=anthony.l.nguyen@intel.com \
    --cc=brett.creeley@intel.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=kalyan.kodamagula@intel.com \
    --cc=kuba@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=piotr.tyda@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).