Skip to contentSkip to conversation

mlxsw: Two small fixes

PATCH Applied Ido Schimmel 2 participants 4 messages May 29, 2019 – May 30, 2019

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

cover mlxsw: Two small fixes

From: Ido Schimmel <[email protected]>

Patch #1 from Jiri fixes an issue specific to Spectrum-2 where the insertion of two identical flower filters with different priorities would trigger a warning.

Patch #2 from Amit prevents the driver from trying to configure a port with a speed of 56Gb/s and autoneg off as this is not supported and results in error messages from firmware.

Please consider patch #1 for stable.

Amit Cohen (1):
mlxsw: spectrum: Prevent force of 56G

Jiri Pirko (1):
mlxsw: spectrum_acl: Avoid warning after identical rules insertion

 drivers/net/ethernet/mellanox/mlxsw/spectrum.c        |  4 ++++
 .../net/ethernet/mellanox/mlxsw/spectrum_acl_erp.c    | 11 +++++------
 2 files changed, 9 insertions(+), 6 deletions(-)
Signature · 1 line
2.20.1
#1 lore raw

PATCH 1/2 mlxsw: spectrum_acl: Avoid warning after identical rules insertion

From: Jiri Pirko <[email protected]>

When identical rules are inserted, the latter one goes to C-TCAM. For that, a second eRP with the same mask is created. These 2 eRPs by the nature cannot be merged and also one cannot be parent of another. Teach mlxsw_sp_acl_erp_delta_fill() about this possibility and handle it gracefully.

Fixes c22291f7cf45 ("mlxsw: spectrum: acl: Implement delta for ERP")
---
 .../net/ethernet/mellanox/mlxsw/spectrum_acl_erp.c    | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)
drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_erp.c +5 -6
index c1a9cc9a3292..4c98950380d5 100644
@@ -1171,13 +1171,12 @@ mlxsw_sp_acl_erp_delta_fill(const struct mlxsw_sp_acl_erp_key *parent_key,
 			return -EINVAL;
 	}
 	if (si == -1) {
-		/* The masks are the same, this cannot happen.
-		 * That means the caller is broken.
+		/* The masks are the same, this can happen in case eRPs with
+		 * the same mask were created in both A-TCAM and C-TCAM.
+		 * The only possible condition under which this can happen
+		 * is identical rule insertion. Delta is not possible here.
 		 */
-		WARN_ON(1);
-		*delta_start = 0;
-		*delta_mask = 0;
-		return 0;
+		return -EINVAL;
 	}
 	pmask = (unsigned char) parent_key->mask[__MASK_IDX(si)];
 	mask = (unsigned char) key->mask[__MASK_IDX(si)];
Signature · 1 line
2.20.1
#2 lore raw

PATCH 2/2 mlxsw: spectrum: Prevent force of 56G

In reply to Ido Schimmel

From: Amit Cohen <[email protected]>

Force of 56G is not supported by hardware in Ethernet devices. This configuration fails with a bad parameter error from firmware.

Add check of this case. Instead of trying to set 56G with autoneg off, return a meaningful error.

Fixes 56ade8fe3fe1 ("mlxsw: spectrum: Add initial support for Spectrum ASIC")
---
 drivers/net/ethernet/mellanox/mlxsw/spectrum.c | 4 ++++
 1 file changed, 4 insertions(+)
drivers/net/ethernet/mellanox/mlxsw/spectrum.c +4 -0
index dbb425717f5e..dfe6b44baf63 100644
@@ -3128,6 +3128,10 @@ mlxsw_sp_port_set_link_ksettings(struct net_device *dev,
 	ops->reg_ptys_eth_unpack(mlxsw_sp, ptys_pl, &eth_proto_cap, NULL, NULL);
 
 	autoneg = cmd->base.autoneg == AUTONEG_ENABLE;
+	if (!autoneg && cmd->base.speed == SPEED_56000) {
+		netdev_err(dev, "56G not supported with autoneg off\n");
+		return -EINVAL;
+	}
 	eth_proto_new = autoneg ?
 		ops->to_ptys_advert_link(mlxsw_sp, cmd) :
 		ops->to_ptys_speed(mlxsw_sp, cmd->base.speed);
Signature · 1 line
2.20.1
maintainer Applied
#3 lore raw
In reply to Ido Schimmel

From: Ido Schimmel <[email protected]>
Date: Wed, 29 May 2019 10:59:43 +0300

Quoted 9 lines

From: Ido Schimmel <[email protected]>

Patch #1 from Jiri fixes an issue specific to Spectrum-2 where the insertion of two identical flower filters with different priorities would trigger a warning.

Patch #2 from Amit prevents the driver from trying to configure a port with a speed of 56Gb/s and autoneg off as this is not supported and results in error messages from firmware.

Series applied.

Quoted 1 line

Please consider patch #1 for stable.

Queued up, thanks.