DPDK patches and discussions
 help / color / mirror / Atom feed
From: Qi Zhang <qi.z.zhang@intel.com>
To: qiming.yang@intel.com, beilei.xing@intel.com
Cc: xiaolong.ye@intel.com, dev@dpdk.org,
	Qi Zhang <qi.z.zhang@intel.com>,
	Bruce Allan <bruce.w.allan@intel.com>,
	Paul M Stillwell Jr <paul.m.stillwell.jr@intel.com>
Subject: [dpdk-dev] [PATCH 08/28] net/ice/base: use descriptive vairiable name than type
Date: Mon,  9 Mar 2020 19:43:37 +0800	[thread overview]
Message-ID: <20200309114357.31800-9-qi.z.zhang@intel.com> (raw)
In-Reply-To: <20200309114357.31800-1-qi.z.zhang@intel.com>

The variable name 'type' is not very descriptive. Replace instances of
those with a variable name that is more descriptive or replace it if not
needed.

Signed-off-by: Bruce Allan <bruce.w.allan@intel.com>
Signed-off-by: Paul M Stillwell Jr <paul.m.stillwell.jr@intel.com>
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
---
 drivers/net/ice/base/ice_flex_pipe.c |  8 ++++----
 drivers/net/ice/base/ice_flow.c      |  8 ++++----
 drivers/net/ice/base/ice_switch.c    | 38 ++++++++++++++++++------------------
 3 files changed, 27 insertions(+), 27 deletions(-)

diff --git a/drivers/net/ice/base/ice_flex_pipe.c b/drivers/net/ice/base/ice_flex_pipe.c
index 82b27de0e..c18ccea48 100644
--- a/drivers/net/ice/base/ice_flex_pipe.c
+++ b/drivers/net/ice/base/ice_flex_pipe.c
@@ -1506,11 +1506,11 @@ ice_get_sw_prof_type(struct ice_hw *hw, struct ice_fv *fv)
 /**
  * ice_get_sw_fv_bitmap - Get switch field vector bitmap based on profile type
  * @hw: pointer to hardware structure
- * @type: type of profiles requested
+ * @req_profs: type of profiles requested
  * @bm: pointer to memory for returning the bitmap of field vectors
  */
 void
-ice_get_sw_fv_bitmap(struct ice_hw *hw, enum ice_prof_type type,
+ice_get_sw_fv_bitmap(struct ice_hw *hw, enum ice_prof_type req_profs,
 		     ice_bitmap_t *bm)
 {
 	struct ice_pkg_enum state;
@@ -1519,7 +1519,7 @@ ice_get_sw_fv_bitmap(struct ice_hw *hw, enum ice_prof_type type,
 
 	ice_memset(&state, 0, sizeof(state), ICE_NONDMA_MEM);
 
-	if (type == ICE_PROF_ALL) {
+	if (req_profs == ICE_PROF_ALL) {
 		u16 i;
 
 		for (i = 0; i < ICE_MAX_NUM_PROFILES; i++)
@@ -1543,7 +1543,7 @@ ice_get_sw_fv_bitmap(struct ice_hw *hw, enum ice_prof_type type,
 			/* Determine field vector type */
 			prof_type = ice_get_sw_prof_type(hw, fv);
 
-			if (type & prof_type)
+			if (req_profs & prof_type)
 				ice_set_bit((u16)offset, bm);
 		}
 	} while (fv);
diff --git a/drivers/net/ice/base/ice_flow.c b/drivers/net/ice/base/ice_flow.c
index 6c413e307..d52bce1ce 100644
--- a/drivers/net/ice/base/ice_flow.c
+++ b/drivers/net/ice/base/ice_flow.c
@@ -1615,7 +1615,7 @@ enum ice_status ice_flow_rem_entry(struct ice_hw *hw, u64 entry_h)
  * ice_flow_set_fld_ext - specifies locations of field from entry's input buffer
  * @seg: packet segment the field being set belongs to
  * @fld: field to be set
- * @type: type of the field
+ * @field_type: type of the field
  * @val_loc: if not ICE_FLOW_FLD_OFF_INVAL, location of the value to match from
  *           entry's input buffer
  * @mask_loc: if not ICE_FLOW_FLD_OFF_INVAL, location of mask value from entry's
@@ -1636,16 +1636,16 @@ enum ice_status ice_flow_rem_entry(struct ice_hw *hw, u64 entry_h)
  */
 static void
 ice_flow_set_fld_ext(struct ice_flow_seg_info *seg, enum ice_flow_field fld,
-		     enum ice_flow_fld_match_type type, u16 val_loc,
+		     enum ice_flow_fld_match_type field_type, u16 val_loc,
 		     u16 mask_loc, u16 last_loc)
 {
 	u64 bit = BIT_ULL(fld);
 
 	seg->match |= bit;
-	if (type == ICE_FLOW_FLD_TYPE_RANGE)
+	if (field_type == ICE_FLOW_FLD_TYPE_RANGE)
 		seg->range |= bit;
 
-	seg->fields[fld].type = type;
+	seg->fields[fld].type = field_type;
 	seg->fields[fld].src.val = val_loc;
 	seg->fields[fld].src.mask = mask_loc;
 	seg->fields[fld].src.last = last_loc;
diff --git a/drivers/net/ice/base/ice_switch.c b/drivers/net/ice/base/ice_switch.c
index 0f2a5b3e9..adcda9645 100644
--- a/drivers/net/ice/base/ice_switch.c
+++ b/drivers/net/ice/base/ice_switch.c
@@ -1872,7 +1872,7 @@ enum ice_status ice_get_initial_sw_cfg(struct ice_hw *hw)
 			struct ice_aqc_get_sw_cfg_resp_elem *ele;
 			u16 pf_vf_num, swid, vsi_port_num;
 			bool is_vf = false;
-			u8 type;
+			u8 res_type;
 
 			ele = rbuf[i].elements;
 			vsi_port_num = LE16_TO_CPU(ele->vsi_port_num) &
@@ -1887,10 +1887,10 @@ enum ice_status ice_get_initial_sw_cfg(struct ice_hw *hw)
 			    ICE_AQC_GET_SW_CONF_RESP_IS_VF)
 				is_vf = true;
 
-			type = LE16_TO_CPU(ele->vsi_port_num) >>
-				ICE_AQC_GET_SW_CONF_RESP_TYPE_S;
+			res_type = (u8)(LE16_TO_CPU(ele->vsi_port_num) >>
+					ICE_AQC_GET_SW_CONF_RESP_TYPE_S);
 
-			switch (type) {
+			switch (res_type) {
 			case ICE_AQC_GET_SW_CONF_RESP_PHYS_PORT:
 			case ICE_AQC_GET_SW_CONF_RESP_VIRT_PORT:
 				if (j == num_total_ports) {
@@ -1900,7 +1900,7 @@ enum ice_status ice_get_initial_sw_cfg(struct ice_hw *hw)
 					goto out;
 				}
 				ice_init_port_info(hw->port_info,
-						   vsi_port_num, type, swid,
+						   vsi_port_num, res_type, swid,
 						   pf_vf_num, is_vf);
 				j++;
 				break;
@@ -2355,7 +2355,7 @@ ice_update_vsi_list_rule(struct ice_hw *hw, u16 *vsi_handle_arr, u16 num_vsi,
 	struct ice_aqc_sw_rules_elem *s_rule;
 	enum ice_status status;
 	u16 s_rule_size;
-	u16 type;
+	u16 rule_type;
 	int i;
 
 	if (!num_vsi)
@@ -2368,11 +2368,11 @@ ice_update_vsi_list_rule(struct ice_hw *hw, u16 *vsi_handle_arr, u16 num_vsi,
 	    lkup_type == ICE_SW_LKUP_PROMISC ||
 	    lkup_type == ICE_SW_LKUP_PROMISC_VLAN ||
 	    lkup_type == ICE_SW_LKUP_LAST)
-		type = remove ? ICE_AQC_SW_RULES_T_VSI_LIST_CLEAR :
-				ICE_AQC_SW_RULES_T_VSI_LIST_SET;
+		rule_type = remove ? ICE_AQC_SW_RULES_T_VSI_LIST_CLEAR :
+			ICE_AQC_SW_RULES_T_VSI_LIST_SET;
 	else if (lkup_type == ICE_SW_LKUP_VLAN)
-		type = remove ? ICE_AQC_SW_RULES_T_PRUNE_LIST_CLEAR :
-				ICE_AQC_SW_RULES_T_PRUNE_LIST_SET;
+		rule_type = remove ? ICE_AQC_SW_RULES_T_PRUNE_LIST_CLEAR :
+			ICE_AQC_SW_RULES_T_PRUNE_LIST_SET;
 	else
 		return ICE_ERR_PARAM;
 
@@ -2390,7 +2390,7 @@ ice_update_vsi_list_rule(struct ice_hw *hw, u16 *vsi_handle_arr, u16 num_vsi,
 			CPU_TO_LE16(ice_get_hw_vsi_num(hw, vsi_handle_arr[i]));
 	}
 
-	s_rule->type = CPU_TO_LE16(type);
+	s_rule->type = CPU_TO_LE16(rule_type);
 	s_rule->pdata.vsi_list.number_vsi = CPU_TO_LE16(num_vsi);
 	s_rule->pdata.vsi_list.index = CPU_TO_LE16(vsi_list_id);
 
@@ -5671,35 +5671,35 @@ static void
 ice_get_compat_fv_bitmap(struct ice_hw *hw, struct ice_adv_rule_info *rinfo,
 			 ice_bitmap_t *bm)
 {
-	enum ice_prof_type type;
+	enum ice_prof_type prof_type;
 
 	switch (rinfo->tun_type) {
 	case ICE_NON_TUN:
-		type = ICE_PROF_NON_TUN;
+		prof_type = ICE_PROF_NON_TUN;
 		break;
 	case ICE_ALL_TUNNELS:
-		type = ICE_PROF_TUN_ALL;
+		prof_type = ICE_PROF_TUN_ALL;
 		break;
 	case ICE_SW_TUN_VXLAN_GPE:
 	case ICE_SW_TUN_GENEVE:
 	case ICE_SW_TUN_VXLAN:
 	case ICE_SW_TUN_UDP:
 	case ICE_SW_TUN_GTP:
-		type = ICE_PROF_TUN_UDP;
+		prof_type = ICE_PROF_TUN_UDP;
 		break;
 	case ICE_SW_TUN_NVGRE:
-		type = ICE_PROF_TUN_GRE;
+		prof_type = ICE_PROF_TUN_GRE;
 		break;
 	case ICE_SW_TUN_PPPOE:
-		type = ICE_PROF_TUN_PPPOE;
+		prof_type = ICE_PROF_TUN_PPPOE;
 		break;
 	case ICE_SW_TUN_AND_NON_TUN:
 	default:
-		type = ICE_PROF_ALL;
+		prof_type = ICE_PROF_ALL;
 		break;
 	}
 
-	ice_get_sw_fv_bitmap(hw, type, bm);
+	ice_get_sw_fv_bitmap(hw, prof_type, bm);
 }
 
 /**
-- 
2.13.6


  parent reply	other threads:[~2020-03-09 11:41 UTC|newest]

Thread overview: 71+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-09 11:43 [dpdk-dev] [PATCH 00/28] update ice base code Qi Zhang
2020-03-09 11:43 ` [dpdk-dev] [PATCH 01/28] net/ice/base: fix uninitialized stack variables Qi Zhang
2020-03-09 11:43 ` [dpdk-dev] [PATCH 02/28] net/ice/base: add and update E822 device IDs Qi Zhang
2020-03-09 11:43 ` [dpdk-dev] [PATCH 03/28] net/ice/base: fix removing MAC rule Qi Zhang
2020-03-09 11:43 ` [dpdk-dev] [PATCH 04/28] net/ice/base: read PSM clock frequency from register Qi Zhang
2020-03-09 15:45   ` Kevin Traynor
2020-03-20  7:14     ` Zhang, Qi Z
2020-03-20 10:44       ` Kevin Traynor
2020-03-09 11:43 ` [dpdk-dev] [PATCH 05/28] net/ice/base: allow VLAN and ethertype filter for port Qi Zhang
2020-03-09 11:43 ` [dpdk-dev] [PATCH 06/28] net/ice/base: replace u16 with enum Qi Zhang
2020-03-09 11:43 ` [dpdk-dev] [PATCH 07/28] net/ice/base: use struct size helper Qi Zhang
2020-03-09 11:43 ` Qi Zhang [this message]
2020-03-09 11:43 ` [dpdk-dev] [PATCH 09/28] net/ice/base: refactor a function Qi Zhang
2020-03-09 11:43 ` [dpdk-dev] [PATCH 10/28] net/ice/base: add NVM netlist macros Qi Zhang
2020-03-09 11:43 ` [dpdk-dev] [PATCH 11/28] net/ice/base: minor fixes Qi Zhang
2020-03-09 11:43 ` [dpdk-dev] [PATCH 12/28] net/ice/base: support GTPU uplink and downlink Qi Zhang
2020-03-09 11:43 ` [dpdk-dev] [PATCH 13/28] net/ice/base: add link default override support Qi Zhang
2020-03-09 11:43 ` [dpdk-dev] [PATCH 14/28] net/ice/base: add dedicate MAC type for E810 Qi Zhang
2020-03-09 11:43 ` [dpdk-dev] [PATCH 15/28] net/ice/base: capitalize abbreviations Qi Zhang
2020-03-09 11:43 ` [dpdk-dev] [PATCH 16/28] net/ice/base: add PHY number definition values Qi Zhang
2020-03-09 11:43 ` [dpdk-dev] [PATCH 17/28] net/ice/base: add shared driver parameter command Qi Zhang
2020-03-09 11:43 ` [dpdk-dev] [PATCH 18/28] net/ice/bse: add AN masks to Get PHY Caps Qi Zhang
2020-03-09 11:43 ` [dpdk-dev] [PATCH 19/28] net/ice/base: xtract logic of flat NVM read to function Qi Zhang
2020-03-09 11:43 ` [dpdk-dev] [PATCH 20/28] net/ice/base: add macro specifying max NVM offset Qi Zhang
2020-03-09 11:43 ` [dpdk-dev] [PATCH 21/28] net/ice/base: implement new sr read functions Qi Zhang
2020-03-09 11:43 ` [dpdk-dev] [PATCH 22/28] net/ice/base: couple casting issue fixes Qi Zhang
2020-03-09 11:43 ` [dpdk-dev] [PATCH 23/28] net/ice/base: support PHY persistent feature Qi Zhang
2020-03-09 11:43 ` [dpdk-dev] [PATCH 24/28] net/ice/base: store NVM version info in extracted format Qi Zhang
2020-03-09 11:43 ` [dpdk-dev] [PATCH 25/28] net/ice/base: add ACL module Qi Zhang
2020-03-09 11:43 ` [dpdk-dev] [PATCH 26/28] net/ice/base: update copyright date Qi Zhang
2020-03-09 11:43 ` [dpdk-dev] [PATCH 27/28] net/ice/base: add the hook to send AdminQ command Qi Zhang
2020-03-09 11:43 ` [dpdk-dev] [PATCH 28/28] net/ice/base: don't access some hardware registers in DCF Qi Zhang
2020-03-23  7:17 ` [dpdk-dev] [PATCH v2 00/36] update ice base code Qi Zhang
2020-03-23  7:17   ` [dpdk-dev] [PATCH v2 01/36] net/ice/base: fix uninitialized stack variables Qi Zhang
2020-03-23  7:17   ` [dpdk-dev] [PATCH v2 02/36] net/ice/base: add and update E822 device IDs Qi Zhang
2020-03-23  7:17   ` [dpdk-dev] [PATCH v2 03/36] net/ice/base: fix removing MAC rule Qi Zhang
2020-03-23  7:17   ` [dpdk-dev] [PATCH v2 04/36] net/ice/base: read PSM clock frequency from register Qi Zhang
2020-03-23  7:17   ` [dpdk-dev] [PATCH v2 05/36] net/ice/base: allow VLAN and ethertype filter for port Qi Zhang
2020-03-23  7:17   ` [dpdk-dev] [PATCH v2 06/36] net/ice/base: replace u16 with enum Qi Zhang
2020-03-23  7:17   ` [dpdk-dev] [PATCH v2 07/36] net/ice/base: use struct size helper Qi Zhang
2020-03-23  7:17   ` [dpdk-dev] [PATCH v2 08/36] net/ice/base: use descriptive vairiable name than type Qi Zhang
2020-03-23  7:17   ` [dpdk-dev] [PATCH v2 09/36] net/ice/base: refactor a function Qi Zhang
2020-03-23  7:17   ` [dpdk-dev] [PATCH v2 10/36] net/ice/base: add NVM netlist macros Qi Zhang
2020-03-23  7:17   ` [dpdk-dev] [PATCH v2 11/36] net/ice/base: minor fixes Qi Zhang
2020-03-23  7:17   ` [dpdk-dev] [PATCH v2 12/36] net/ice/base: support GTPU uplink and downlink Qi Zhang
2020-03-23  7:17   ` [dpdk-dev] [PATCH v2 13/36] net/ice/base: add link default override support Qi Zhang
2020-03-23  7:17   ` [dpdk-dev] [PATCH v2 14/36] net/ice/base: add dedicate MAC type for E810 Qi Zhang
2020-03-23  7:17   ` [dpdk-dev] [PATCH v2 15/36] net/ice/base: capitalize abbreviations Qi Zhang
2020-03-23  7:17   ` [dpdk-dev] [PATCH v2 16/36] net/ice/base: add PHY number definition values Qi Zhang
2020-03-23  7:17   ` [dpdk-dev] [PATCH v2 17/36] net/ice/base: add shared driver parameter command Qi Zhang
2020-03-23  7:17   ` [dpdk-dev] [PATCH v2 18/36] net/ice/base: add AN masks to Get PHY Caps Qi Zhang
2020-03-23  7:17   ` [dpdk-dev] [PATCH v2 19/36] net/ice/base: xtract logic of flat NVM read to function Qi Zhang
2020-03-23  7:17   ` [dpdk-dev] [PATCH v2 20/36] net/ice/base: add macro specifying max NVM offset Qi Zhang
2020-03-23  7:17   ` [dpdk-dev] [PATCH v2 21/36] net/ice/base: implement new sr read functions Qi Zhang
2020-03-23  7:17   ` [dpdk-dev] [PATCH v2 22/36] net/ice/base: couple casting issue fixes Qi Zhang
2020-03-23  7:17   ` [dpdk-dev] [PATCH v2 23/36] net/ice/base: support PHY persistent feature Qi Zhang
2020-03-23  7:17   ` [dpdk-dev] [PATCH v2 24/36] net/ice/base: store NVM version info in extracted format Qi Zhang
2020-03-23  7:17   ` [dpdk-dev] [PATCH v2 25/36] net/ice/base: add ACL module Qi Zhang
2020-03-23  7:17   ` [dpdk-dev] [PATCH v2 26/36] net/ice/base: update copyright date Qi Zhang
2020-03-23  7:17   ` [dpdk-dev] [PATCH v2 27/36] net/ice/base: add the hook to send AdminQ command Qi Zhang
2020-03-23  7:17   ` [dpdk-dev] [PATCH v2 28/36] net/ice/base: don't access some hardware registers in DCF Qi Zhang
2020-03-23  7:17   ` [dpdk-dev] [PATCH v2 29/36] net/ice/base: move functions from common to NVM module Qi Zhang
2020-03-23  7:17   ` [dpdk-dev] [PATCH v2 30/36] net/ice/base: discover and store size of available flash Qi Zhang
2020-03-23  7:17   ` [dpdk-dev] [PATCH v2 31/36] net/ice/base: check DDP package compatibility Qi Zhang
2020-03-23  7:17   ` [dpdk-dev] [PATCH v2 32/36] net/ice/base: fix MAC write command Qi Zhang
2020-03-23  7:17   ` [dpdk-dev] [PATCH v2 33/36] net/ice/base: misc cleanups for Flow Director Qi Zhang
2020-03-23  7:17   ` [dpdk-dev] [PATCH v2 34/36] net/ice/base: add check to ipv4 next protocol Qi Zhang
2020-03-23  7:17   ` [dpdk-dev] [PATCH v2 35/36] net/ice/base: add reference count to tunnels Qi Zhang
2020-03-23  7:17   ` [dpdk-dev] [PATCH v2 36/36] net/ice/base: add pppoe ipv6 dummy packet Qi Zhang
2020-03-24  3:11   ` [dpdk-dev] [PATCH v2 00/36] update ice base code Yang, Qiming
2020-03-24  6:39     ` Ye Xiaolong

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=20200309114357.31800-9-qi.z.zhang@intel.com \
    --to=qi.z.zhang@intel.com \
    --cc=beilei.xing@intel.com \
    --cc=bruce.w.allan@intel.com \
    --cc=dev@dpdk.org \
    --cc=paul.m.stillwell.jr@intel.com \
    --cc=qiming.yang@intel.com \
    --cc=xiaolong.ye@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).