Skip to content

Commit 4e41231

Browse files
committed
Merge branch '100GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/next-queue
Tony Nguyen says: ==================== Intel Wired LAN Driver Updates 2025-02-10 (ice, igc, e1000e) For ice: Karol, Jake, and Michal add PTP support for E830 devices. Karol refactors and cleans up PTP code. Jake allows for a common cross-timestamp implementation to be shared for all devices and Michal adds E830 support. Mateusz cleans up initial Flow Director rule creation to loop rather than duplicate repeated similar calls. For igc: Siang adjust calls to remove need for close and open calls on loading XDP program. For e1000e: Gerhard Engleder batches register writes for writing multicast table on real-time kernels. * '100GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/next-queue: e1000e: Fix real-time violations on link up igc: Avoid unnecessary link down event in XDP_SETUP_PROG process ice: refactor ice_fdir_create_dflt_rules() function ice: Implement PTP support for E830 devices ice: Refactor ice_ptp_init_tx_* ice: Add unified ice_capture_crosststamp ice: Process TSYN IRQ in a separate function ice: Use FIELD_PREP for timestamp values ice: Remove unnecessary ice_is_e8xx() functions ice: Don't check device type when checking GNSS presence ==================== Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
2 parents be1d2a1 + 13e2297 commit 4e41231

File tree

18 files changed

+765
-554
lines changed

18 files changed

+765
-554
lines changed

drivers/net/ethernet/intel/Kconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -336,7 +336,7 @@ config ICE_SWITCHDEV
336336
config ICE_HWTS
337337
bool "Support HW cross-timestamp on platforms with PTM support"
338338
default y
339-
depends on ICE && X86
339+
depends on ICE && X86 && PCIE_PTM
340340
help
341341
Say Y to enable hardware supported cross-timestamping on platforms
342342
with PCIe PTM support. The cross-timestamp is available through

drivers/net/ethernet/intel/e1000e/mac.c

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -331,8 +331,21 @@ void e1000e_update_mc_addr_list_generic(struct e1000_hw *hw,
331331
}
332332

333333
/* replace the entire MTA table */
334-
for (i = hw->mac.mta_reg_count - 1; i >= 0; i--)
334+
for (i = hw->mac.mta_reg_count - 1; i >= 0; i--) {
335335
E1000_WRITE_REG_ARRAY(hw, E1000_MTA, i, hw->mac.mta_shadow[i]);
336+
337+
if (IS_ENABLED(CONFIG_PREEMPT_RT)) {
338+
/*
339+
* Do not queue up too many posted writes to prevent
340+
* increased latency for other devices on the
341+
* interconnect. Flush after each 8th posted write,
342+
* to keep additional execution time low while still
343+
* preventing increased latency.
344+
*/
345+
if (!(i % 8) && i)
346+
e1e_flush();
347+
}
348+
}
336349
e1e_flush();
337350
}
338351

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: 92 additions & 116 deletions
Original file line numberDiff line numberDiff line change
@@ -186,128 +186,14 @@ static int ice_set_mac_type(struct ice_hw *hw)
186186
* ice_is_generic_mac - check if device's mac_type is generic
187187
* @hw: pointer to the hardware structure
188188
*
189-
* Return: true if mac_type is generic (with SBQ support), false if not
189+
* Return: true if mac_type is ICE_MAC_GENERIC*, false otherwise.
190190
*/
191191
bool ice_is_generic_mac(struct ice_hw *hw)
192192
{
193193
return (hw->mac_type == ICE_MAC_GENERIC ||
194194
hw->mac_type == ICE_MAC_GENERIC_3K_E825);
195195
}
196196

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

2411-
if (!ice_is_e825c(hw)) {
2297+
if (hw->mac_type != ICE_MAC_GENERIC_3K_E825) {
24122298
info->clk_freq = FIELD_GET(ICE_TS_CLK_FREQ_M, number);
24132299
info->clk_src = ((number & ICE_TS_CLK_SRC_M) != 0);
24142300
} else {
@@ -5764,6 +5650,96 @@ ice_aq_write_i2c(struct ice_hw *hw, struct ice_aqc_link_topo_addr topo_addr,
57645650
return ice_aq_send_cmd(hw, &desc, NULL, 0, cd);
57655651
}
57665652

5653+
/**
5654+
* ice_get_pca9575_handle - find and return the PCA9575 controller
5655+
* @hw: pointer to the hw struct
5656+
* @pca9575_handle: GPIO controller's handle
5657+
*
5658+
* Find and return the GPIO controller's handle in the netlist.
5659+
* When found - the value will be cached in the hw structure and following calls
5660+
* will return cached value.
5661+
*
5662+
* Return: 0 on success, -ENXIO when there's no PCA9575 present.
5663+
*/
5664+
int ice_get_pca9575_handle(struct ice_hw *hw, u16 *pca9575_handle)
5665+
{
5666+
struct ice_aqc_get_link_topo *cmd;
5667+
struct ice_aq_desc desc;
5668+
int err;
5669+
u8 idx;
5670+
5671+
/* If handle was read previously return cached value */
5672+
if (hw->io_expander_handle) {
5673+
*pca9575_handle = hw->io_expander_handle;
5674+
return 0;
5675+
}
5676+
5677+
#define SW_PCA9575_SFP_TOPO_IDX 2
5678+
#define SW_PCA9575_QSFP_TOPO_IDX 1
5679+
5680+
/* Check if the SW IO expander controlling SMA exists in the netlist. */
5681+
if (hw->device_id == ICE_DEV_ID_E810C_SFP)
5682+
idx = SW_PCA9575_SFP_TOPO_IDX;
5683+
else if (hw->device_id == ICE_DEV_ID_E810C_QSFP)
5684+
idx = SW_PCA9575_QSFP_TOPO_IDX;
5685+
else
5686+
return -ENXIO;
5687+
5688+
/* If handle was not detected read it from the netlist */
5689+
ice_fill_dflt_direct_cmd_desc(&desc, ice_aqc_opc_get_link_topo);
5690+
cmd = &desc.params.get_link_topo;
5691+
cmd->addr.topo_params.node_type_ctx =
5692+
ICE_AQC_LINK_TOPO_NODE_TYPE_GPIO_CTRL;
5693+
cmd->addr.topo_params.index = idx;
5694+
5695+
err = ice_aq_send_cmd(hw, &desc, NULL, 0, NULL);
5696+
if (err)
5697+
return -ENXIO;
5698+
5699+
/* Verify if we found the right IO expander type */
5700+
if (desc.params.get_link_topo.node_part_num !=
5701+
ICE_AQC_GET_LINK_TOPO_NODE_NR_PCA9575)
5702+
return -ENXIO;
5703+
5704+
/* If present save the handle and return it */
5705+
hw->io_expander_handle =
5706+
le16_to_cpu(desc.params.get_link_topo.addr.handle);
5707+
*pca9575_handle = hw->io_expander_handle;
5708+
5709+
return 0;
5710+
}
5711+
5712+
/**
5713+
* ice_read_pca9575_reg - read the register from the PCA9575 controller
5714+
* @hw: pointer to the hw struct
5715+
* @offset: GPIO controller register offset
5716+
* @data: pointer to data to be read from the GPIO controller
5717+
*
5718+
* Return: 0 on success, negative error code otherwise.
5719+
*/
5720+
int ice_read_pca9575_reg(struct ice_hw *hw, u8 offset, u8 *data)
5721+
{
5722+
struct ice_aqc_link_topo_addr link_topo;
5723+
__le16 addr;
5724+
u16 handle;
5725+
int err;
5726+
5727+
memset(&link_topo, 0, sizeof(link_topo));
5728+
5729+
err = ice_get_pca9575_handle(hw, &handle);
5730+
if (err)
5731+
return err;
5732+
5733+
link_topo.handle = cpu_to_le16(handle);
5734+
link_topo.topo_params.node_type_ctx =
5735+
FIELD_PREP(ICE_AQC_LINK_TOPO_NODE_CTX_M,
5736+
ICE_AQC_LINK_TOPO_NODE_CTX_PROVIDED);
5737+
5738+
addr = cpu_to_le16((u16)offset);
5739+
5740+
return ice_aq_read_i2c(hw, link_topo, 0, addr, 1, data, NULL);
5741+
}
5742+
57675743
/**
57685744
* ice_aq_set_gpio
57695745
* @hw: pointer to the hw struct

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

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,6 @@ int
131131
ice_aq_manage_mac_write(struct ice_hw *hw, const u8 *mac_addr, u8 flags,
132132
struct ice_sq_cd *cd);
133133
bool ice_is_generic_mac(struct ice_hw *hw);
134-
bool ice_is_e810(struct ice_hw *hw);
135134
int ice_clear_pf_cfg(struct ice_hw *hw);
136135
int
137136
ice_aq_set_phy_cfg(struct ice_hw *hw, struct ice_port_info *pi,
@@ -276,10 +275,6 @@ ice_stat_update40(struct ice_hw *hw, u32 reg, bool prev_stat_loaded,
276275
void
277276
ice_stat_update32(struct ice_hw *hw, u32 reg, bool prev_stat_loaded,
278277
u64 *prev_stat, u64 *cur_stat);
279-
bool ice_is_e810t(struct ice_hw *hw);
280-
bool ice_is_e822(struct ice_hw *hw);
281-
bool ice_is_e823(struct ice_hw *hw);
282-
bool ice_is_e825c(struct ice_hw *hw);
283278
int
284279
ice_sched_query_elem(struct ice_hw *hw, u32 node_teid,
285280
struct ice_aqc_txsched_elem_data *buf);
@@ -306,5 +301,7 @@ int
306301
ice_aq_write_i2c(struct ice_hw *hw, struct ice_aqc_link_topo_addr topo_addr,
307302
u16 bus_addr, __le16 addr, u8 params, const u8 *data,
308303
struct ice_sq_cd *cd);
304+
int ice_get_pca9575_handle(struct ice_hw *hw, u16 *pca9575_handle);
305+
int ice_read_pca9575_reg(struct ice_hw *hw, u8 offset, u8 *data);
309306
bool ice_fw_supports_report_dflt_cfg(struct ice_hw *hw);
310307
#endif /* _ICE_COMMON_H_ */

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

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

2348-
if (ice_is_e825c(hw))
2348+
if (hw->mac_type == ICE_MAC_GENERIC_3K_E825)
23492349
desc.flags |= cpu_to_le16(ICE_AQ_FLAG_RD);
23502350
} else {
23512351
ice_fill_dflt_direct_cmd_desc(&desc, ice_aqc_opc_get_tx_topo);
23522352
cmd->get_flags = ICE_AQC_TX_TOPO_GET_RAM;
23532353
}
23542354

2355-
if (!ice_is_e825c(hw))
2355+
if (hw->mac_type != ICE_MAC_GENERIC_3K_E825)
23562356
desc.flags |= cpu_to_le16(ICE_AQ_FLAG_RD);
23572357

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

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

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1605,22 +1605,19 @@ void ice_fdir_replay_fltrs(struct ice_pf *pf)
16051605
*/
16061606
int ice_fdir_create_dflt_rules(struct ice_pf *pf)
16071607
{
1608+
const enum ice_fltr_ptype dflt_rules[] = {
1609+
ICE_FLTR_PTYPE_NONF_IPV4_TCP, ICE_FLTR_PTYPE_NONF_IPV4_UDP,
1610+
ICE_FLTR_PTYPE_NONF_IPV6_TCP, ICE_FLTR_PTYPE_NONF_IPV6_UDP,
1611+
};
16081612
int err;
16091613

16101614
/* Create perfect TCP and UDP rules in hardware. */
1611-
err = ice_create_init_fdir_rule(pf, ICE_FLTR_PTYPE_NONF_IPV4_TCP);
1612-
if (err)
1613-
return err;
1614-
1615-
err = ice_create_init_fdir_rule(pf, ICE_FLTR_PTYPE_NONF_IPV4_UDP);
1616-
if (err)
1617-
return err;
1615+
for (int i = 0; i < ARRAY_SIZE(dflt_rules); i++) {
1616+
err = ice_create_init_fdir_rule(pf, dflt_rules[i]);
16181617

1619-
err = ice_create_init_fdir_rule(pf, ICE_FLTR_PTYPE_NONF_IPV6_TCP);
1620-
if (err)
1621-
return err;
1622-
1623-
err = ice_create_init_fdir_rule(pf, ICE_FLTR_PTYPE_NONF_IPV6_UDP);
1618+
if (err)
1619+
break;
1620+
}
16241621

16251622
return err;
16261623
}

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

Lines changed: 10 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -381,32 +381,23 @@ void ice_gnss_exit(struct ice_pf *pf)
381381
}
382382

383383
/**
384-
* ice_gnss_is_gps_present - Check if GPS HW is present
384+
* ice_gnss_is_module_present - Check if GNSS HW is present
385385
* @hw: pointer to HW struct
386+
*
387+
* Return: true when GNSS is present, false otherwise.
386388
*/
387-
bool ice_gnss_is_gps_present(struct ice_hw *hw)
389+
bool ice_gnss_is_module_present(struct ice_hw *hw)
388390
{
389-
if (!hw->func_caps.ts_func_info.src_tmr_owned)
390-
return false;
391+
int err;
392+
u8 data;
391393

392-
if (!ice_is_gps_in_netlist(hw))
394+
if (!hw->func_caps.ts_func_info.src_tmr_owned ||
395+
!ice_is_gps_in_netlist(hw))
393396
return false;
394397

395-
#if IS_ENABLED(CONFIG_PTP_1588_CLOCK)
396-
if (ice_is_e810t(hw)) {
397-
int err;
398-
u8 data;
399-
400-
err = ice_read_pca9575_reg(hw, ICE_PCA9575_P0_IN, &data);
401-
if (err || !!(data & ICE_P0_GNSS_PRSNT_N))
402-
return false;
403-
} else {
404-
return false;
405-
}
406-
#else
407-
if (!ice_is_e810t(hw))
398+
err = ice_read_pca9575_reg(hw, ICE_PCA9575_P0_IN, &data);
399+
if (err || !!(data & ICE_P0_GNSS_PRSNT_N))
408400
return false;
409-
#endif /* IS_ENABLED(CONFIG_PTP_1588_CLOCK) */
410401

411402
return true;
412403
}

0 commit comments

Comments
 (0)