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 0F966454EF; Tue, 25 Jun 2024 13:28:33 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 26A9B42FE3; Tue, 25 Jun 2024 13:19:37 +0200 (CEST) Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.19]) by mails.dpdk.org (Postfix) with ESMTP id 71A3C42F11 for ; Tue, 25 Jun 2024 13:17:52 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1719314272; x=1750850272; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=mPfRTpzgountdBfRCYxxE7iYsid/QgwQNOucBj1ubQA=; b=Qm6+Jax2mAKQ7keLH/5ez+faXY91uxRQXndUl8TMqGTjoazHfBYXx1js 5OLeuw8ORN95cgAZsUg5Gz+KYQsin3FR2fIcK4yx5iahd/oBDtyY0rsYS MYjsDjgf8F4tF7Z/Sk9t0YuIG83GloDgNfvVP72yUPRryG1vfyFaKeiWh 3RTjHDbEOFn4ULy+H9X7WIRD4N1CqMi6UASwMg0WjAX3nWs0Ls7waRW8k T4mEvRh0cU05SzmQ2L6wsSlD71OBiJznUkbu460RTFlfh0t7GjrY0PPpV YsMjEGpUmyqhUttxGJmV7/Y8HfZl+eQpMMMvdPnZyK1KORIaO4c9IGima Q==; X-CSE-ConnectionGUID: w/j5BjoWR2SDcI1AxMjqgg== X-CSE-MsgGUID: JtNz8QV8SOSqbblMHf6mnA== X-IronPort-AV: E=McAfee;i="6700,10204,11113"; a="16080599" X-IronPort-AV: E=Sophos;i="6.08,263,1712646000"; d="scan'208";a="16080599" 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:17:52 -0700 X-CSE-ConnectionGUID: ogILzgqWQF+Nq6mS9S1ytw== X-CSE-MsgGUID: fFlOGi4zT4Gq+VlGt6Fwuw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.08,263,1712646000"; d="scan'208";a="43719697" Received: from unknown (HELO silpixa00401119.ir.intel.com) ([10.55.129.167]) by orviesa009.jf.intel.com with ESMTP; 25 Jun 2024 04:17:52 -0700 From: Anatoly Burakov To: dev@dpdk.org Cc: bruce.richardson@intel.com, ian.stokes@intel.com Subject: [PATCH v3 106/129] net/ice/base: fix compile issues on some targets Date: Tue, 25 Jun 2024 12:13:51 +0100 Message-ID: <2352e6345df47c6536bb7b9119a2a078ab1d8a41.1719313663.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 To avoid triggering compile errors reported on some targets, use explicit type casts to specify type conversion. Signed-off-by: Anatoly Burakov --- drivers/net/ice/base/ice_flow.h | 2 +- drivers/net/ice/base/ice_parser.c | 3 ++- drivers/net/ice/base/ice_ptp_hw.c | 9 +++++---- drivers/net/ice/base/ice_switch.c | 7 ++++--- 4 files changed, 12 insertions(+), 9 deletions(-) diff --git a/drivers/net/ice/base/ice_flow.h b/drivers/net/ice/base/ice_flow.h index fd2ec39c1e..65b261beca 100644 --- a/drivers/net/ice/base/ice_flow.h +++ b/drivers/net/ice/base/ice_flow.h @@ -485,7 +485,7 @@ struct ice_flow_entry { u8 acts_cnt; }; -#define ICE_FLOW_ENTRY_HNDL(e) ((intptr_t)e) +#define ICE_FLOW_ENTRY_HNDL(e) ((u64)e) #define ICE_FLOW_ENTRY_PTR(h) ((struct ice_flow_entry *)(h)) struct ice_flow_prof { diff --git a/drivers/net/ice/base/ice_parser.c b/drivers/net/ice/base/ice_parser.c index c9bcf9ea5e..167f9534b1 100644 --- a/drivers/net/ice/base/ice_parser.c +++ b/drivers/net/ice/base/ice_parser.c @@ -146,7 +146,8 @@ void *ice_parser_create_table(struct ice_hw *hw, u32 sect_type, if (no_offset) idx++; else - idx = hdr->offset + state.entry_idx; + idx = LE16_TO_CPU(hdr->offset) + + state.entry_idx; parse_item(hw, idx, (void *)((uintptr_t)table + idx * item_size), data, item_size); diff --git a/drivers/net/ice/base/ice_ptp_hw.c b/drivers/net/ice/base/ice_ptp_hw.c index 97a98f220d..1b7a57c03d 100644 --- a/drivers/net/ice/base/ice_ptp_hw.c +++ b/drivers/net/ice/base/ice_ptp_hw.c @@ -4020,7 +4020,7 @@ ice_phy_calc_pmd_adj_e822(struct ice_hw *hw, u8 port, return err; } - rx_cycle = val & P_REG_RX_80_TO_160_CNT_RXCYC_M; + rx_cycle = (u8)(val & P_REG_RX_80_TO_160_CNT_RXCYC_M); if (rx_cycle) { mult = rx_cycle * 40; @@ -5832,13 +5832,14 @@ int ice_ptp_init_time(struct ice_hw *hw, u64 time, bool wr_main_tmr) /* Fill Rx and Tx ports and send msg to PHY */ switch (hw->phy_model) { case ICE_PHY_ETH56G: - err = ice_ptp_prep_phy_time_eth56g(hw, time & 0xFFFFFFFF); + err = ice_ptp_prep_phy_time_eth56g(hw, + (u32)(time & 0xFFFFFFFF)); break; case ICE_PHY_E810: - err = ice_ptp_prep_phy_time_e810(hw, time & 0xFFFFFFFF); + err = ice_ptp_prep_phy_time_e810(hw, (u32)(time & 0xFFFFFFFF)); break; case ICE_PHY_E822: - err = ice_ptp_prep_phy_time_e822(hw, time & 0xFFFFFFFF); + err = ice_ptp_prep_phy_time_e822(hw, (u32)(time & 0xFFFFFFFF)); break; default: err = ICE_ERR_NOT_SUPPORTED; diff --git a/drivers/net/ice/base/ice_switch.c b/drivers/net/ice/base/ice_switch.c index 36143f149b..264d0ef839 100644 --- a/drivers/net/ice/base/ice_switch.c +++ b/drivers/net/ice/base/ice_switch.c @@ -7594,7 +7594,8 @@ ice_add_sw_recipe(struct ice_hw *hw, struct ice_sw_recipe *rm, } for (i = 0; i < entry->r_group.n_val_pairs; i++) { - buf[recps].content.lkup_indx[i + 1] = entry->fv_idx[i]; + buf[recps].content.lkup_indx[i + 1] = + (u8)entry->fv_idx[i]; buf[recps].content.mask[i + 1] = CPU_TO_LE16(entry->fv_mask[i]); } @@ -7615,8 +7616,8 @@ ice_add_sw_recipe(struct ice_hw *hw, struct ice_sw_recipe *rm, ((chain_idx << ICE_AQ_RECIPE_RESULT_DATA_S) & ICE_AQ_RECIPE_RESULT_DATA_M); ice_clear_bit(chain_idx, result_idx_bm); - chain_idx = ice_find_first_bit(result_idx_bm, - ICE_MAX_FV_WORDS); + chain_idx = (u8)ice_find_first_bit(result_idx_bm, + ICE_MAX_FV_WORDS); } /* fill recipe dependencies */ -- 2.43.0