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 00AF0454EF; Tue, 25 Jun 2024 13:31:04 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id D5A8642EDB; Tue, 25 Jun 2024 13:21:56 +0200 (CEST) Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.19]) by mails.dpdk.org (Postfix) with ESMTP id 678AA42FE9 for ; Tue, 25 Jun 2024 13:18:26 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1719314306; x=1750850306; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=T5AZaeYdYBbDZejDc9raY5lwPs9NS7HzkWdERl72zdQ=; b=c+FjjpA5ogGIPNRVKKjbM8drj8HNk2BYHAnmQPWI70UlkTdtm3H8DUge 5e+Lzf40P4g7vPZ16BAoqWHk3uo62qEdUR4JFkBKvtjr581frvMGhCg0Q aKgfyeiXbscF+cM/0Fw3K2gTJmnvbLY3u5CbfeMWV/61KwcLfO+QLDSKb cCR+IvYtzONBMGyv+Tmn9BzMD2PBIBOYj2fEd/3opJpZ3b/whQMRsOTmU 9OS+L+cQ4zhABzw4vnQ8mtZqM08yd4NTu91OS+D8Kol62QQmaJa2itUHc O97M9+60PARqq+Z1bWhgiyUSdFsIlvpnhqWm8id8dw9NcqZQ7ahNZFSiq g==; X-CSE-ConnectionGUID: Yq40Pd7cRbyN0+S7lPvUZg== X-CSE-MsgGUID: XOupAj88RHOurgdWkAnsnA== X-IronPort-AV: E=McAfee;i="6700,10204,11113"; a="16080693" X-IronPort-AV: E=Sophos;i="6.08,263,1712646000"; d="scan'208";a="16080693" Received: from orviesa009.jf.intel.com ([10.64.159.149]) by fmvoesa113.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Jun 2024 04:18:26 -0700 X-CSE-ConnectionGUID: WQrE5UWMSD688EqmhVRfpQ== X-CSE-MsgGUID: lWwVqAagTt2t5tbL4bNC+w== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.08,263,1712646000"; d="scan'208";a="43719831" Received: from unknown (HELO silpixa00401119.ir.intel.com) ([10.55.129.167]) by orviesa009.jf.intel.com with ESMTP; 25 Jun 2024 04:18:25 -0700 From: Anatoly Burakov To: dev@dpdk.org Cc: Jesse Brandeburg , bruce.richardson@intel.com, ian.stokes@intel.com Subject: [PATCH v3 128/129] net/ice/base: misc header file clean up Date: Tue, 25 Jun 2024 12:14:13 +0100 Message-ID: <5566d4a43382fe4b054407a2540d8b039a6c7402.1719313664.git.anatoly.burakov@intel.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: References: 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: Jesse Brandeburg 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 330af40b7a..598a80155b 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 { @@ -1511,6 +1540,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