Skip to content

Commit 333f339

Browse files
author
Paolo Abeni
committed
Merge branch 'intel-wired-lan-driver-updates-2023-12-01-ice'
Tony Nguyen says: ==================== Intel Wired LAN Driver Updates 2023-12-01 (ice) This series contains updates to ice driver only. Konrad provides temperature reporting via hwmon. Arkadiusz adds reporting of Clock Generation Unit (CGU) information via devlink info. Pawel adjusts error messaging for ntuple filters to account for additional possibility for encountering an error. Karol ensures that all timestamps occurring around reset are processed and renames some E822 functions to convey additional usage for E823 devices. Jake provides mechanism to ensure that all timestamps on E822 devices are processed. The following are changes since commit 15bc812: octeon_ep: set backpressure watermark for RX queues and are available in the git repository at: git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/next-queue 100GbE ==================== Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Paolo Abeni <[email protected]>
2 parents 4aee43f + a39dd25 commit 333f339

File tree

18 files changed

+627
-297
lines changed

18 files changed

+627
-297
lines changed

Documentation/networking/devlink/ice.rst

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,10 @@ The ``ice`` driver reports the following versions
3838
- fixed
3939
- K65390-000
4040
- The Product Board Assembly (PBA) identifier of the board.
41+
* - ``cgu.id``
42+
- fixed
43+
- 36
44+
- The Clock Generation Unit (CGU) hardware revision identifier.
4145
* - ``fw.mgmt``
4246
- running
4347
- 2.1.7
@@ -104,6 +108,11 @@ The ``ice`` driver reports the following versions
104108
- running
105109
- 0xee16ced7
106110
- The first 4 bytes of the hash of the netlist module contents.
111+
* - ``fw.cgu``
112+
- running
113+
- 8032.16973825.6021
114+
- The version of Clock Generation Unit (CGU). Format:
115+
<CGU type>.<configuration version>.<firmware version>.
107116

108117
Flash Update
109118
============

drivers/net/ethernet/intel/Kconfig

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -299,6 +299,17 @@ config ICE
299299
To compile this driver as a module, choose M here. The module
300300
will be called ice.
301301

302+
config ICE_HWMON
303+
bool "Intel(R) Ethernet Connection E800 Series Support HWMON support"
304+
default y
305+
depends on ICE && HWMON && !(ICE=y && HWMON=m)
306+
help
307+
Say Y if you want to expose thermal sensor data on Intel devices.
308+
309+
Some of our devices contain internal thermal sensors.
310+
This data is available via the hwmon sysfs interface and exposes
311+
the onboard sensors.
312+
302313
config ICE_SWITCHDEV
303314
bool "Switchdev Support"
304315
default y

drivers/net/ethernet/intel/ice/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,3 +49,4 @@ ice-$(CONFIG_RFS_ACCEL) += ice_arfs.o
4949
ice-$(CONFIG_XDP_SOCKETS) += ice_xsk.o
5050
ice-$(CONFIG_ICE_SWITCHDEV) += ice_eswitch.o ice_eswitch_br.o
5151
ice-$(CONFIG_GNSS) += ice_gnss.o
52+
ice-$(CONFIG_ICE_HWMON) += ice_hwmon.o

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -655,6 +655,7 @@ struct ice_pf {
655655
#define ICE_MAX_VF_AGG_NODES 32
656656
struct ice_agg_node vf_agg_node[ICE_MAX_VF_AGG_NODES];
657657
struct ice_dplls dplls;
658+
struct device *hwmon_dev;
658659
};
659660

660661
extern struct workqueue_struct *ice_lag_wq;

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

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,7 @@ struct ice_aqc_list_caps_elem {
117117
#define ICE_AQC_CAPS_NET_VER 0x004C
118118
#define ICE_AQC_CAPS_PENDING_NET_VER 0x004D
119119
#define ICE_AQC_CAPS_RDMA 0x0051
120+
#define ICE_AQC_CAPS_SENSOR_READING 0x0067
120121
#define ICE_AQC_CAPS_PCIE_RESET_AVOIDANCE 0x0076
121122
#define ICE_AQC_CAPS_POST_UPDATE_RESET_RESTRICT 0x0077
122123
#define ICE_AQC_CAPS_NVM_MGMT 0x0080
@@ -1413,6 +1414,30 @@ struct ice_aqc_get_phy_rec_clk_out {
14131414
__le16 node_handle;
14141415
};
14151416

1417+
/* Get sensor reading (direct 0x0632) */
1418+
struct ice_aqc_get_sensor_reading {
1419+
u8 sensor;
1420+
u8 format;
1421+
u8 reserved[6];
1422+
__le32 addr_high;
1423+
__le32 addr_low;
1424+
};
1425+
1426+
/* Get sensor reading response (direct 0x0632) */
1427+
struct ice_aqc_get_sensor_reading_resp {
1428+
union {
1429+
u8 raw[8];
1430+
/* Output data for sensor 0x00, format 0x00 */
1431+
struct _packed {
1432+
s8 temp;
1433+
u8 temp_warning_threshold;
1434+
u8 temp_critical_threshold;
1435+
u8 temp_fatal_threshold;
1436+
u8 reserved[4];
1437+
} s0f0;
1438+
} data;
1439+
};
1440+
14161441
struct ice_aqc_link_topo_params {
14171442
u8 lport_num;
14181443
u8 lport_num_valid;
@@ -2443,6 +2468,8 @@ struct ice_aq_desc {
24432468
struct ice_aqc_restart_an restart_an;
24442469
struct ice_aqc_set_phy_rec_clk_out set_phy_rec_clk_out;
24452470
struct ice_aqc_get_phy_rec_clk_out get_phy_rec_clk_out;
2471+
struct ice_aqc_get_sensor_reading get_sensor_reading;
2472+
struct ice_aqc_get_sensor_reading_resp get_sensor_reading_resp;
24462473
struct ice_aqc_gpio read_write_gpio;
24472474
struct ice_aqc_sff_eeprom read_write_sff_param;
24482475
struct ice_aqc_set_port_id_led set_port_id_led;
@@ -2618,6 +2645,7 @@ enum ice_adminq_opc {
26182645
ice_aqc_opc_set_mac_lb = 0x0620,
26192646
ice_aqc_opc_set_phy_rec_clk_out = 0x0630,
26202647
ice_aqc_opc_get_phy_rec_clk_out = 0x0631,
2648+
ice_aqc_opc_get_sensor_reading = 0x0632,
26212649
ice_aqc_opc_get_link_topo = 0x06E0,
26222650
ice_aqc_opc_read_i2c = 0x06E2,
26232651
ice_aqc_opc_write_i2c = 0x06E3,

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

Lines changed: 53 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2710,6 +2710,26 @@ ice_parse_fdir_dev_caps(struct ice_hw *hw, struct ice_hw_dev_caps *dev_p,
27102710
dev_p->num_flow_director_fltr);
27112711
}
27122712

2713+
/**
2714+
* ice_parse_sensor_reading_cap - Parse ICE_AQC_CAPS_SENSOR_READING cap
2715+
* @hw: pointer to the HW struct
2716+
* @dev_p: pointer to device capabilities structure
2717+
* @cap: capability element to parse
2718+
*
2719+
* Parse ICE_AQC_CAPS_SENSOR_READING for device capability for reading
2720+
* enabled sensors.
2721+
*/
2722+
static void
2723+
ice_parse_sensor_reading_cap(struct ice_hw *hw, struct ice_hw_dev_caps *dev_p,
2724+
struct ice_aqc_list_caps_elem *cap)
2725+
{
2726+
dev_p->supported_sensors = le32_to_cpu(cap->number);
2727+
2728+
ice_debug(hw, ICE_DBG_INIT,
2729+
"dev caps: supported sensors (bitmap) = 0x%x\n",
2730+
dev_p->supported_sensors);
2731+
}
2732+
27132733
/**
27142734
* ice_parse_dev_caps - Parse device capabilities
27152735
* @hw: pointer to the HW struct
@@ -2755,9 +2775,12 @@ ice_parse_dev_caps(struct ice_hw *hw, struct ice_hw_dev_caps *dev_p,
27552775
case ICE_AQC_CAPS_1588:
27562776
ice_parse_1588_dev_caps(hw, dev_p, &cap_resp[i]);
27572777
break;
2758-
case ICE_AQC_CAPS_FD:
2778+
case ICE_AQC_CAPS_FD:
27592779
ice_parse_fdir_dev_caps(hw, dev_p, &cap_resp[i]);
27602780
break;
2781+
case ICE_AQC_CAPS_SENSOR_READING:
2782+
ice_parse_sensor_reading_cap(hw, dev_p, &cap_resp[i]);
2783+
break;
27612784
default:
27622785
/* Don't list common capabilities as unknown */
27632786
if (!found)
@@ -5540,6 +5563,35 @@ ice_aq_get_phy_rec_clk_out(struct ice_hw *hw, u8 *phy_output, u8 *port_num,
55405563
return status;
55415564
}
55425565

5566+
/**
5567+
* ice_aq_get_sensor_reading
5568+
* @hw: pointer to the HW struct
5569+
* @data: pointer to data to be read from the sensor
5570+
*
5571+
* Get sensor reading (0x0632)
5572+
*/
5573+
int ice_aq_get_sensor_reading(struct ice_hw *hw,
5574+
struct ice_aqc_get_sensor_reading_resp *data)
5575+
{
5576+
struct ice_aqc_get_sensor_reading *cmd;
5577+
struct ice_aq_desc desc;
5578+
int status;
5579+
5580+
ice_fill_dflt_direct_cmd_desc(&desc, ice_aqc_opc_get_sensor_reading);
5581+
cmd = &desc.params.get_sensor_reading;
5582+
#define ICE_INTERNAL_TEMP_SENSOR_FORMAT 0
5583+
#define ICE_INTERNAL_TEMP_SENSOR 0
5584+
cmd->sensor = ICE_INTERNAL_TEMP_SENSOR;
5585+
cmd->format = ICE_INTERNAL_TEMP_SENSOR_FORMAT;
5586+
5587+
status = ice_aq_send_cmd(hw, &desc, NULL, 0, NULL);
5588+
if (!status)
5589+
memcpy(data, &desc.params.get_sensor_reading_resp,
5590+
sizeof(*data));
5591+
5592+
return status;
5593+
}
5594+
55435595
/**
55445596
* ice_replay_pre_init - replay pre initialization
55455597
* @hw: pointer to the HW struct

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -241,6 +241,8 @@ ice_aq_set_phy_rec_clk_out(struct ice_hw *hw, u8 phy_output, bool enable,
241241
int
242242
ice_aq_get_phy_rec_clk_out(struct ice_hw *hw, u8 *phy_output, u8 *port_num,
243243
u8 *flags, u16 *node_handle);
244+
int ice_aq_get_sensor_reading(struct ice_hw *hw,
245+
struct ice_aqc_get_sensor_reading_resp *data);
244246
void
245247
ice_stat_update40(struct ice_hw *hw, u32 reg, bool prev_stat_loaded,
246248
u64 *prev_stat, u64 *cur_stat);

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

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,24 @@ ice_info_pending_netlist_build(struct ice_pf __always_unused *pf,
193193
snprintf(ctx->buf, sizeof(ctx->buf), "0x%08x", netlist->hash);
194194
}
195195

196+
static void ice_info_cgu_fw_build(struct ice_pf *pf, struct ice_info_ctx *ctx)
197+
{
198+
u32 id, cfg_ver, fw_ver;
199+
200+
if (!ice_is_feature_supported(pf, ICE_F_CGU))
201+
return;
202+
if (ice_aq_get_cgu_info(&pf->hw, &id, &cfg_ver, &fw_ver))
203+
return;
204+
snprintf(ctx->buf, sizeof(ctx->buf), "%u.%u.%u", id, cfg_ver, fw_ver);
205+
}
206+
207+
static void ice_info_cgu_id(struct ice_pf *pf, struct ice_info_ctx *ctx)
208+
{
209+
if (!ice_is_feature_supported(pf, ICE_F_CGU))
210+
return;
211+
snprintf(ctx->buf, sizeof(ctx->buf), "%u", pf->hw.cgu_part_number);
212+
}
213+
196214
#define fixed(key, getter) { ICE_VERSION_FIXED, key, getter, NULL }
197215
#define running(key, getter) { ICE_VERSION_RUNNING, key, getter, NULL }
198216
#define stored(key, getter, fallback) { ICE_VERSION_STORED, key, getter, fallback }
@@ -235,6 +253,8 @@ static const struct ice_devlink_version {
235253
running("fw.app.bundle_id", ice_info_ddp_pkg_bundle_id),
236254
combined("fw.netlist", ice_info_netlist_ver, ice_info_pending_netlist_ver),
237255
combined("fw.netlist.build", ice_info_netlist_build, ice_info_pending_netlist_build),
256+
fixed("cgu.id", ice_info_cgu_id),
257+
running("fw.cgu", ice_info_cgu_fw_build),
238258
};
239259

240260
/**

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

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -668,7 +668,7 @@ ice_fdir_set_hw_fltr_rule(struct ice_pf *pf, struct ice_flow_seg_info *seg,
668668
* then return error.
669669
*/
670670
if (hw->fdir_fltr_cnt[flow]) {
671-
dev_err(dev, "Failed to add filter. Flow director filters on each port must have the same input set.\n");
671+
dev_err(dev, "Failed to add filter. Flow director filters on each port must have the same input set.\n");
672672
return -EINVAL;
673673
}
674674

@@ -770,7 +770,7 @@ ice_fdir_set_hw_fltr_rule(struct ice_pf *pf, struct ice_flow_seg_info *seg,
770770
ice_flow_rem_entry(hw, ICE_BLK_FD, entry1_h);
771771
err_prof:
772772
ice_flow_rem_prof(hw, ICE_BLK_FD, prof_id);
773-
dev_err(dev, "Failed to add filter. Flow director filters on each port must have the same input set.\n");
773+
dev_err(dev, "Failed to add filter. Flow director filters on each port must have the same input set.\n");
774774

775775
return err;
776776
}
@@ -1853,6 +1853,7 @@ int ice_add_fdir_ethtool(struct ice_vsi *vsi, struct ethtool_rxnfc *cmd)
18531853
struct ice_pf *pf;
18541854
struct ice_hw *hw;
18551855
int fltrs_needed;
1856+
u32 max_location;
18561857
u16 tunnel_port;
18571858
int ret;
18581859

@@ -1884,16 +1885,18 @@ int ice_add_fdir_ethtool(struct ice_vsi *vsi, struct ethtool_rxnfc *cmd)
18841885
if (ret)
18851886
return ret;
18861887

1887-
if (fsp->location >= ice_get_fdir_cnt_all(hw)) {
1888-
dev_err(dev, "Failed to add filter. The maximum number of flow director filters has been reached.\n");
1888+
max_location = ice_get_fdir_cnt_all(hw);
1889+
if (fsp->location >= max_location) {
1890+
dev_err(dev, "Failed to add filter. The number of ntuple filters or provided location exceed max %d.\n",
1891+
max_location);
18891892
return -ENOSPC;
18901893
}
18911894

18921895
/* return error if not an update and no available filters */
18931896
fltrs_needed = ice_get_open_tunnel_port(hw, &tunnel_port, TNL_ALL) ? 2 : 1;
18941897
if (!ice_fdir_find_fltr_by_idx(hw, fsp->location) &&
18951898
ice_fdir_num_avail_fltr(hw, pf->vsi[vsi->idx]) < fltrs_needed) {
1896-
dev_err(dev, "Failed to add filter. The maximum number of flow director filters has been reached.\n");
1899+
dev_err(dev, "Failed to add filter. The maximum number of flow director filters has been reached.\n");
18971900
return -ENOSPC;
18981901
}
18991902

0 commit comments

Comments
 (0)