Skip to content

Commit e6989b2

Browse files
committed
ice: Remove unnecessary ice_is_e8xx() functions
JIRA: https://issues.redhat.com/browse/RHEL-89579 Upstream commit(s): commit 9973ac9 Author: Karol Kolacinski <karol.kolacinski@intel.com> Date: Mon Sep 30 14:12:39 2024 +0200 ice: Remove unnecessary ice_is_e8xx() functions Remove unnecessary ice_is_e8xx() functions and PHY model. Instead, use MAC type where applicable. Don't check device type in ice_ptp_maybe_trigger_tx_interrupt(), because in reality it depends on the ready bitmap, which only E810 does not have. Call ice_ptp_cfg_phy_interrupt() unconditionally, because all further function calls check the MAC type anyway and this allows simpler code in the future with addition of the new MAC types. Reorder ICE_MAC_* cases in switches in ice_ptp* as in enum ice_mac_type. Signed-off-by: Karol Kolacinski <karol.kolacinski@intel.com> Tested-by: Pucha Himasekhar Reddy <himasekharx.reddy.pucha@intel.com> (A Contingent worker at Intel) Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com> Signed-off-by: Petr Oros <poros@redhat.com>
1 parent 420945a commit e6989b2

File tree

8 files changed

+147
-279
lines changed

8 files changed

+147
-279
lines changed

drivers/net/ethernet/intel/ice/ice.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1046,10 +1046,5 @@ static inline void ice_clear_rdma_cap(struct ice_pf *pf)
10461046
clear_bit(ICE_FLAG_RDMA_ENA, pf->flags);
10471047
}
10481048

1049-
static inline enum ice_phy_model ice_get_phy_model(const struct ice_hw *hw)
1050-
{
1051-
return hw->ptp.phy_model;
1052-
}
1053-
10541049
extern const struct xdp_metadata_ops ice_xdp_md_ops;
10551050
#endif /* _ICE_H_ */

drivers/net/ethernet/intel/ice/ice_common.c

Lines changed: 2 additions & 116 deletions
Original file line numberDiff line numberDiff line change
@@ -185,128 +185,14 @@ static int ice_set_mac_type(struct ice_hw *hw)
185185
* ice_is_generic_mac - check if device's mac_type is generic
186186
* @hw: pointer to the hardware structure
187187
*
188-
* Return: true if mac_type is generic (with SBQ support), false if not
188+
* Return: true if mac_type is ICE_MAC_GENERIC*, false otherwise.
189189
*/
190190
bool ice_is_generic_mac(struct ice_hw *hw)
191191
{
192192
return (hw->mac_type == ICE_MAC_GENERIC ||
193193
hw->mac_type == ICE_MAC_GENERIC_3K_E825);
194194
}
195195

196-
/**
197-
* ice_is_e810
198-
* @hw: pointer to the hardware structure
199-
*
200-
* returns true if the device is E810 based, false if not.
201-
*/
202-
bool ice_is_e810(struct ice_hw *hw)
203-
{
204-
return hw->mac_type == ICE_MAC_E810;
205-
}
206-
207-
/**
208-
* ice_is_e810t
209-
* @hw: pointer to the hardware structure
210-
*
211-
* returns true if the device is E810T based, false if not.
212-
*/
213-
bool ice_is_e810t(struct ice_hw *hw)
214-
{
215-
switch (hw->device_id) {
216-
case ICE_DEV_ID_E810C_SFP:
217-
switch (hw->subsystem_device_id) {
218-
case ICE_SUBDEV_ID_E810T:
219-
case ICE_SUBDEV_ID_E810T2:
220-
case ICE_SUBDEV_ID_E810T3:
221-
case ICE_SUBDEV_ID_E810T4:
222-
case ICE_SUBDEV_ID_E810T6:
223-
case ICE_SUBDEV_ID_E810T7:
224-
return true;
225-
}
226-
break;
227-
case ICE_DEV_ID_E810C_QSFP:
228-
switch (hw->subsystem_device_id) {
229-
case ICE_SUBDEV_ID_E810T2:
230-
case ICE_SUBDEV_ID_E810T3:
231-
case ICE_SUBDEV_ID_E810T5:
232-
return true;
233-
}
234-
break;
235-
default:
236-
break;
237-
}
238-
239-
return false;
240-
}
241-
242-
/**
243-
* ice_is_e822 - Check if a device is E822 family device
244-
* @hw: pointer to the hardware structure
245-
*
246-
* Return: true if the device is E822 based, false if not.
247-
*/
248-
bool ice_is_e822(struct ice_hw *hw)
249-
{
250-
switch (hw->device_id) {
251-
case ICE_DEV_ID_E822C_BACKPLANE:
252-
case ICE_DEV_ID_E822C_QSFP:
253-
case ICE_DEV_ID_E822C_SFP:
254-
case ICE_DEV_ID_E822C_10G_BASE_T:
255-
case ICE_DEV_ID_E822C_SGMII:
256-
case ICE_DEV_ID_E822L_BACKPLANE:
257-
case ICE_DEV_ID_E822L_SFP:
258-
case ICE_DEV_ID_E822L_10G_BASE_T:
259-
case ICE_DEV_ID_E822L_SGMII:
260-
return true;
261-
default:
262-
return false;
263-
}
264-
}
265-
266-
/**
267-
* ice_is_e823
268-
* @hw: pointer to the hardware structure
269-
*
270-
* returns true if the device is E823-L or E823-C based, false if not.
271-
*/
272-
bool ice_is_e823(struct ice_hw *hw)
273-
{
274-
switch (hw->device_id) {
275-
case ICE_DEV_ID_E823L_BACKPLANE:
276-
case ICE_DEV_ID_E823L_SFP:
277-
case ICE_DEV_ID_E823L_10G_BASE_T:
278-
case ICE_DEV_ID_E823L_1GBE:
279-
case ICE_DEV_ID_E823L_QSFP:
280-
case ICE_DEV_ID_E823C_BACKPLANE:
281-
case ICE_DEV_ID_E823C_QSFP:
282-
case ICE_DEV_ID_E823C_SFP:
283-
case ICE_DEV_ID_E823C_10G_BASE_T:
284-
case ICE_DEV_ID_E823C_SGMII:
285-
return true;
286-
default:
287-
return false;
288-
}
289-
}
290-
291-
/**
292-
* ice_is_e825c - Check if a device is E825C family device
293-
* @hw: pointer to the hardware structure
294-
*
295-
* Return: true if the device is E825-C based, false if not.
296-
*/
297-
bool ice_is_e825c(struct ice_hw *hw)
298-
{
299-
switch (hw->device_id) {
300-
case ICE_DEV_ID_E825C_BACKPLANE:
301-
case ICE_DEV_ID_E825C_QSFP:
302-
case ICE_DEV_ID_E825C_SFP:
303-
case ICE_DEV_ID_E825C_SGMII:
304-
return true;
305-
default:
306-
return false;
307-
}
308-
}
309-
310196
/**
311197
* ice_is_pf_c827 - check if pf contains c827 phy
312198
* @hw: pointer to the hw struct
@@ -2388,7 +2274,7 @@ ice_parse_1588_func_caps(struct ice_hw *hw, struct ice_hw_func_caps *func_p,
23882274
info->tmr_index_owned = ((number & ICE_TS_TMR_IDX_OWND_M) != 0);
23892275
info->tmr_index_assoc = ((number & ICE_TS_TMR_IDX_ASSOC_M) != 0);
23902276

2391-
if (!ice_is_e825c(hw)) {
2277+
if (hw->mac_type != ICE_MAC_GENERIC_3K_E825) {
23922278
info->clk_freq = FIELD_GET(ICE_TS_CLK_FREQ_M, number);
23932279
info->clk_src = ((number & ICE_TS_CLK_SRC_M) != 0);
23942280
} else {

drivers/net/ethernet/intel/ice/ice_common.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,6 @@ int
132132
ice_aq_manage_mac_write(struct ice_hw *hw, const u8 *mac_addr, u8 flags,
133133
struct ice_sq_cd *cd);
134134
bool ice_is_generic_mac(struct ice_hw *hw);
135-
bool ice_is_e810(struct ice_hw *hw);
136135
int ice_clear_pf_cfg(struct ice_hw *hw);
137136
int
138137
ice_aq_set_phy_cfg(struct ice_hw *hw, struct ice_port_info *pi,
@@ -275,10 +274,6 @@ ice_stat_update40(struct ice_hw *hw, u32 reg, bool prev_stat_loaded,
275274
void
276275
ice_stat_update32(struct ice_hw *hw, u32 reg, bool prev_stat_loaded,
277276
u64 *prev_stat, u64 *cur_stat);
278-
bool ice_is_e810t(struct ice_hw *hw);
279-
bool ice_is_e822(struct ice_hw *hw);
280-
bool ice_is_e823(struct ice_hw *hw);
281-
bool ice_is_e825c(struct ice_hw *hw);
282277
int
283278
ice_sched_query_elem(struct ice_hw *hw, u32 node_teid,
284279
struct ice_aqc_txsched_elem_data *buf);

drivers/net/ethernet/intel/ice/ice_ddp.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2312,14 +2312,14 @@ ice_get_set_tx_topo(struct ice_hw *hw, u8 *buf, u16 buf_size,
23122312
cmd->set_flags |= ICE_AQC_TX_TOPO_FLAGS_SRC_RAM |
23132313
ICE_AQC_TX_TOPO_FLAGS_LOAD_NEW;
23142314

2315-
if (ice_is_e825c(hw))
2315+
if (hw->mac_type == ICE_MAC_GENERIC_3K_E825)
23162316
desc.flags |= cpu_to_le16(ICE_AQ_FLAG_RD);
23172317
} else {
23182318
ice_fill_dflt_direct_cmd_desc(&desc, ice_aqc_opc_get_tx_topo);
23192319
cmd->get_flags = ICE_AQC_TX_TOPO_GET_RAM;
23202320
}
23212321

2322-
if (!ice_is_e825c(hw))
2322+
if (hw->mac_type != ICE_MAC_GENERIC_3K_E825)
23232323
desc.flags |= cpu_to_le16(ICE_AQ_FLAG_RD);
23242324

23252325
status = ice_aq_send_cmd(hw, &desc, buf, buf_size, cd);

0 commit comments

Comments
 (0)