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 C716245501; Wed, 26 Jun 2024 14:04:43 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 5C6D743477; Wed, 26 Jun 2024 13:56:50 +0200 (CEST) Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.9]) by mails.dpdk.org (Postfix) with ESMTP id E425442E95 for ; Wed, 26 Jun 2024 13:45:18 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1719402319; x=1750938319; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=wNBSISexM9ZnmKtXT0vRg0D0L6TpZ1PN4hVaQP+dRh0=; b=c/VjTPNyWsJ3uDwCnRjBeOS2ohAZxxpLbKabRNxgly+Lc3hLMBIrd7qB uANSEbCliNlPvzqidQdUN040s1uV70aqDnQm5ZLo5ECIOXdZU+tfMphoP QMjg/9DWdF9nC9PyRZ1KF722X7E9egqLcbzm4hXgOSNHrx3AOUvr/7pAj l5a75d/NsgB+eSYIQ03QQIgiWfllyLq6/miJMI2CQwtWl/yTj3/eexF4B jkPU+YKXGISZplT2M1npZUxxzXuI4hHVzS/CHGiXDaBda1hu8lmH2UqCF Obmh9Rqe2EbRLJZUTdArv2GiNxnPiHULtI+laNl+n8+jlxBLaVQYqqEsN A==; X-CSE-ConnectionGUID: 2fFPAsGmRzShvDZMor/AEQ== X-CSE-MsgGUID: l0FUkx+UQsObJYGMLdde8Q== X-IronPort-AV: E=McAfee;i="6700,10204,11114"; a="38979541" X-IronPort-AV: E=Sophos;i="6.08,266,1712646000"; d="scan'208";a="38979541" Received: from orviesa010.jf.intel.com ([10.64.159.150]) by orvoesa101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Jun 2024 04:45:18 -0700 X-CSE-ConnectionGUID: VaIlo4h/RjqOrwTCiSGw9A== X-CSE-MsgGUID: Ptga40pwRfyvV7tAIPo4tw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.08,266,1712646000"; d="scan'208";a="43874268" Received: from unknown (HELO silpixa00401119.ir.intel.com) ([10.55.129.167]) by orviesa010.jf.intel.com with ESMTP; 26 Jun 2024 04:45:18 -0700 From: Anatoly Burakov To: dev@dpdk.org Cc: ian.stokes@intel.com, bruce.richardson@intel.com Subject: [PATCH v4 081/103] net/ice/base: fix compile issues on some targets Date: Wed, 26 Jun 2024 12:42:09 +0100 Message-ID: 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 c1658be477..8c66fb1b96 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 551e24a5f5..67e36107b5 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 8a6b18b099..6929d72ccb 100644 --- a/drivers/net/ice/base/ice_ptp_hw.c +++ b/drivers/net/ice/base/ice_ptp_hw.c @@ -4063,7 +4063,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; @@ -5825,13 +5825,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 04b76840dd..92405e1fdb 100644 --- a/drivers/net/ice/base/ice_switch.c +++ b/drivers/net/ice/base/ice_switch.c @@ -7593,7 +7593,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]); } @@ -7614,8 +7615,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