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 8E2E04404F; Wed, 12 Jun 2024 17:24:22 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 3D83E4328B; Wed, 12 Jun 2024 17:06:50 +0200 (CEST) Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.10]) by mails.dpdk.org (Postfix) with ESMTP id 3241C43270 for ; Wed, 12 Jun 2024 17:06:48 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1718204808; x=1749740808; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=++PtKeG1H09voy0RZoSEhCOAOamLBekGZ1On3VTqMhQ=; b=aH0c1Le4mTues16MxL9o8CjmX8D+CrROH7cLsz78R3HmqSwjxOYrGnIf 9+zsQll2jq1kIOgDq1w9xYWk1JTBQ1zDzgSgWfQKz9f4QtM/d5RBNtNIW yTEa/3ZbVE2ua+YcMgj1RIsDsaT2ZQgfdk2q77qQUf+9qBwt9Hysu+cw2 i/IMjETEOj6DwVN3+K/mOO8hscdwwB0jO3D1Vh2FG+1cPxaCB/TRrCwL6 74E0LtGVjyXjDGgmq42viyS2rGLSsWNauKuQKZteWUvWUXJmTaU9s6SYy RzvZACaMpxS8D/ShS6ZlBCr51BtO3kxRMz10eqK44+jPxWAUb+K2+skk/ w==; X-CSE-ConnectionGUID: lVyGsTurTaChdaUZVuR3+w== X-CSE-MsgGUID: muTudQYFRq+aHSoV4nVVHA== X-IronPort-AV: E=McAfee;i="6700,10204,11101"; a="32460068" X-IronPort-AV: E=Sophos;i="6.08,233,1712646000"; d="scan'208";a="32460068" 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:06:48 -0700 X-CSE-ConnectionGUID: I8jln+I7SXaQitJsoh28SQ== X-CSE-MsgGUID: Hkv2NMMmRYSMzrdECl7r0w== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.08,233,1712646000"; d="scan'208";a="39925951" Received: from silpixa00401119.ir.intel.com ([10.55.129.167]) by orviesa009.jf.intel.com with ESMTP; 12 Jun 2024 08:06:47 -0700 From: Anatoly Burakov To: dev@dpdk.org Cc: ian.stokes@intel.com, bruce.richardson@intel.com Subject: [PATCH v2 125/148] net/ice/base: fix compile issues on some targets Date: Wed, 12 Jun 2024 16:01:59 +0100 Message-ID: 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 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 | 7 ++++--- drivers/net/ice/base/ice_ptp_hw.c | 9 +++++---- drivers/net/ice/base/ice_switch.c | 7 ++++--- 4 files changed, 14 insertions(+), 11 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..e242fa8353 100644 --- a/drivers/net/ice/base/ice_parser.c +++ b/drivers/net/ice/base/ice_parser.c @@ -96,7 +96,7 @@ void *ice_parser_sect_item_get(u32 sect_type, void *section, if (index >= LE16_TO_CPU(hdr->count)) return NULL; - return (void *)((uintptr_t)section + data_off + index * size); + return (void *)((u64)section + data_off + index * size); } /** @@ -146,9 +146,10 @@ 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), + (void *)((u64)table + idx * item_size), data, item_size); } } while (data); diff --git a/drivers/net/ice/base/ice_ptp_hw.c b/drivers/net/ice/base/ice_ptp_hw.c index 48d60b7731..13bcd1de27 100644 --- a/drivers/net/ice/base/ice_ptp_hw.c +++ b/drivers/net/ice/base/ice_ptp_hw.c @@ -4027,7 +4027,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; @@ -5850,13 +5850,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 2305707920..0b946444ee 100644 --- a/drivers/net/ice/base/ice_switch.c +++ b/drivers/net/ice/base/ice_switch.c @@ -7794,7 +7794,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]); } @@ -7815,8 +7816,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