[v2,06/37] net/ice/base: code clean

Message ID 20190307125841.14247-7-qi.z.zhang@intel.com (mailing list archive)
State Superseded, archived
Delegated to: Qi Zhang
Headers
Series ice share code update. |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation success Compilation OK

Commit Message

Qi Zhang March 7, 2019, 12:58 p.m. UTC
  Remove unnecessary macro and data structure.

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_adminq_cmd.h |   2 -
 drivers/net/ice/base/ice_flex_pipe.c  |   2 -
 drivers/net/ice/base/ice_flow.c       | 136 ----------------------------------
 drivers/net/ice/base/ice_type.h       |   6 --
 4 files changed, 146 deletions(-)
  

Patch

diff --git a/drivers/net/ice/base/ice_adminq_cmd.h b/drivers/net/ice/base/ice_adminq_cmd.h
index feb980475..056a9fbef 100644
--- a/drivers/net/ice/base/ice_adminq_cmd.h
+++ b/drivers/net/ice/base/ice_adminq_cmd.h
@@ -1930,8 +1930,6 @@  enum ice_adminq_opc {
 	ice_aqc_opc_move_sched_elems			= 0x0408,
 	ice_aqc_opc_suspend_sched_elems			= 0x0409,
 	ice_aqc_opc_resume_sched_elems			= 0x040A,
-	ice_aqc_opc_suspend_sched_traffic		= 0x040B,
-	ice_aqc_opc_resume_sched_traffic		= 0x040C,
 	ice_aqc_opc_delete_sched_elems			= 0x040F,
 	ice_aqc_opc_add_rl_profiles			= 0x0410,
 	ice_aqc_opc_query_rl_profiles			= 0x0411,
diff --git a/drivers/net/ice/base/ice_flex_pipe.c b/drivers/net/ice/base/ice_flex_pipe.c
index 66c47abda..2d23c36eb 100644
--- a/drivers/net/ice/base/ice_flex_pipe.c
+++ b/drivers/net/ice/base/ice_flex_pipe.c
@@ -2247,8 +2247,6 @@  ice_find_dup_props_vsig(struct ice_hw *hw, enum ice_block blk,
 	for (i = 0; i < xlt2->count; i++) {
 		if (xlt2->vsig_tbl[i].in_use &&
 		    ice_match_prop_lst(chs, &xlt2->vsig_tbl[i].prop_lst)) {
-			*vsig = (i | ((hw->pf_id << ICE_PF_NUM_S) &
-				      ICE_PF_NUM_M));
 			*vsig = ICE_VSIG_VALUE(i, hw->pf_id);
 			return ICE_SUCCESS;
 		}
diff --git a/drivers/net/ice/base/ice_flow.c b/drivers/net/ice/base/ice_flow.c
index 574c927c4..03a324d49 100644
--- a/drivers/net/ice/base/ice_flow.c
+++ b/drivers/net/ice/base/ice_flow.c
@@ -1554,142 +1554,6 @@  ice_flow_set_rss_seg_info(struct ice_flow_seg_info *segs, u64 hash_fields,
 	return ICE_SUCCESS;
 }
 
-/* Mapping of AVF hash bit fields to an L3-L4 hash combination.
- * As the ice_flow_avf_hdr_field represent individual bit shifts in a hash,
- * convert its values to their appropriate flow L3, L4 values.
- */
-#define ICE_FLOW_AVF_RSS_IPV4_MASKS \
-	(BIT_ULL(ICE_AVF_FLOW_FIELD_IPV4_OTHER) | \
-	 BIT_ULL(ICE_AVF_FLOW_FIELD_FRAG_IPV4))
-#define ICE_FLOW_AVF_RSS_TCP_IPV4_MASKS \
-	(BIT_ULL(ICE_AVF_FLOW_FIELD_IPV4_TCP_SYN_NO_ACK) | \
-	 BIT_ULL(ICE_AVF_FLOW_FIELD_IPV4_TCP))
-#define ICE_FLOW_AVF_RSS_UDP_IPV4_MASKS \
-	(BIT_ULL(ICE_AVF_FLOW_FIELD_UNICAST_IPV4_UDP) | \
-	 BIT_ULL(ICE_AVF_FLOW_FIELD_MULTICAST_IPV4_UDP) | \
-	 BIT_ULL(ICE_AVF_FLOW_FIELD_IPV4_UDP))
-#define ICE_FLOW_AVF_RSS_ALL_IPV4_MASKS \
-	(ICE_FLOW_AVF_RSS_TCP_IPV4_MASKS | ICE_FLOW_AVF_RSS_UDP_IPV4_MASKS | \
-	 ICE_FLOW_AVF_RSS_IPV4_MASKS | BIT_ULL(ICE_AVF_FLOW_FIELD_IPV4_SCTP))
-
-#define ICE_FLOW_AVF_RSS_IPV6_MASKS \
-	(BIT_ULL(ICE_AVF_FLOW_FIELD_IPV6_OTHER) | \
-	 BIT_ULL(ICE_AVF_FLOW_FIELD_FRAG_IPV6))
-#define ICE_FLOW_AVF_RSS_UDP_IPV6_MASKS \
-	(BIT_ULL(ICE_AVF_FLOW_FIELD_UNICAST_IPV6_UDP) | \
-	 BIT_ULL(ICE_AVF_FLOW_FIELD_MULTICAST_IPV6_UDP) | \
-	 BIT_ULL(ICE_AVF_FLOW_FIELD_IPV6_UDP))
-#define ICE_FLOW_AVF_RSS_TCP_IPV6_MASKS \
-	(BIT_ULL(ICE_AVF_FLOW_FIELD_IPV6_TCP_SYN_NO_ACK) | \
-	 BIT_ULL(ICE_AVF_FLOW_FIELD_IPV6_TCP))
-#define ICE_FLOW_AVF_RSS_ALL_IPV6_MASKS \
-	(ICE_FLOW_AVF_RSS_TCP_IPV6_MASKS | ICE_FLOW_AVF_RSS_UDP_IPV6_MASKS | \
-	 ICE_FLOW_AVF_RSS_IPV6_MASKS | BIT_ULL(ICE_AVF_FLOW_FIELD_IPV6_SCTP))
-
-#define ICE_FLOW_MAX_CFG	10
-
-/**
- * ice_add_avf_rss_cfg - add an RSS configuration for AVF driver
- * @hw: pointer to the hardware structure
- * @vsi_handle: software VSI handle
- * @avf_hash: hash bit fields (ICE_AVF_FLOW_FIELD_*) to configure
- *
- * This function will take the hash bitmap provided by the AVF driver via a
- * message, convert it to ICE-compatible values, and configure RSS flow
- * profiles.
- */
-enum ice_status
-ice_add_avf_rss_cfg(struct ice_hw *hw, u16 vsi_handle, u64 avf_hash)
-{
-	u64 added_cfg[ICE_FLOW_MAX_CFG], hash_flds;
-	enum ice_status status = ICE_SUCCESS;
-	u8 i, idx = 0;
-
-	if (avf_hash == ICE_AVF_FLOW_FIELD_INVALID ||
-	    !ice_is_vsi_valid(hw, vsi_handle))
-		return ICE_ERR_PARAM;
-
-	/* Make sure no unsupported bits are specified */
-	if (avf_hash & ~(ICE_FLOW_AVF_RSS_ALL_IPV4_MASKS |
-			 ICE_FLOW_AVF_RSS_ALL_IPV6_MASKS))
-		return ICE_ERR_CFG;
-
-	hash_flds = avf_hash;
-
-	/* Always create an L3 RSS configuration for any L4 RSS configuration */
-	if (hash_flds & ICE_FLOW_AVF_RSS_ALL_IPV4_MASKS)
-		hash_flds |= ICE_FLOW_AVF_RSS_IPV4_MASKS;
-
-	if (hash_flds & ICE_FLOW_AVF_RSS_ALL_IPV6_MASKS)
-		hash_flds |= ICE_FLOW_AVF_RSS_IPV6_MASKS;
-
-	/* Create the corresponding RSS configuration for each valid hash bit */
-	while (hash_flds) {
-		u64 rss_hash = ICE_HASH_INVALID;
-
-		if (hash_flds & ICE_FLOW_AVF_RSS_ALL_IPV4_MASKS) {
-			if (hash_flds & ICE_FLOW_AVF_RSS_TCP_IPV4_MASKS) {
-				rss_hash = ICE_FLOW_HASH_IPV4 |
-					ICE_FLOW_HASH_TCP_PORT;
-				hash_flds &= ~ICE_FLOW_AVF_RSS_TCP_IPV4_MASKS;
-			} else if (hash_flds &
-				   ICE_FLOW_AVF_RSS_UDP_IPV4_MASKS) {
-				rss_hash = ICE_FLOW_HASH_IPV4 |
-					ICE_FLOW_HASH_UDP_PORT;
-				hash_flds &= ~ICE_FLOW_AVF_RSS_UDP_IPV4_MASKS;
-			} else if (hash_flds &
-				   BIT_ULL(ICE_AVF_FLOW_FIELD_IPV4_SCTP)) {
-				rss_hash = ICE_FLOW_HASH_IPV4 |
-					ICE_FLOW_HASH_SCTP_PORT;
-				hash_flds &=
-					~BIT_ULL(ICE_AVF_FLOW_FIELD_IPV4_SCTP);
-			} else if (hash_flds & ICE_FLOW_AVF_RSS_IPV4_MASKS) {
-				rss_hash = ICE_FLOW_HASH_IPV4;
-				hash_flds &= ~ICE_FLOW_AVF_RSS_IPV4_MASKS;
-			}
-		} else if (hash_flds & ICE_FLOW_AVF_RSS_ALL_IPV6_MASKS) {
-			if (hash_flds & ICE_FLOW_AVF_RSS_TCP_IPV6_MASKS) {
-				rss_hash = ICE_FLOW_HASH_IPV6 |
-					ICE_FLOW_HASH_TCP_PORT;
-				hash_flds &= ~ICE_FLOW_AVF_RSS_TCP_IPV6_MASKS;
-			} else if (hash_flds &
-				   ICE_FLOW_AVF_RSS_UDP_IPV6_MASKS) {
-				rss_hash = ICE_FLOW_HASH_IPV6 |
-					ICE_FLOW_HASH_UDP_PORT;
-				hash_flds &= ~ICE_FLOW_AVF_RSS_UDP_IPV6_MASKS;
-			} else if (hash_flds &
-				   BIT_ULL(ICE_AVF_FLOW_FIELD_IPV6_SCTP)) {
-				rss_hash = ICE_FLOW_HASH_IPV6 |
-					ICE_FLOW_HASH_SCTP_PORT;
-				hash_flds &=
-					~BIT_ULL(ICE_AVF_FLOW_FIELD_IPV6_SCTP);
-			} else if (hash_flds & ICE_FLOW_AVF_RSS_IPV6_MASKS) {
-				rss_hash = ICE_FLOW_HASH_IPV6;
-				hash_flds &= ~ICE_FLOW_AVF_RSS_IPV6_MASKS;
-			}
-		}
-
-		if (rss_hash == ICE_HASH_INVALID)
-			return ICE_ERR_OUT_OF_RANGE;
-
-		status = ice_add_rss_cfg(hw, vsi_handle, rss_hash,
-					 ICE_FLOW_SEG_HDR_NONE);
-		if (status)
-			break;
-		added_cfg[idx++] = rss_hash;
-	}
-
-	/* If status is not success, we must remove all hash configurations
-	 * that were successfully added previously in this call for the vsi
-	 */
-	if (status)
-		for (i = 0; i < idx; i++)
-			ice_rem_rss_cfg(hw, vsi_handle, added_cfg[i],
-					ICE_FLOW_SEG_HDR_NONE);
-
-	return status;
-}
-
 /**
  * ice_rem_all_rss_vsi_ctx - remove all RSS configurations from VSI context
  * @hw: pointer to the hardware structure
diff --git a/drivers/net/ice/base/ice_type.h b/drivers/net/ice/base/ice_type.h
index 6bd73ed04..25d64477f 100644
--- a/drivers/net/ice/base/ice_type.h
+++ b/drivers/net/ice/base/ice_type.h
@@ -733,12 +733,6 @@  struct ice_hw {
 	/* tunneling info */
 	struct ice_tunnel_table tnl;
 
-	/* PTYPE group and XLT1 management */
-#define ICE_MAX_PTGS	256
-	struct ice_ptg_entry ptg_tbl[ICE_BLK_COUNT][ICE_MAX_PTGS];
-
-#define ICE_XLT1_CNT	1024
-	struct ice_ptg_ptype xlt1_tbl[ICE_BLK_COUNT][ICE_XLT1_CNT];
 #define ICE_PKG_FILENAME	"package_file"
 #define ICE_PKG_FILENAME_EXT	"pkg"
 #define ICE_PKG_FILE_MAJ_VER	1