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
Cc: Jesse Brandeburg <jesse.brandeburg@intel.com>,
	netdev@vger.kernel.org, sassmann@redhat.com,
	anthony.l.nguyen@intel.com,
	Tony Brelinski <tonyx.brelinski@intel.com>
Subject: [PATCH net-next 10/15] ice: use local for consistency
Date: Wed, 14 Apr 2021 17:30:08 -0700	[thread overview]
Message-ID: <20210415003013.19717-11-anthony.l.nguyen@intel.com> (raw)
In-Reply-To: <20210415003013.19717-1-anthony.l.nguyen@intel.com>

From: Jesse Brandeburg <jesse.brandeburg@intel.com>

Do a minor refactor on ice_vsi_rebuild to use a local
variable to store vsi->type.

Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Tested-by: Tony Brelinski <tonyx.brelinski@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
---
 drivers/net/ethernet/intel/ice/ice_lib.c | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/drivers/net/ethernet/intel/ice/ice_lib.c b/drivers/net/ethernet/intel/ice/ice_lib.c
index 45837e9eee86..0443338f9eaf 100644
--- a/drivers/net/ethernet/intel/ice/ice_lib.c
+++ b/drivers/net/ethernet/intel/ice/ice_lib.c
@@ -3014,6 +3014,7 @@ int ice_vsi_rebuild(struct ice_vsi *vsi, bool init_vsi)
 	struct ice_coalesce_stored *coalesce;
 	int prev_num_q_vectors = 0;
 	struct ice_vf *vf = NULL;
+	enum ice_vsi_type vtype;
 	enum ice_status status;
 	struct ice_pf *pf;
 	int ret, i;
@@ -3022,7 +3023,8 @@ int ice_vsi_rebuild(struct ice_vsi *vsi, bool init_vsi)
 		return -EINVAL;
 
 	pf = vsi->back;
-	if (vsi->type == ICE_VSI_VF)
+	vtype = vsi->type;
+	if (vtype == ICE_VSI_VF)
 		vf = &pf->vf[vsi->vf_id];
 
 	coalesce = kcalloc(vsi->num_q_vectors,
@@ -3040,7 +3042,7 @@ int ice_vsi_rebuild(struct ice_vsi *vsi, bool init_vsi)
 	 * many interrupts each VF needs. SR-IOV MSIX resources are also
 	 * cleared in the same manner.
 	 */
-	if (vsi->type != ICE_VSI_VF) {
+	if (vtype != ICE_VSI_VF) {
 		/* reclaim SW interrupts back to the common pool */
 		ice_free_res(pf->irq_tracker, vsi->base_vector, vsi->idx);
 		pf->num_avail_sw_msix += vsi->num_q_vectors;
@@ -3055,7 +3057,7 @@ int ice_vsi_rebuild(struct ice_vsi *vsi, bool init_vsi)
 	ice_vsi_put_qs(vsi);
 	ice_vsi_clear_rings(vsi);
 	ice_vsi_free_arrays(vsi);
-	if (vsi->type == ICE_VSI_VF)
+	if (vtype == ICE_VSI_VF)
 		ice_vsi_set_num_qs(vsi, vf->vf_id);
 	else
 		ice_vsi_set_num_qs(vsi, ICE_INVAL_VFID);
@@ -3074,7 +3076,7 @@ int ice_vsi_rebuild(struct ice_vsi *vsi, bool init_vsi)
 	if (ret < 0)
 		goto err_vsi;
 
-	switch (vsi->type) {
+	switch (vtype) {
 	case ICE_VSI_CTRL:
 	case ICE_VSI_PF:
 		ret = ice_vsi_alloc_q_vectors(vsi);
@@ -3101,7 +3103,7 @@ int ice_vsi_rebuild(struct ice_vsi *vsi, bool init_vsi)
 				goto err_vectors;
 		}
 		/* ICE_VSI_CTRL does not need RSS so skip RSS processing */
-		if (vsi->type != ICE_VSI_CTRL)
+		if (vtype != ICE_VSI_CTRL)
 			/* Do not exit if configuring RSS had an issue, at
 			 * least receive traffic on first queue. Hence no
 			 * need to capture return value
-- 
2.26.2


  parent reply	other threads:[~2021-04-15  0:28 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-15  0:29 [PATCH net-next 00/15][pull request] 100GbE Intel Wired LAN Driver Updates 2021-04-14 Tony Nguyen
2021-04-15  0:29 ` [PATCH net-next 01/15] ice: use kernel definitions for IANA protocol ports and ether-types Tony Nguyen
2021-04-15  0:30 ` [PATCH net-next 02/15] ice: Drop leading underscores in enum ice_pf_state Tony Nguyen
2021-04-15  0:30 ` [PATCH net-next 03/15] ice: Add new VSI states to track netdev alloc/registration Tony Nguyen
2021-04-15 16:39   ` Jakub Kicinski
2021-04-15  0:30 ` [PATCH net-next 04/15] ice: refactor interrupt moderation writes Tony Nguyen
2021-04-15  0:30 ` [PATCH net-next 05/15] ice: replace custom AIM algorithm with kernel's DIM library Tony Nguyen
2021-04-15 16:46   ` Jakub Kicinski
2021-04-15 17:03     ` Keller, Jacob E
2021-04-15 17:07       ` Jakub Kicinski
2021-04-15  0:30 ` [PATCH net-next 06/15] ice: manage interrupts during poll exit Tony Nguyen
2021-04-15  0:30 ` [PATCH net-next 07/15] ice: refactor ITR data structures Tony Nguyen
2021-04-15  0:30 ` [PATCH net-next 08/15] ice: Reimplement module reads used by ethtool Tony Nguyen
2021-04-15  0:30 ` [PATCH net-next 09/15] ice: print name in /proc/iomem Tony Nguyen
2021-04-15  0:30 ` Tony Nguyen [this message]
2021-04-15  0:30 ` [PATCH net-next 11/15] ice: remove unused struct member Tony Nguyen
2021-04-15  0:30 ` [PATCH net-next 12/15] ice: Set vsi->vf_id as ICE_INVAL_VFID for non VF VSI types Tony Nguyen
2021-04-15  0:30 ` [PATCH net-next 13/15] ice: suppress false cppcheck issues Tony Nguyen
2021-04-15  0:30 ` [PATCH net-next 14/15] ice: remove return variable Tony Nguyen
2021-04-15  0:30 ` [PATCH net-next 15/15] ice: reduce scope of variable Tony Nguyen
2021-04-15 23:50 ` [PATCH net-next 00/15][pull request] 100GbE Intel Wired LAN Driver Updates 2021-04-14 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=20210415003013.19717-11-anthony.l.nguyen@intel.com \
    --to=anthony.l.nguyen@intel.com \
    --cc=davem@davemloft.net \
    --cc=jesse.brandeburg@intel.com \
    --cc=kuba@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=sassmann@redhat.com \
    --cc=tonyx.brelinski@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).