mlxsw: Various updates
Subsystems (3)
Ido Schimmel
maintainercover mlxsw: Various updates
This patchset contains miscellaneous updates to mlxsw gathered over time.
Patches #1-#2 fix recent regressions present in net-next.
Patches #3-#11 are small cleanups performed while adding line card support in mlxsw.
Patch #12 adds the SFF-8024 Identifier Value of OSFP transceiver in order to be able to dump their EEPROM contents over the ethtool IOCTL interface.
Danielle Ratson (1):
mlxsw: core: Add support for OSFP transceiver modules
Ido Schimmel (2):
mlxsw: spectrum_span: Ignore VLAN entries not used by the bridge in
mirroring
mlxsw: Remove resource query check
Jiri Pirko (1):
mlxsw: spectrum: Remove SP{1,2,3} defines for FW minor and subminor
Vadim Pasternak (8):
mlxsw: core: Prevent trap group setting if driver does not support
EMAD
mlxsw: core_thermal: Avoid creation of virtual hwmon objects by
thermal module
mlxsw: core_hwmon: Fix variable names for hwmon attributes
mlxsw: core_thermal: Rename labels according to naming convention
mlxsw: core_thermal: Remove obsolete API for query resource
mlxsw: reg: Add "mgpir_" prefix to MGPIR fields comments
mlxsw: core: Remove unnecessary asserts
mlxsw: core: Unify method of trap support validation
drivers/net/ethernet/mellanox/mlxsw/core.c | 32 +++----- drivers/net/ethernet/mellanox/mlxsw/core.h | 7 -- .../net/ethernet/mellanox/mlxsw/core_env.c | 38 +-------- .../net/ethernet/mellanox/mlxsw/core_hwmon.c | 79 +++++++++---------- .../ethernet/mellanox/mlxsw/core_thermal.c | 66 ++++++++-------- drivers/net/ethernet/mellanox/mlxsw/minimal.c | 1 - drivers/net/ethernet/mellanox/mlxsw/reg.h | 9 ++- .../net/ethernet/mellanox/mlxsw/spectrum.c | 45 ++++------- .../ethernet/mellanox/mlxsw/spectrum_span.c | 3 +- 9 files changed, 106 insertions(+), 174 deletions(-)
Signature · 1 line
2.33.1
Ido Schimmel
maintainerPATCH 1/12 mlxsw: core: Prevent trap group setting if driver does not support EMAD
From: Vadim Pasternak <[email protected]>
Avoid trap group setting if driver is not capable of EMAD support. For example, "mlxsw_minimal" driver works over I2C bus, overs which EMADs cannot be sent.
Validation is performed by testing feature 'MLXSW_BUS_F_TXRX'.
--- drivers/net/ethernet/mellanox/mlxsw/core.c | 9 +++++++++ 1 file changed, 9 insertions(+)
drivers/net/ethernet/mellanox/mlxsw/core.c +9 -0
@@ -223,6 +223,9 @@ static int mlxsw_core_trap_groups_set(struct mlxsw_core *mlxsw_core)int err;int i; +if (!(mlxsw_core->bus->features &MLXSW_BUS_F_TXRX )) +return 0 ; +for (i =0 ; i <ARRAY_SIZE (mlxsw_core_trap_groups); i++) { mlxsw_reg_htgt_pack(htgt_pl, mlxsw_core_trap_groups[i], MLXSW_REG_HTGT_INVALID_POLICER,
@@ -2522,6 +2525,9 @@ int mlxsw_core_trap_register(struct mlxsw_core *mlxsw_core,char hpkt_pl[MLXSW_REG_HPKT_LEN ];int err; +if (!(mlxsw_core->bus->features &MLXSW_BUS_F_TXRX )) +return 0 ; + err =mlxsw_core_listener_register (mlxsw_core, listener, priv, listener->enabled_on_register);if (err)
@@ -2551,6 +2557,9 @@ void mlxsw_core_trap_unregister(struct mlxsw_core *mlxsw_core, {char hpkt_pl[MLXSW_REG_HPKT_LEN ]; +if (!(mlxsw_core->bus->features &MLXSW_BUS_F_TXRX )) +return ; +if (!listener->is_event) { mlxsw_reg_hpkt_pack(hpkt_pl, listener->dis_action, listener->trap_id, listener->dis_trap_group,
Signature · 1 line
2.33.1
Ido Schimmel
maintainerPATCH 2/12 mlxsw: spectrum_span: Ignore VLAN entries not used by the bridge in mirroring
In reply to Ido SchimmelOnly VLAN entries installed on the bridge device itself should be considered when checking whether a packet with a specific VLAN can be mirrored via a bridge device. VLAN entries only used to keep context (i.e., entries with 'BRIDGE_VLAN_INFO_BRENTRY' unset) should be ignored.
Fix this by preventing mirroring when the VLAN entry does not have the 'BRIDGE_VLAN_INFO_BRENTRY' flag set.
---
Cc: Vladimir Oltean <[email protected]>
--- drivers/net/ethernet/mellanox/mlxsw/spectrum_span.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/net/ethernet/mellanox/mlxsw/spectrum_span.c +2 -1
@@ -269,7 +269,8 @@ mlxsw_sp_span_entry_bridge_8021q(const struct net_device *br_dev,if (!vid &&WARN_ON (br_vlan_get_pvid (br_dev, &vid)))return NULL ; -if (!vid ||br_vlan_get_info (br_dev, vid, &vinfo)) +if (!vid ||br_vlan_get_info (br_dev, vid, &vinfo) || + !(vinfo.flags &BRIDGE_VLAN_INFO_BRENTRY ))return NULL ; edev =br_fdb_find_port (br_dev, dmac, vid);
Signature · 1 line
2.33.1
Re: [PATCH net-next 02/12] mlxsw: spectrum_span: Ignore VLAN entries not used by the bridge in mirroring
Quoted 5 lines · Ido Schimmel
Only VLAN entries installed on the bridge device itself should be considered when checking whether a packet with a specific VLAN can be mirrored via a bridge device. VLAN entries only used to keep context (i.e., entries with '
BRIDGE_VLAN_INFO_BRENTRY' unset) should be ignored.
Quoted 7 lines
Fix this by preventing mirroring when the VLAN entry does not have the '
BRIDGE_VLAN_INFO_BRENTRY' flag set.Fixes ddaff5047003 ("mlxsw: spectrum: remove guards against !BRIDGE_VLAN_INFO_BRENTRY")Signed-off-by Ido Schimmel <[email protected]>Reviewed-by Petr Machata <[email protected]>---
Sorry, I didn't realize br_vlan_get_info() doesn't have a br_vlan_should_use() check. Maybe we should add it, for the same consideration that a !BRENTRY master VLAN is still a data structure private to the bridge, that shouldn't be revealed to other modules?
Anyway, this works too.
Quoted 22 lines
Cc Vladimir Oltean <[email protected]>--- drivers/net/ethernet/mellanox/mlxsw/spectrum_span.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)drivers/net/ethernet/mellanox/mlxsw/spectrum_span.c +2
-1@@ -269,7 +269,8 @@ mlxsw_sp_span_entry_bridge_8021q(const struct net_device *br_dev,if (!vid &&WARN_ON (br_vlan_get_pvid (br_dev, &vid)))return NULL ; -if (!vid ||br_vlan_get_info (br_dev, vid, &vinfo)) +if (!vid ||br_vlan_get_info (br_dev, vid, &vinfo) || + !(vinfo.flags &BRIDGE_VLAN_INFO_BRENTRY ))return NULL ; edev =br_fdb_find_port (br_dev, dmac, vid);Signature · 1 line
2.33.1
Ido Schimmel
maintainerPATCH 3/12 mlxsw: core_thermal: Avoid creation of virtual hwmon objects by thermal module
In reply to Ido SchimmelFrom: Vadim Pasternak <[email protected]>
The driver registers with both the hwmon and thermal subsystems. Therefore, there is no need for the thermal subsystem to automatically create hwmon entries upon registration of a thermal zone, as this results in duplicate information.
Avoid creation of virtual hwmon objects by thermal subsystem by registering a thermal zone with 'no_hwmon' set to 'true'.
--- drivers/net/ethernet/mellanox/mlxsw/core_thermal.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-)
drivers/net/ethernet/mellanox/mlxsw/core_thermal.c +8 -3
@@ -357,6 +357,10 @@ static int mlxsw_thermal_trend_get(struct thermal_zone_device *tzdev,return 0 ; } +static struct thermal_zone_params mlxsw_thermal_params = { + .no_hwmon = true, +}; +static struct thermal_zone_device_ops mlxsw_thermal_ops = { .bind = mlxsw_thermal_bind, .unbind = mlxsw_thermal_unbind,
@@ -678,7 +682,8 @@ mlxsw_thermal_module_tz_init(struct mlxsw_thermal_module *module_tz)MLXSW_THERMAL_TRIP_MASK , module_tz, &mlxsw_thermal_module_ops, -NULL ,0 , + &mlxsw_thermal_params, +0 , module_tz->parent->polling_delay);if (IS_ERR (module_tz->tzdev)) { err =PTR_ERR (module_tz->tzdev);
@@ -808,7 +813,7 @@ mlxsw_thermal_gearbox_tz_init(struct mlxsw_thermal_module *gearbox_tz)MLXSW_THERMAL_TRIP_MASK , gearbox_tz, &mlxsw_thermal_gearbox_ops, -NULL ,0 , + &mlxsw_thermal_params,0 , gearbox_tz->parent->polling_delay);if (IS_ERR (gearbox_tz->tzdev))return PTR_ERR (gearbox_tz->tzdev);
@@ -968,7 +973,7 @@ int mlxsw_thermal_init(struct mlxsw_core *core,MLXSW_THERMAL_TRIP_MASK , thermal, &mlxsw_thermal_ops, -NULL ,0 , + &mlxsw_thermal_params,0 , thermal->polling_delay);if (IS_ERR (thermal->tzdev)) { err =PTR_ERR (thermal->tzdev);
Signature · 1 line
2.33.1
Ido Schimmel
maintainerPATCH 4/12 mlxsw: core_hwmon: Fix variable names for hwmon attributes
In reply to Ido SchimmelFrom: Vadim Pasternak <[email protected]>
Replace all local variables 'mlwsw_hwmon_attr' by 'mlxsw_hwmon_attr'. All variable prefixes should start with 'mlxsw' according to the naming convention, so 'mlwsw' is changed to 'mlxsw'.
--- .../net/ethernet/mellanox/mlxsw/core_hwmon.c | 76 +++++++++---------- 1 file changed, 38 insertions(+), 38 deletions(-)
drivers/net/ethernet/mellanox/mlxsw/core_hwmon.c +38 -38
@@ -57,14 +57,14 @@ static ssize_t mlxsw_hwmon_temp_show(struct device *dev,struct device_attribute *attr, char *buf) { - struct mlxsw_hwmon_attr *mlwsw_hwmon_attr = + struct mlxsw_hwmon_attr *mlxsw_hwmon_attr = container_of(attr, struct mlxsw_hwmon_attr, dev_attr); -struct mlxsw_hwmon *mlxsw_hwmon = mlwsw_hwmon_attr->hwmon; +struct mlxsw_hwmon *mlxsw_hwmon = mlxsw_hwmon_attr->hwmon;char mtmp_pl[MLXSW_REG_MTMP_LEN ];int temp, index;int err; - index =mlxsw_hwmon_get_attr_index (mlwsw_hwmon_attr->type_index, + index =mlxsw_hwmon_get_attr_index (mlxsw_hwmon_attr->type_index, mlxsw_hwmon->module_sensor_max);mlxsw_reg_mtmp_pack (mtmp_pl, index, false, false); err =mlxsw_reg_query (mlxsw_hwmon->core,MLXSW_REG (mtmp), mtmp_pl);
@@ -80,14 +80,14 @@ static ssize_t mlxsw_hwmon_temp_max_show(struct device *dev,struct device_attribute *attr, char *buf) { - struct mlxsw_hwmon_attr *mlwsw_hwmon_attr = + struct mlxsw_hwmon_attr *mlxsw_hwmon_attr = container_of(attr, struct mlxsw_hwmon_attr, dev_attr); -struct mlxsw_hwmon *mlxsw_hwmon = mlwsw_hwmon_attr->hwmon; +struct mlxsw_hwmon *mlxsw_hwmon = mlxsw_hwmon_attr->hwmon;char mtmp_pl[MLXSW_REG_MTMP_LEN ];int temp_max, index;int err; - index =mlxsw_hwmon_get_attr_index (mlwsw_hwmon_attr->type_index, + index =mlxsw_hwmon_get_attr_index (mlxsw_hwmon_attr->type_index, mlxsw_hwmon->module_sensor_max);mlxsw_reg_mtmp_pack (mtmp_pl, index, false, false); err =mlxsw_reg_query (mlxsw_hwmon->core,MLXSW_REG (mtmp), mtmp_pl);
@@ -103,9 +103,9 @@ static ssize_t mlxsw_hwmon_temp_rst_store(struct device *dev,struct device_attribute *attr, const char *buf, size_t len) { - struct mlxsw_hwmon_attr *mlwsw_hwmon_attr = + struct mlxsw_hwmon_attr *mlxsw_hwmon_attr = container_of(attr, struct mlxsw_hwmon_attr, dev_attr); -struct mlxsw_hwmon *mlxsw_hwmon = mlwsw_hwmon_attr->hwmon; +struct mlxsw_hwmon *mlxsw_hwmon = mlxsw_hwmon_attr->hwmon;char mtmp_pl[MLXSW_REG_MTMP_LEN ] = {0 };unsigned long val;int index;
@@ -117,7 +117,7 @@ static ssize_t mlxsw_hwmon_temp_rst_store(struct device *dev,if (val !=1 )return -EINVAL ; - index =mlxsw_hwmon_get_attr_index (mlwsw_hwmon_attr->type_index, + index =mlxsw_hwmon_get_attr_index (mlxsw_hwmon_attr->type_index, mlxsw_hwmon->module_sensor_max);mlxsw_reg_mtmp_sensor_index_set (mtmp_pl, index);
@@ -138,13 +138,13 @@ static ssize_t mlxsw_hwmon_fan_rpm_show(struct device *dev,struct device_attribute *attr, char *buf) { - struct mlxsw_hwmon_attr *mlwsw_hwmon_attr = + struct mlxsw_hwmon_attr *mlxsw_hwmon_attr = container_of(attr, struct mlxsw_hwmon_attr, dev_attr); -struct mlxsw_hwmon *mlxsw_hwmon = mlwsw_hwmon_attr->hwmon; +struct mlxsw_hwmon *mlxsw_hwmon = mlxsw_hwmon_attr->hwmon;char mfsm_pl[MLXSW_REG_MFSM_LEN ];int err; -mlxsw_reg_mfsm_pack (mfsm_pl, mlwsw_hwmon_attr->type_index); +mlxsw_reg_mfsm_pack (mfsm_pl, mlxsw_hwmon_attr->type_index); err =mlxsw_reg_query (mlxsw_hwmon->core,MLXSW_REG (mfsm), mfsm_pl);if (err) {dev_err (mlxsw_hwmon->bus_info->dev,"Failed to query fan\n" );
@@ -157,9 +157,9 @@ static ssize_t mlxsw_hwmon_fan_fault_show(struct device *dev,struct device_attribute *attr, char *buf) { - struct mlxsw_hwmon_attr *mlwsw_hwmon_attr = + struct mlxsw_hwmon_attr *mlxsw_hwmon_attr = container_of(attr, struct mlxsw_hwmon_attr, dev_attr); -struct mlxsw_hwmon *mlxsw_hwmon = mlwsw_hwmon_attr->hwmon; +struct mlxsw_hwmon *mlxsw_hwmon = mlxsw_hwmon_attr->hwmon;char fore_pl[MLXSW_REG_FORE_LEN ];bool fault;int err;
@@ -169,7 +169,7 @@ static ssize_t mlxsw_hwmon_fan_fault_show(struct device *dev,dev_err (mlxsw_hwmon->bus_info->dev,"Failed to query fan\n" );return err; } -mlxsw_reg_fore_unpack (fore_pl, mlwsw_hwmon_attr->type_index, &fault); +mlxsw_reg_fore_unpack (fore_pl, mlxsw_hwmon_attr->type_index, &fault);return sprintf (buf,"%u\n" , fault); }
@@ -178,13 +178,13 @@ static ssize_t mlxsw_hwmon_pwm_show(struct device *dev,struct device_attribute *attr, char *buf) { - struct mlxsw_hwmon_attr *mlwsw_hwmon_attr = + struct mlxsw_hwmon_attr *mlxsw_hwmon_attr = container_of(attr, struct mlxsw_hwmon_attr, dev_attr); -struct mlxsw_hwmon *mlxsw_hwmon = mlwsw_hwmon_attr->hwmon; +struct mlxsw_hwmon *mlxsw_hwmon = mlxsw_hwmon_attr->hwmon;char mfsc_pl[MLXSW_REG_MFSC_LEN ];int err; -mlxsw_reg_mfsc_pack (mfsc_pl, mlwsw_hwmon_attr->type_index,0 ); +mlxsw_reg_mfsc_pack (mfsc_pl, mlxsw_hwmon_attr->type_index,0 ); err =mlxsw_reg_query (mlxsw_hwmon->core,MLXSW_REG (mfsc), mfsc_pl);if (err) {dev_err (mlxsw_hwmon->bus_info->dev,"Failed to query PWM\n" );
@@ -198,9 +198,9 @@ static ssize_t mlxsw_hwmon_pwm_store(struct device *dev,struct device_attribute *attr, const char *buf, size_t len) { - struct mlxsw_hwmon_attr *mlwsw_hwmon_attr = + struct mlxsw_hwmon_attr *mlxsw_hwmon_attr = container_of(attr, struct mlxsw_hwmon_attr, dev_attr); -struct mlxsw_hwmon *mlxsw_hwmon = mlwsw_hwmon_attr->hwmon; +struct mlxsw_hwmon *mlxsw_hwmon = mlxsw_hwmon_attr->hwmon;char mfsc_pl[MLXSW_REG_MFSC_LEN ];unsigned long val;int err;
@@ -211,7 +211,7 @@ static ssize_t mlxsw_hwmon_pwm_store(struct device *dev,if (val >255 )return -EINVAL ; -mlxsw_reg_mfsc_pack (mfsc_pl, mlwsw_hwmon_attr->type_index, val); +mlxsw_reg_mfsc_pack (mfsc_pl, mlxsw_hwmon_attr->type_index, val); err =mlxsw_reg_write (mlxsw_hwmon->core,MLXSW_REG (mfsc), mfsc_pl);if (err) {dev_err (mlxsw_hwmon->bus_info->dev,"Failed to write PWM\n" );
@@ -224,14 +224,14 @@ static int mlxsw_hwmon_module_temp_get(struct device *dev,struct device_attribute *attr, int *p_temp) { - struct mlxsw_hwmon_attr *mlwsw_hwmon_attr = + struct mlxsw_hwmon_attr *mlxsw_hwmon_attr = container_of(attr, struct mlxsw_hwmon_attr, dev_attr); -struct mlxsw_hwmon *mlxsw_hwmon = mlwsw_hwmon_attr->hwmon; +struct mlxsw_hwmon *mlxsw_hwmon = mlxsw_hwmon_attr->hwmon;char mtmp_pl[MLXSW_REG_MTMP_LEN ];u8 module;int err; - module = mlwsw_hwmon_attr->type_index - mlxsw_hwmon->sensor_count; + module = mlxsw_hwmon_attr->type_index - mlxsw_hwmon->sensor_count;mlxsw_reg_mtmp_pack (mtmp_pl,MLXSW_REG_MTMP_MODULE_INDEX_MIN + module, false, false); err =mlxsw_reg_query (mlxsw_hwmon->core,MLXSW_REG (mtmp), mtmp_pl);
@@ -261,15 +261,15 @@ static ssize_t mlxsw_hwmon_module_temp_fault_show(struct device *dev,struct device_attribute *attr, char *buf) { - struct mlxsw_hwmon_attr *mlwsw_hwmon_attr = + struct mlxsw_hwmon_attr *mlxsw_hwmon_attr = container_of(attr, struct mlxsw_hwmon_attr, dev_attr); -struct mlxsw_hwmon *mlxsw_hwmon = mlwsw_hwmon_attr->hwmon; +struct mlxsw_hwmon *mlxsw_hwmon = mlxsw_hwmon_attr->hwmon;char mtbr_pl[MLXSW_REG_MTBR_LEN ] = {0 };u8 module, fault;u16 temp;int err; - module = mlwsw_hwmon_attr->type_index - mlxsw_hwmon->sensor_count; + module = mlxsw_hwmon_attr->type_index - mlxsw_hwmon->sensor_count;mlxsw_reg_mtbr_pack (mtbr_pl,MLXSW_REG_MTBR_BASE_MODULE_INDEX + module,1 ); err =mlxsw_reg_query (mlxsw_hwmon->core,MLXSW_REG (mtbr), mtbr_pl);
@@ -303,13 +303,13 @@ static int mlxsw_hwmon_module_temp_critical_get(struct device *dev,struct device_attribute *attr, int *p_temp) { - struct mlxsw_hwmon_attr *mlwsw_hwmon_attr = + struct mlxsw_hwmon_attr *mlxsw_hwmon_attr = container_of(attr, struct mlxsw_hwmon_attr, dev_attr); -struct mlxsw_hwmon *mlxsw_hwmon = mlwsw_hwmon_attr->hwmon; +struct mlxsw_hwmon *mlxsw_hwmon = mlxsw_hwmon_attr->hwmon;u8 module;int err; - module = mlwsw_hwmon_attr->type_index - mlxsw_hwmon->sensor_count; + module = mlxsw_hwmon_attr->type_index - mlxsw_hwmon->sensor_count; err =mlxsw_env_module_temp_thresholds_get (mlxsw_hwmon->core, module,SFP_TEMP_HIGH_WARN , p_temp);if (err) {
@@ -337,13 +337,13 @@ static int mlxsw_hwmon_module_temp_emergency_get(struct device *dev,struct device_attribute *attr, int *p_temp) { - struct mlxsw_hwmon_attr *mlwsw_hwmon_attr = + struct mlxsw_hwmon_attr *mlxsw_hwmon_attr = container_of(attr, struct mlxsw_hwmon_attr, dev_attr); -struct mlxsw_hwmon *mlxsw_hwmon = mlwsw_hwmon_attr->hwmon; +struct mlxsw_hwmon *mlxsw_hwmon = mlxsw_hwmon_attr->hwmon;u8 module;int err; - module = mlwsw_hwmon_attr->type_index - mlxsw_hwmon->sensor_count; + module = mlxsw_hwmon_attr->type_index - mlxsw_hwmon->sensor_count; err =mlxsw_env_module_temp_thresholds_get (mlxsw_hwmon->core, module,SFP_TEMP_HIGH_ALARM , p_temp);if (err) {
@@ -373,11 +373,11 @@ mlxsw_hwmon_module_temp_label_show(struct device *dev,struct device_attribute *attr, char *buf) { - struct mlxsw_hwmon_attr *mlwsw_hwmon_attr = + struct mlxsw_hwmon_attr *mlxsw_hwmon_attr = container_of(attr, struct mlxsw_hwmon_attr, dev_attr);return sprintf (buf,"front panel %03u\n" , - mlwsw_hwmon_attr->type_index); + mlxsw_hwmon_attr->type_index); } static ssize_t
@@ -385,10 +385,10 @@ mlxsw_hwmon_gbox_temp_label_show(struct device *dev,struct device_attribute *attr, char *buf) { - struct mlxsw_hwmon_attr *mlwsw_hwmon_attr = + struct mlxsw_hwmon_attr *mlxsw_hwmon_attr = container_of(attr, struct mlxsw_hwmon_attr, dev_attr); -struct mlxsw_hwmon *mlxsw_hwmon = mlwsw_hwmon_attr->hwmon; -int index = mlwsw_hwmon_attr->type_index - +struct mlxsw_hwmon *mlxsw_hwmon = mlxsw_hwmon_attr->hwmon; +int index = mlxsw_hwmon_attr->type_index - mlxsw_hwmon->module_sensor_max +1 ;return sprintf (buf,"gearbox %03u\n" , index);
Signature · 1 line
2.33.1
Ido Schimmel
maintainerPATCH 5/12 mlxsw: core_thermal: Rename labels according to naming convention
In reply to Ido SchimmelFrom: Vadim Pasternak <[email protected]>
Rename labels for error flow handling in order to align with naming convention used in rest of 'mlxsw' code.
--- .../ethernet/mellanox/mlxsw/core_thermal.c | 43 ++++++++++--------- 1 file changed, 23 insertions(+), 20 deletions(-)
drivers/net/ethernet/mellanox/mlxsw/core_thermal.c +23 -20
@@ -392,11 +392,11 @@ static int mlxsw_thermal_module_bind(struct thermal_zone_device *tzdev, trip->min_state, THERMAL_WEIGHT_DEFAULT);if (err <0 ) - goto err_bind_cooling_device; + goto err_thermal_zone_bind_cooling_device; }return 0 ; -err_bind_cooling_device: +err_thermal_zone_bind_cooling_device:for (j = i -1 ; j >=0 ; j--)thermal_zone_unbind_cooling_device (tzdev, j, cdev);return err;
@@ -766,7 +766,7 @@ mlxsw_thermal_modules_init(struct device *dev, struct mlxsw_core *core,for (i =0 ; i < thermal->tz_module_num; i++) { err =mlxsw_thermal_module_init (dev, core, thermal, i);if (err) - goto err_unreg_tz_module_arr; + goto err_thermal_module_init; }for (i =0 ; i < thermal->tz_module_num; i++) {
@@ -775,12 +775,13 @@ mlxsw_thermal_modules_init(struct device *dev, struct mlxsw_core *core,continue ; err =mlxsw_thermal_module_tz_init (module_tz);if (err) - goto err_unreg_tz_module_arr; + goto err_thermal_module_tz_init; }return 0 ; -err_unreg_tz_module_arr: +err_thermal_module_tz_init: +err_thermal_module_init:for (i = thermal->tz_module_num -1 ; i >=0 ; i--)mlxsw_thermal_module_fini (&thermal->tz_module_arr[i]);kfree (thermal->tz_module_arr);
@@ -871,12 +872,12 @@ mlxsw_thermal_gearboxes_init(struct device *dev, struct mlxsw_core *core, gearbox_tz->parent = thermal; err =mlxsw_thermal_gearbox_tz_init (gearbox_tz);if (err) - goto err_unreg_tz_gearbox; + goto err_thermal_gearbox_tz_init; }return 0 ; -err_unreg_tz_gearbox: +err_thermal_gearbox_tz_init:for (i--; i >=0 ; i--)mlxsw_thermal_gearbox_tz_fini (&thermal->tz_gearbox_arr[i]);kfree (thermal->tz_gearbox_arr);
@@ -920,7 +921,7 @@ int mlxsw_thermal_init(struct mlxsw_core *core, err =mlxsw_reg_query (thermal->core,MLXSW_REG (mfcr), mfcr_pl);if (err) {dev_err (dev,"Failed to probe PWMs\n" ); - goto err_free_thermal; + goto err_reg_query; }mlxsw_reg_mfcr_unpack (mfcr_pl, &freq, &tacho_active, &pwm_active);
@@ -934,14 +935,14 @@ int mlxsw_thermal_init(struct mlxsw_core *core, err =mlxsw_reg_query (thermal->core,MLXSW_REG (mfsl), mfsl_pl);if (err) - goto err_free_thermal; + goto err_reg_query;/* set the minimal RPMs to 0 */ mlxsw_reg_mfsl_tach_min_set (mfsl_pl,0 ); err =mlxsw_reg_write (thermal->core,MLXSW_REG (mfsl), mfsl_pl);if (err) - goto err_free_thermal; + goto err_reg_write; } }for (i =0 ; i <MLXSW_MFCR_PWMS_MAX ; i++) {
@@ -954,7 +955,7 @@ int mlxsw_thermal_init(struct mlxsw_core *core,if (IS_ERR (cdev)) { err =PTR_ERR (cdev);dev_err (dev,"Failed to register cooling device\n" ); - goto err_unreg_cdevs; + goto err_thermal_cooling_device_register; } thermal->cdevs[i] = cdev; }
@@ -978,38 +979,40 @@ int mlxsw_thermal_init(struct mlxsw_core *core,if (IS_ERR (thermal->tzdev)) { err =PTR_ERR (thermal->tzdev);dev_err (dev,"Failed to register thermal zone\n" ); - goto err_unreg_cdevs; + goto err_thermal_zone_device_register; } err =mlxsw_thermal_modules_init (dev, core, thermal);if (err) - goto err_unreg_tzdev; + goto err_thermal_modules_init; err =mlxsw_thermal_gearboxes_init (dev, core, thermal);if (err) - goto err_unreg_modules_tzdev; + goto err_thermal_gearboxes_init; err =thermal_zone_device_enable (thermal->tzdev);if (err) - goto err_unreg_gearboxes; + goto err_thermal_zone_device_enable; *p_thermal = thermal;return 0 ; -err_unreg_gearboxes: +err_thermal_zone_device_enable:mlxsw_thermal_gearboxes_fini (thermal); -err_unreg_modules_tzdev: +err_thermal_gearboxes_init:mlxsw_thermal_modules_fini (thermal); -err_unreg_tzdev: +err_thermal_modules_init:if (thermal->tzdev) {thermal_zone_device_unregister (thermal->tzdev); thermal->tzdev =NULL ; } -err_unreg_cdevs: +err_thermal_zone_device_register: +err_thermal_cooling_device_register:for (i =0 ; i <MLXSW_MFCR_PWMS_MAX ; i++)if (thermal->cdevs[i])thermal_cooling_device_unregister (thermal->cdevs[i]); -err_free_thermal: +err_reg_write: +err_reg_query:devm_kfree (dev, thermal);return err; }
Signature · 1 line
2.33.1
Ido Schimmel
maintainerPATCH 6/12 mlxsw: core_thermal: Remove obsolete API for query resource
In reply to Ido SchimmelFrom: Vadim Pasternak <[email protected]>
Remove obsolete API mlxsw_core_res_query_enabled(), which is only relevant for end-of-life SwitchX-2 ASICs. Support for these ASICs was removed in commit b0d80c013b04 ("mlxsw: Remove Mellanox SwitchX-2 ASIC support").
--- drivers/net/ethernet/mellanox/mlxsw/core.c | 6 ------ drivers/net/ethernet/mellanox/mlxsw/core.h | 2 -- drivers/net/ethernet/mellanox/mlxsw/core_hwmon.c | 3 --- drivers/net/ethernet/mellanox/mlxsw/core_thermal.c | 12 ------------ 4 files changed, 23 deletions(-)
drivers/net/ethernet/mellanox/mlxsw/core.c +0 -6
@@ -177,12 +177,6 @@ void *mlxsw_core_driver_priv(struct mlxsw_core *mlxsw_core) }EXPORT_SYMBOL (mlxsw_core_driver_priv); -bool mlxsw_core_res_query_enabled (const struct mlxsw_core *mlxsw_core) -{ -return mlxsw_core->driver->res_query_enabled; -} -EXPORT_SYMBOL (mlxsw_core_res_query_enabled); -bool mlxsw_core_temp_warn_enabled (const struct mlxsw_core *mlxsw_core) {return mlxsw_core->driver->temp_warn_enabled;
drivers/net/ethernet/mellanox/mlxsw/core.h +0 -2
@@ -35,8 +35,6 @@ unsigned int mlxsw_core_max_ports(const struct mlxsw_core *mlxsw_core);void *mlxsw_core_driver_priv (struct mlxsw_core *mlxsw_core); -bool mlxsw_core_res_query_enabled (const struct mlxsw_core *mlxsw_core); -bool mlxsw_core_temp_warn_enabled (const struct mlxsw_core *mlxsw_core);bool
drivers/net/ethernet/mellanox/mlxsw/core_hwmon.c +0 -3
@@ -655,9 +655,6 @@ static int mlxsw_hwmon_module_init(struct mlxsw_hwmon *mlxsw_hwmon)u8 module_sensor_max;int i, err; -if (!mlxsw_core_res_query_enabled (mlxsw_hwmon->core)) -return 0 ; -mlxsw_reg_mgpir_pack (mgpir_pl); err =mlxsw_reg_query (mlxsw_hwmon->core,MLXSW_REG (mgpir), mgpir_pl);if (err)
drivers/net/ethernet/mellanox/mlxsw/core_thermal.c +0 -12
@@ -746,9 +746,6 @@ mlxsw_thermal_modules_init(struct device *dev, struct mlxsw_core *core,char mgpir_pl[MLXSW_REG_MGPIR_LEN ];int i, err; -if (!mlxsw_core_res_query_enabled (core)) -return 0 ; -mlxsw_reg_mgpir_pack (mgpir_pl); err =mlxsw_reg_query (core,MLXSW_REG (mgpir), mgpir_pl);if (err)
@@ -793,9 +790,6 @@ mlxsw_thermal_modules_fini(struct mlxsw_thermal *thermal) {int i; -if (!mlxsw_core_res_query_enabled (thermal->core)) -return ; -for (i = thermal->tz_module_num -1 ; i >=0 ; i--)mlxsw_thermal_module_fini (&thermal->tz_module_arr[i]);kfree (thermal->tz_module_arr);
@@ -843,9 +837,6 @@ mlxsw_thermal_gearboxes_init(struct device *dev, struct mlxsw_core *core,int i;int err; -if (!mlxsw_core_res_query_enabled (core)) -return 0 ; -mlxsw_reg_mgpir_pack (mgpir_pl); err =mlxsw_reg_query (core,MLXSW_REG (mgpir), mgpir_pl);if (err)
@@ -889,9 +880,6 @@ mlxsw_thermal_gearboxes_fini(struct mlxsw_thermal *thermal) {int i; -if (!mlxsw_core_res_query_enabled (thermal->core)) -return ; -for (i = thermal->tz_gearbox_num -1 ; i >=0 ; i--)mlxsw_thermal_gearbox_tz_fini (&thermal->tz_gearbox_arr[i]);kfree (thermal->tz_gearbox_arr);
Signature · 1 line
2.33.1
Ido Schimmel
maintainerPATCH 7/12 mlxsw: reg: Add "mgpir_" prefix to MGPIR fields comments
In reply to Ido SchimmelFrom: Vadim Pasternak <[email protected]>
Do the same as for other registers and have "mgpir_" prefix for the MGPIR fields.
--- drivers/net/ethernet/mellanox/mlxsw/reg.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/net/ethernet/mellanox/mlxsw/reg.h +4 -4
@@ -11323,24 +11323,24 @@ enum mlxsw_reg_mgpir_device_type { MLXSW_REG_MGPIR_DEVICE_TYPE_GEARBOX_DIE, }; -/* device_type +/* mgpir_device_type * Access: RO */ MLXSW_ITEM32 (reg, mgpir, device_type,0x00 ,24 ,4 ); -/* devices_per_flash +/* mgpir_devices_per_flash * Number of devices of device_type per flash (can be shared by few devices). * Access: RO */ MLXSW_ITEM32 (reg, mgpir, devices_per_flash,0x00 ,16 ,8 ); -/* num_of_devices +/* mgpir_num_of_devices * Number of devices of device_type. * Access: RO */ MLXSW_ITEM32 (reg, mgpir, num_of_devices,0x00 ,0 ,8 ); -/* num_of_modules +/* mgpir_num_of_modules * Number of modules. * Access: RO */
Signature · 1 line
2.33.1
Ido Schimmel
maintainerPATCH 8/12 mlxsw: core: Remove unnecessary asserts
In reply to Ido SchimmelFrom: Vadim Pasternak <[email protected]>
Remove unnecessary asserts for module index validation. Leave only one that is actually necessary in mlxsw_env_pmpe_listener_func() where the module index is directly read from the firmware event.
--- .../net/ethernet/mellanox/mlxsw/core_env.c | 24 ------------------- 1 file changed, 24 deletions(-)
drivers/net/ethernet/mellanox/mlxsw/core_env.c +0 -24
@@ -462,9 +462,6 @@ int mlxsw_env_reset_module(struct net_device *netdev, !(req & (ETH_RESET_PHY << ETH_RESET_SHARED_SHIFT)))return 0 ; -if (WARN_ON_ONCE (module >= mlxsw_env->module_count)) -return -EINVAL ; -mutex_lock (&mlxsw_env->module_info_lock); err =__mlxsw_env_validate_module_type (mlxsw_core, module);
@@ -510,9 +507,6 @@ mlxsw_env_get_module_power_mode(struct mlxsw_core *mlxsw_core, u8 module,u32 status_bits;int err; -if (WARN_ON_ONCE (module >= mlxsw_env->module_count)) -return -EINVAL ; -mutex_lock (&mlxsw_env->module_info_lock); err =__mlxsw_env_validate_module_type (mlxsw_core, module);
@@ -620,9 +614,6 @@ mlxsw_env_set_module_power_mode(struct mlxsw_core *mlxsw_core, u8 module,bool low_power;int err =0 ; -if (WARN_ON_ONCE (module >= mlxsw_env->module_count)) -return -EINVAL ; -if (policy !=ETHTOOL_MODULE_POWER_MODE_POLICY_HIGH && policy !=ETHTOOL_MODULE_POWER_MODE_POLICY_AUTO ) {NL_SET_ERR_MSG_MOD (extack,"Unsupported power mode policy" );
@@ -966,9 +957,6 @@ mlxsw_env_module_overheat_counter_get(struct mlxsw_core *mlxsw_core, u8 module, {struct mlxsw_env *mlxsw_env =mlxsw_core_env (mlxsw_core); -if (WARN_ON_ONCE (module >= mlxsw_env->module_count)) -return -EINVAL ; -mutex_lock (&mlxsw_env->module_info_lock); *p_counter = mlxsw_env->module_info[module].module_overheat_counter;mutex_unlock (&mlxsw_env->module_info_lock);
@@ -981,9 +969,6 @@ void mlxsw_env_module_port_map(struct mlxsw_core *mlxsw_core, u8 module) {struct mlxsw_env *mlxsw_env =mlxsw_core_env (mlxsw_core); -if (WARN_ON_ONCE (module >= mlxsw_env->module_count)) -return ; -mutex_lock (&mlxsw_env->module_info_lock); mlxsw_env->module_info[module].num_ports_mapped++;mutex_unlock (&mlxsw_env->module_info_lock);
@@ -994,9 +979,6 @@ void mlxsw_env_module_port_unmap(struct mlxsw_core *mlxsw_core, u8 module) {struct mlxsw_env *mlxsw_env =mlxsw_core_env (mlxsw_core); -if (WARN_ON_ONCE (module >= mlxsw_env->module_count)) -return ; -mutex_lock (&mlxsw_env->module_info_lock); mlxsw_env->module_info[module].num_ports_mapped--;mutex_unlock (&mlxsw_env->module_info_lock);
@@ -1008,9 +990,6 @@ int mlxsw_env_module_port_up(struct mlxsw_core *mlxsw_core, u8 module)struct mlxsw_env *mlxsw_env =mlxsw_core_env (mlxsw_core);int err =0 ; -if (WARN_ON_ONCE (module >= mlxsw_env->module_count)) -return -EINVAL ; -mutex_lock (&mlxsw_env->module_info_lock); if (mlxsw_env->module_info[module].power_mode_policy !=
@@ -1040,9 +1019,6 @@ void mlxsw_env_module_port_down(struct mlxsw_core *mlxsw_core, u8 module) {struct mlxsw_env *mlxsw_env =mlxsw_core_env (mlxsw_core); -if (WARN_ON_ONCE (module >= mlxsw_env->module_count)) -return ; -mutex_lock (&mlxsw_env->module_info_lock); mlxsw_env->module_info[module].num_ports_up--;
Signature · 1 line
2.33.1
Ido Schimmel
maintainerPATCH 9/12 mlxsw: spectrum: Remove SP{1,2,3} defines for FW minor and subminor
In reply to Ido SchimmelFrom: Jiri Pirko <[email protected]>
The FW minor and subminor versions are the same for all generations of Spectrum ASICs. Unify them into a single set of defines.
--- .../net/ethernet/mellanox/mlxsw/spectrum.c | 33 +++++++++---------- 1 file changed, 15 insertions(+), 18 deletions(-)
drivers/net/ethernet/mellanox/mlxsw/spectrum.c +15 -18
@@ -45,52 +45,49 @@#include "spectrum_ptp.h" #include "spectrum_trap.h" +#define MLXSW_SP_FWREV_MINOR 2010 +#define MLXSW_SP_FWREV_SUBMINOR 1006 +#define MLXSW_SP1_FWREV_MAJOR 13 -#define MLXSW_SP1_FWREV_MINOR 2010 -#define MLXSW_SP1_FWREV_SUBMINOR 1006#define MLXSW_SP1_FWREV_CAN_RESET_MINOR 1702static const struct mlxsw_fw_rev mlxsw_sp1_fw_rev = { .major =MLXSW_SP1_FWREV_MAJOR , - .minor =MLXSW_SP1_FWREV_MINOR , - .subminor =MLXSW_SP1_FWREV_SUBMINOR , + .minor =MLXSW_SP_FWREV_MINOR , + .subminor =MLXSW_SP_FWREV_SUBMINOR , .can_reset_minor =MLXSW_SP1_FWREV_CAN_RESET_MINOR , };#define MLXSW_SP1_FW_FILENAME \ "mellanox/mlxsw_spectrum-" __stringify(MLXSW_SP1_FWREV_MAJOR) \ - "." __stringify(MLXSW_SP1_FWREV_MINOR) \ - "." __stringify(MLXSW_SP1_FWREV_SUBMINOR) ".mfa2" + "." __stringify(MLXSW_SP_FWREV_MINOR) \ + "." __stringify(MLXSW_SP_FWREV_SUBMINOR) ".mfa2"#define MLXSW_SP2_FWREV_MAJOR 29 -#define MLXSW_SP2_FWREV_MINOR 2010 -#define MLXSW_SP2_FWREV_SUBMINOR 1006static const struct mlxsw_fw_rev mlxsw_sp2_fw_rev = { .major =MLXSW_SP2_FWREV_MAJOR , - .minor =MLXSW_SP2_FWREV_MINOR , - .subminor =MLXSW_SP2_FWREV_SUBMINOR , + .minor =MLXSW_SP_FWREV_MINOR , + .subminor =MLXSW_SP_FWREV_SUBMINOR , };#define MLXSW_SP2_FW_FILENAME \ "mellanox/mlxsw_spectrum2-" __stringify(MLXSW_SP2_FWREV_MAJOR) \ - "." __stringify(MLXSW_SP2_FWREV_MINOR) \ - "." __stringify(MLXSW_SP2_FWREV_SUBMINOR) ".mfa2" + "." __stringify(MLXSW_SP_FWREV_MINOR) \ + "." __stringify(MLXSW_SP_FWREV_SUBMINOR) ".mfa2"#define MLXSW_SP3_FWREV_MAJOR 30 -#define MLXSW_SP3_FWREV_MINOR 2010 -#define MLXSW_SP3_FWREV_SUBMINOR 1006static const struct mlxsw_fw_rev mlxsw_sp3_fw_rev = { .major =MLXSW_SP3_FWREV_MAJOR , - .minor =MLXSW_SP3_FWREV_MINOR , - .subminor =MLXSW_SP3_FWREV_SUBMINOR , + .minor =MLXSW_SP_FWREV_MINOR , + .subminor =MLXSW_SP_FWREV_SUBMINOR , };#define MLXSW_SP3_FW_FILENAME \ "mellanox/mlxsw_spectrum3-" __stringify(MLXSW_SP3_FWREV_MAJOR) \ - "." __stringify(MLXSW_SP3_FWREV_MINOR) \ - "." __stringify(MLXSW_SP3_FWREV_SUBMINOR) ".mfa2" + "." __stringify(MLXSW_SP_FWREV_MINOR) \ + "." __stringify(MLXSW_SP_FWREV_SUBMINOR) ".mfa2"static const char mlxsw_sp1_driver_name[] ="mlxsw_spectrum" ;static const char mlxsw_sp2_driver_name[] ="mlxsw_spectrum2" ;
Signature · 1 line
2.33.1
Ido Schimmel
maintainerPATCH 10/12 mlxsw: core: Unify method of trap support validation
In reply to Ido SchimmelFrom: Vadim Pasternak <[email protected]>
Currently there are several different features defined in 'mlxsw_driver' for trap support validation. There is no reason to have dedicated features for specific traps. Perform validation of all of them by testing feature 'MLXSW_BUS_F_TXRX'.
Remove trap capability validation from 'core_env.c' which is redundant after validation has been added to mlxsw_core_trap_register().
--- drivers/net/ethernet/mellanox/mlxsw/core.c | 9 ++------- drivers/net/ethernet/mellanox/mlxsw/core.h | 4 ---- drivers/net/ethernet/mellanox/mlxsw/core_env.c | 12 ------------ drivers/net/ethernet/mellanox/mlxsw/spectrum.c | 8 -------- 4 files changed, 2 insertions(+), 31 deletions(-)
drivers/net/ethernet/mellanox/mlxsw/core.c +2 -7
@@ -177,11 +177,6 @@ void *mlxsw_core_driver_priv(struct mlxsw_core *mlxsw_core) }EXPORT_SYMBOL (mlxsw_core_driver_priv); -bool mlxsw_core_temp_warn_enabled (const struct mlxsw_core *mlxsw_core) -{ -return mlxsw_core->driver->temp_warn_enabled; -} -bool mlxsw_core_fw_rev_minor_subminor_validate (const struct mlxsw_fw_rev *rev,const struct mlxsw_fw_rev *req_rev)
@@ -2033,7 +2028,7 @@ static int mlxsw_core_health_init(struct mlxsw_core *mlxsw_core)struct devlink_health_reporter *fw_fatal;int err; -if (!mlxsw_core->driver->fw_fatal_enabled) +if (!(mlxsw_core->bus->features &MLXSW_BUS_F_TXRX ))return 0 ; fw_fatal = devlink_health_reporter_create(devlink, &mlxsw_core_health_fw_fatal_ops,
@@ -2063,7 +2058,7 @@ static int mlxsw_core_health_init(struct mlxsw_core *mlxsw_core)static void mlxsw_core_health_fini (struct mlxsw_core *mlxsw_core) { -if (!mlxsw_core->driver->fw_fatal_enabled) +if (!(mlxsw_core->bus->features &MLXSW_BUS_F_TXRX ))return ;mlxsw_core_health_fw_fatal_config (mlxsw_core, false);
drivers/net/ethernet/mellanox/mlxsw/core.h +0 -4
@@ -35,8 +35,6 @@ unsigned int mlxsw_core_max_ports(const struct mlxsw_core *mlxsw_core);void *mlxsw_core_driver_priv (struct mlxsw_core *mlxsw_core); -bool mlxsw_core_temp_warn_enabled (const struct mlxsw_core *mlxsw_core); -bool mlxsw_core_fw_rev_minor_subminor_validate (const struct mlxsw_fw_rev *rev,const struct mlxsw_fw_rev *req_rev);
@@ -405,8 +403,6 @@ struct mlxsw_driver {u8 txhdr_len;const struct mlxsw_config_profile *profile;bool res_query_enabled; -bool fw_fatal_enabled; -bool temp_warn_enabled; }; int mlxsw_core_kvd_sizes_get(struct mlxsw_core *mlxsw_core,
drivers/net/ethernet/mellanox/mlxsw/core_env.c +0 -12
@@ -822,9 +822,6 @@ static int mlxsw_env_temp_warn_event_register(struct mlxsw_core *mlxsw_core) {struct mlxsw_env *mlxsw_env =mlxsw_core_env (mlxsw_core); -if (!mlxsw_core_temp_warn_enabled (mlxsw_core)) -return 0 ; -return mlxsw_core_trap_register (mlxsw_core, &mlxsw_env_temp_warn_listener, mlxsw_env);
@@ -832,9 +829,6 @@ static int mlxsw_env_temp_warn_event_register(struct mlxsw_core *mlxsw_core)static void mlxsw_env_temp_warn_event_unregister (struct mlxsw_env *mlxsw_env) { -if (!mlxsw_core_temp_warn_enabled (mlxsw_env->core)) -return ; -mlxsw_core_trap_unregister (mlxsw_env->core, &mlxsw_env_temp_warn_listener, mlxsw_env); }
@@ -913,9 +907,6 @@ mlxsw_env_module_plug_event_register(struct mlxsw_core *mlxsw_core) {struct mlxsw_env *mlxsw_env =mlxsw_core_env (mlxsw_core); -if (!mlxsw_core_temp_warn_enabled (mlxsw_core)) -return 0 ; -return mlxsw_core_trap_register (mlxsw_core, &mlxsw_env_module_plug_listener, mlxsw_env);
@@ -924,9 +915,6 @@ mlxsw_env_module_plug_event_register(struct mlxsw_core *mlxsw_core)static void mlxsw_env_module_plug_event_unregister (struct mlxsw_env *mlxsw_env) { -if (!mlxsw_core_temp_warn_enabled (mlxsw_env->core)) -return ; -mlxsw_core_trap_unregister (mlxsw_env->core, &mlxsw_env_module_plug_listener, mlxsw_env);
drivers/net/ethernet/mellanox/mlxsw/spectrum.c +0 -8
@@ -3628,8 +3628,6 @@ static struct mlxsw_driver mlxsw_sp1_driver = { .txhdr_len = MLXSW_TXHDR_LEN, .profile = &mlxsw_sp1_config_profile, .res_query_enabled = true, - .fw_fatal_enabled = true, - .temp_warn_enabled = true, };static struct mlxsw_driver mlxsw_sp2_driver = {
@@ -3668,8 +3666,6 @@ static struct mlxsw_driver mlxsw_sp2_driver = { .txhdr_len = MLXSW_TXHDR_LEN, .profile = &mlxsw_sp2_config_profile, .res_query_enabled = true, - .fw_fatal_enabled = true, - .temp_warn_enabled = true, };static struct mlxsw_driver mlxsw_sp3_driver = {
@@ -3708,8 +3704,6 @@ static struct mlxsw_driver mlxsw_sp3_driver = { .txhdr_len = MLXSW_TXHDR_LEN, .profile = &mlxsw_sp2_config_profile, .res_query_enabled = true, - .fw_fatal_enabled = true, - .temp_warn_enabled = true, };static struct mlxsw_driver mlxsw_sp4_driver = {
@@ -3746,8 +3740,6 @@ static struct mlxsw_driver mlxsw_sp4_driver = { .txhdr_len = MLXSW_TXHDR_LEN, .profile = &mlxsw_sp2_config_profile, .res_query_enabled = true, - .fw_fatal_enabled = true, - .temp_warn_enabled = true, };bool mlxsw_sp_port_dev_check (const struct net_device *dev)
Signature · 1 line
2.33.1
Ido Schimmel
maintainerPATCH 11/12 mlxsw: Remove resource query check
In reply to Ido SchimmelSince SwitchX-2 support was removed in commit b0d80c013b04 ("mlxsw:
Remove Mellanox SwitchX-2 ASIC support"), all the ASICs supported by mlxsw support the resource query command.
Therefore, remove the resource query check and always query resources from the device.
--- drivers/net/ethernet/mellanox/mlxsw/core.c | 8 ++------ drivers/net/ethernet/mellanox/mlxsw/core.h | 1 - drivers/net/ethernet/mellanox/mlxsw/minimal.c | 1 - drivers/net/ethernet/mellanox/mlxsw/spectrum.c | 4 ---- 4 files changed, 2 insertions(+), 12 deletions(-)
drivers/net/ethernet/mellanox/mlxsw/core.c +2 -6
@@ -2078,7 +2078,6 @@ __mlxsw_core_bus_device_register(const struct mlxsw_bus_info *mlxsw_bus_info,const char *device_kind = mlxsw_bus_info->device_kind;struct mlxsw_core *mlxsw_core;struct mlxsw_driver *mlxsw_driver; -struct mlxsw_res *res;size_t alloc_size;int err;
@@ -2104,8 +2103,8 @@ __mlxsw_core_bus_device_register(const struct mlxsw_bus_info *mlxsw_bus_info, mlxsw_core->bus_priv = bus_priv; mlxsw_core->bus_info = mlxsw_bus_info; - res = mlxsw_driver->res_query_enabled ? &mlxsw_core->res :NULL ; - err = mlxsw_bus->init (bus_priv, mlxsw_core, mlxsw_driver->profile, res); + err = mlxsw_bus->init (bus_priv, mlxsw_core, mlxsw_driver->profile, + &mlxsw_core->res);if (err) goto err_bus_init;
@@ -3240,9 +3239,6 @@ int mlxsw_core_resources_query(struct mlxsw_core *mlxsw_core, char *mbox,u16 id;int err; -if (!res) -return 0 ; -mlxsw_cmd_mbox_zero (mbox); for (index = 0; index < MLXSW_CMD_QUERY_RESOURCES_MAX_QUERIES;
drivers/net/ethernet/mellanox/mlxsw/core.h +0 -1
@@ -402,7 +402,6 @@ struct mlxsw_driver {u8 txhdr_len;const struct mlxsw_config_profile *profile; -bool res_query_enabled; }; int mlxsw_core_kvd_sizes_get(struct mlxsw_core *mlxsw_core,
drivers/net/ethernet/mellanox/mlxsw/minimal.c +0 -1
@@ -461,7 +461,6 @@ static struct mlxsw_driver mlxsw_m_driver = { .init = mlxsw_m_init, .fini = mlxsw_m_fini, .profile = &mlxsw_m_config_profile, - .res_query_enabled = true, };static const struct i2c_device_id mlxsw_m_i2c_id[] = {
drivers/net/ethernet/mellanox/mlxsw/spectrum.c +0 -4
@@ -3627,7 +3627,6 @@ static struct mlxsw_driver mlxsw_sp1_driver = { .ptp_transmitted = mlxsw_sp_ptp_transmitted, .txhdr_len = MLXSW_TXHDR_LEN, .profile = &mlxsw_sp1_config_profile, - .res_query_enabled = true, };static struct mlxsw_driver mlxsw_sp2_driver = {
@@ -3665,7 +3664,6 @@ static struct mlxsw_driver mlxsw_sp2_driver = { .ptp_transmitted = mlxsw_sp_ptp_transmitted, .txhdr_len = MLXSW_TXHDR_LEN, .profile = &mlxsw_sp2_config_profile, - .res_query_enabled = true, };static struct mlxsw_driver mlxsw_sp3_driver = {
@@ -3703,7 +3701,6 @@ static struct mlxsw_driver mlxsw_sp3_driver = { .ptp_transmitted = mlxsw_sp_ptp_transmitted, .txhdr_len = MLXSW_TXHDR_LEN, .profile = &mlxsw_sp2_config_profile, - .res_query_enabled = true, };static struct mlxsw_driver mlxsw_sp4_driver = {
@@ -3739,7 +3736,6 @@ static struct mlxsw_driver mlxsw_sp4_driver = { .ptp_transmitted = mlxsw_sp_ptp_transmitted, .txhdr_len = MLXSW_TXHDR_LEN, .profile = &mlxsw_sp2_config_profile, - .res_query_enabled = true, };bool mlxsw_sp_port_dev_check (const struct net_device *dev)
Signature · 1 line
2.33.1
Ido Schimmel
maintainerPATCH 12/12 mlxsw: core: Add support for OSFP transceiver modules
In reply to Ido SchimmelFrom: Danielle Ratson <[email protected]>
The driver can already dump the EEPROM contents of QSFP-DD transceiver modules via its ethtool_ops::get_module_info() and ethtool_ops::get_module_eeprom() callbacks.
Add support for OSFP transceiver modules by adding their SFF-8024 Identifier Value (0x19).
This is required for future NVIDIA Spectrum-4 based systems that will be equipped with OSFP transceivers.
--- drivers/net/ethernet/mellanox/mlxsw/core_env.c | 2 ++ drivers/net/ethernet/mellanox/mlxsw/reg.h | 1 + 2 files changed, 3 insertions(+)
drivers/net/ethernet/mellanox/mlxsw/core_env.c +2 -0
@@ -87,6 +87,7 @@ mlxsw_env_validate_cable_ident(struct mlxsw_core *core, int id, bool *qsfp, *qsfp = true;break ;case MLXSW_REG_MCIA_EEPROM_MODULE_INFO_ID_QSFP_DD : +case MLXSW_REG_MCIA_EEPROM_MODULE_INFO_ID_OSFP : *qsfp = true; *cmis = true;break ;
@@ -303,6 +304,7 @@ int mlxsw_env_get_module_info(struct net_device *netdev, modinfo->eeprom_len =ETH_MODULE_SFF_8472_LEN /2 ;break ;case MLXSW_REG_MCIA_EEPROM_MODULE_INFO_ID_QSFP_DD : +case MLXSW_REG_MCIA_EEPROM_MODULE_INFO_ID_OSFP :/* Use SFF_8636 as base type. ethtool should recognize specific * type through the identifier value. */
drivers/net/ethernet/mellanox/mlxsw/reg.h +1 -0
@@ -10037,6 +10037,7 @@ enum mlxsw_reg_mcia_eeprom_module_info_id {MLXSW_REG_MCIA_EEPROM_MODULE_INFO_ID_QSFP_PLUS =0x0D ,MLXSW_REG_MCIA_EEPROM_MODULE_INFO_ID_QSFP28 =0x11 ,MLXSW_REG_MCIA_EEPROM_MODULE_INFO_ID_QSFP_DD =0x18 , + MLXSW_REG_MCIA_EEPROM_MODULE_INFO_ID_OSFP = 0x19, }; enum mlxsw_reg_mcia_eeprom_module_info {
Signature · 1 line
2.33.1
This series was applied to netdev/net-next.git (master) by David S. Miller <[email protected]>:
Hello:
This series was applied to netdev/net-next.git (master) by David S. Miller <[email protected]>:
Quoted 9 lines · On Tue, 22 Feb 2022 19:16:51 +0200 you wrote:
This patchset contains miscellaneous updates to mlxsw gathered over time.
Patches #1-#2 fix recent regressions present in net-next.
Patches #3-#11 are small cleanups performed while adding line card support in mlxsw.
[...]
Here is the summary with links:
- [net-next,01/12] mlxsw: core: Prevent trap group setting if driver does not support EMAD
https://git.kernel.org/netdev/net-next/c/c035ea76c4e7 - [net-next,02/12] mlxsw: spectrum_span: Ignore VLAN entries not used by the bridge in mirroring https://git.kernel.org/netdev/net-next/c/42c9135fef9b - [net-next,03/12] mlxsw: core_thermal: Avoid creation of virtual hwmon objects by thermal module https://git.kernel.org/netdev/net-next/c/f8a36880f474 - [net-next,04/12] mlxsw: core_hwmon: Fix variable names for hwmon attributes https://git.kernel.org/netdev/net-next/c/bed8f4197cb2 - [net-next,05/12] mlxsw: core_thermal: Rename labels according to naming convention https://git.kernel.org/netdev/net-next/c/009da9fad567 - [net-next,06/12] mlxsw: core_thermal: Remove obsolete API for query resource https://git.kernel.org/netdev/net-next/c/bfb82c9cceac - [net-next,07/12] mlxsw: reg: Add "mgpir_" prefix to MGPIR fields comments https://git.kernel.org/netdev/net-next/c/719fc0662cdc - [net-next,08/12] mlxsw: core: Remove unnecessary asserts https://git.kernel.org/netdev/net-next/c/af9911c569d5 - [net-next,09/12] mlxsw: spectrum: Remove SP{1,2,3} defines for FW minor and subminor https://git.kernel.org/netdev/net-next/c/8b5f555be8f2 - [net-next,10/12] mlxsw: core: Unify method of trap support validation https://git.kernel.org/netdev/net-next/c/902992d18f5a - [net-next,11/12] mlxsw: Remove resource query check https://git.kernel.org/netdev/net-next/c/cc4d3de99052 - [net-next,12/12] mlxsw: core: Add support for OSFP transceiver modules https://git.kernel.org/netdev/net-next/c/f881c4ab37db
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html