From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 9C66A4404F; Wed, 12 Jun 2024 17:28:08 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id DBE5742830; Wed, 12 Jun 2024 17:07:31 +0200 (CEST) Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.10]) by mails.dpdk.org (Postfix) with ESMTP id 3E8AC427E0 for ; Wed, 12 Jun 2024 17:07:21 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1718204842; x=1749740842; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=t03Epgtkwdvwowdhx7S8YCv7CtCrZtd+Xgb/jVvGTa8=; b=DC2bLtGMmH+300KdTw8Xq+r0Fr3iWWscNBsMvrnzrHaKIs+jateSIlYh Edbvyvc8kzHQd6hjWiqGzaZqb7hATKDz4Sqe0RYPu7qWH9OXrBxbe5BPH ySjKzDIpxG0+/chRC7dShqo4EPdcNJIlL45+Jm807W3k9HrowTWhgLhKz kPOBH0sPP20ohoY/mxp3QfLCP+bA7o4xw5/nFyWzQ2xmfzLKUPypdN3Ra 0qCpKsn3K7yOdRHzV4nlvxOQ7QvAjx7+QIB1E0+RgsHyr/nnNyxk3f70a lOhsumhrsd2dOkCTOS/qbYalsmP7dVdadXA8v336Gm1rx9Htvw0GEAO75 w==; X-CSE-ConnectionGUID: jqCEpgkbSn+YtnVa4GtgVA== X-CSE-MsgGUID: 9NPkQ9YwTu2/xymITMIeOg== X-IronPort-AV: E=McAfee;i="6700,10204,11101"; a="32460183" X-IronPort-AV: E=Sophos;i="6.08,233,1712646000"; d="scan'208";a="32460183" Received: from orviesa009.jf.intel.com ([10.64.159.149]) by orvoesa102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Jun 2024 08:07:21 -0700 X-CSE-ConnectionGUID: Fqwa2jpoSqyKWK2h1hLbhA== X-CSE-MsgGUID: QmwNoqYeQqO/UJM1nFNuwg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.08,233,1712646000"; d="scan'208";a="39926122" Received: from silpixa00401119.ir.intel.com ([10.55.129.167]) by orviesa009.jf.intel.com with ESMTP; 12 Jun 2024 08:07:20 -0700 From: Anatoly Burakov To: dev@dpdk.org Cc: Ian Stokes , bruce.richardson@intel.com, Jesse Brandeburg Subject: [PATCH v2 146/148] net/ice/base: misc header file clean up Date: Wed, 12 Jun 2024 16:02:20 +0100 Message-ID: <0fe3c6ad623474d60b2d13bb7d132a5ee24d7566.1718204529.git.anatoly.burakov@intel.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: References: <20240430154014.1026-1-ian.stokes@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org From: Ian Stokes Add last remaining changes that include defines, structs etc to allign with shared code snapshot. Add a new function called ice_fls() to the shared code. The unsigned int ice_fls(u64 n) function finds the Most Significant Bit (MSB) and returns the 1-based index of the bit that was set. This means if no bits are set it returns 0. If the largest bit set is the last bit in a 64 bit unsigned value, it will return 64. Signed-off-by: Jesse Brandeburg Signed-off-by: Ian Stokes --- drivers/net/ice/base/ice_type.h | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/drivers/net/ice/base/ice_type.h b/drivers/net/ice/base/ice_type.h index 5d4d85ff16..cb1c12e6c7 100644 --- a/drivers/net/ice/base/ice_type.h +++ b/drivers/net/ice/base/ice_type.h @@ -43,6 +43,24 @@ static inline int ice_ilog2(u64 n) return -1; } +/** + * ice_fls - find the most significant bit set in a u64 + * @n: u64 value to scan for a bit + * + * Returns: 0 if no bits found, otherwise the index of the highest bit that was + * set, like ice_fls(0x20) == 6. This means this is returning a *1 based* + * count, and that the maximum largest value returned is 64! + */ +static inline unsigned int ice_fls(u64 n) +{ + int ret; + + ret = ice_ilog2(n); + + /* add one to turn to the ilog2 value into a 1 based index */ + return ret >= 0 ? ret + 1 : 0; +} + static inline bool ice_is_tc_ena(ice_bitmap_t bitmap, u8 tc) { return ice_is_bit_set(&bitmap, tc); @@ -98,6 +116,8 @@ static inline u32 ice_round_to_num(u32 N, u32 R) #define ICE_LO_DWORD(x) ((u32)((x) & 0xFFFFFFFF)) #define ICE_HI_WORD(x) ((u16)(((x) >> 16) & 0xFFFF)) #define ICE_LO_WORD(x) ((u16)((x) & 0xFFFF)) +#define ICE_HI_BYTE(x) ((u8)(((x) >> 8) & 0xFF)) +#define ICE_LO_BYTE(x) ((u8)((x) & 0xFF)) /* debug masks - set these bits in hw->debug_mask to control output */ #define ICE_DBG_TRACE BIT_ULL(0) /* for function-trace only */ @@ -918,6 +938,14 @@ struct ice_nvm_info { u8 minor; }; +/* Minimum Security Revision information */ +struct ice_minsrev_info { + u32 nvm; + u32 orom; + u8 nvm_valid : 1; + u8 orom_valid : 1; +}; + /* Enumeration of possible flash banks for the NVM, OROM, and Netlist modules * of the flash image. */ @@ -1231,6 +1259,7 @@ struct ice_port_info { struct ice_bw_type_info tc_node_bw_t_info[ICE_MAX_TRAFFIC_CLASS]; struct ice_qos_cfg qos_cfg; u8 is_vf:1; + u8 is_custom_tx_enabled:1; }; struct ice_switch_info { @@ -1513,6 +1542,7 @@ enum ice_sw_fwd_act_type { ICE_FWD_TO_QGRP, ICE_SET_MARK, ICE_DROP_PACKET, + ICE_LG_ACTION, ICE_INVAL_ACT }; -- 2.43.0