Skip to contentSkip to conversation

mlx5 fixes 2021-04-06

GIT PULL Applied Saeed Mahameed 2 participants 7 messages Apr 7, 2021

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

From: Saeed Mahameed <[email protected]>

Hi Dave, Jakub,

This series provides some fixes to mlx5 driver. Please pull and let me know if there is any problem.

Thanks,
Saeed.

---
The following changes since commit 5219d6012d46ec1fa3397e50bfeb7b8c16df72cf:

docs: ethtool: fix some copy-paste errors (2021-04-06 16:55:41 -0700)

are available in the Git repository at:

git://git.kernel.org/pub/scm/linux/kernel/git/saeed/linux.git tags/mlx5-fixes-2021-04-06

for you to fetch changes up to d5f9b005c3062d6d96872896b695e5116b921f52:

net/mlx5: fix kfree mismatch in indir_table.c (2021-04-06 21:04:36 -0700)

----------------------------------------------------------------
mlx5-fixes-2021-04-06

----------------------------------------------------------------
Aya Levin (2):
net/mlx5: Fix PPLM register mapping
net/mlx5: Fix PBMC register mapping

Eli Cohen (1):
net/mlx5: Fix HW spec violation configuring uplink

Raed Salem (1):
net/mlx5: Fix placement of log_max_flow_counter

Xiaoming Ni (1):
net/mlx5: fix kfree mismatch in indir_table.c

 drivers/net/ethernet/mellanox/mlx5/core/en_rep.c          |  5 +++--
 drivers/net/ethernet/mellanox/mlx5/core/esw/indir_table.c | 10 +++++-----
 include/linux/mlx5/mlx5_ifc.h                             | 10 ++++++----
 3 files changed, 14 insertions(+), 11 deletions(-)
#1 lore raw

PATCH 1/5 net/mlx5: Fix HW spec violation configuring uplink

From: Eli Cohen <[email protected]>

Make sure to modify uplink port to follow only if the uplink_follow capability is set as required by the HW spec. Failure to do so causes traffic to the uplink representor net device to cease after switching to switchdev mode.

Fixes 7d0314b11cdd ("net/mlx5e: Modify uplink state on interface up/down")
---
 drivers/net/ethernet/mellanox/mlx5/core/en_rep.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/net/ethernet/mellanox/mlx5/core/en_rep.c +3 -2
index a132fff7a980..8d39bfee84a9 100644
@@ -1107,8 +1107,9 @@ static void mlx5e_uplink_rep_enable(struct mlx5e_priv *priv)
 
 	mlx5e_rep_tc_enable(priv);
 
-	mlx5_modify_vport_admin_state(mdev, MLX5_VPORT_STATE_OP_MOD_UPLINK,
-				      0, 0, MLX5_VPORT_ADMIN_STATE_AUTO);
+	if (MLX5_CAP_GEN(mdev, uplink_follow))
+		mlx5_modify_vport_admin_state(mdev, MLX5_VPORT_STATE_OP_MOD_UPLINK,
+					      0, 0, MLX5_VPORT_ADMIN_STATE_AUTO);
 	mlx5_lag_add(mdev, netdev);
 	priv->events_nb.notifier_call = uplink_rep_async_event;
 	mlx5_notifier_register(mdev, &priv->events_nb);
Signature · 1 line
2.30.2
#3 lore raw

PATCH 2/5 net/mlx5: Fix placement of log_max_flow_counter

In reply to Saeed Mahameed

From: Raed Salem <[email protected]>

The cited commit wrongly placed log_max_flow_counter field of mlx5_ifc_flow_table_prop_layout_bits, align it to the HW spec intended placement.

Fixes 16f1c5bb3ed7 ("net/mlx5: Check device capability for maximum flow counters")
---
 include/linux/mlx5/mlx5_ifc.h | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
include/linux/mlx5/mlx5_ifc.h +3 -3
index df5d91c8b2d4..1ccedb7816d0 100644
@@ -437,11 +437,11 @@ struct mlx5_ifc_flow_table_prop_layout_bits {
 	u8         reserved_at_60[0x18];
 	u8         log_max_ft_num[0x8];
 
-	u8         reserved_at_80[0x18];
+	u8         reserved_at_80[0x10];
+	u8         log_max_flow_counter[0x8];
 	u8         log_max_destination[0x8];
 
-	u8         log_max_flow_counter[0x8];
-	u8         reserved_at_a8[0x10];
+	u8         reserved_at_a0[0x18];
 	u8         log_max_flow[0x8];
 
 	u8         reserved_at_c0[0x40];
Signature · 1 line
2.30.2
#4 lore raw

PATCH 3/5 net/mlx5: Fix PPLM register mapping

In reply to Saeed Mahameed

From: Aya Levin <[email protected]>

Add reserved mapping to cover all the register in order to avoid setting arbitrary values to newer FW which implements the reserved fields.

Fixes a58837f52d43 ("net/mlx5e: Expose FEC feilds and related capability bit")
---
 include/linux/mlx5/mlx5_ifc.h | 2 ++
 1 file changed, 2 insertions(+)
include/linux/mlx5/mlx5_ifc.h +2 -0
index 1ccedb7816d0..9940070cda8f 100644
@@ -8835,6 +8835,8 @@ struct mlx5_ifc_pplm_reg_bits {
 
 	u8         fec_override_admin_100g_2x[0x10];
 	u8         fec_override_admin_50g_1x[0x10];
+
+	u8         reserved_at_140[0x140];
 };
 
 struct mlx5_ifc_ppcnt_reg_bits {
Signature · 1 line
2.30.2
#5 lore raw

PATCH 4/5 net/mlx5: Fix PBMC register mapping

In reply to Saeed Mahameed

From: Aya Levin <[email protected]>

Add reserved mapping to cover all the register in order to avoid setting arbitrary values to newer FW which implements the reserved fields.

Fixes 50b4a3c23646 ("net/mlx5: PPTB and PBMC register firmware command support")
---
 include/linux/mlx5/mlx5_ifc.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
include/linux/mlx5/mlx5_ifc.h +1 -1
index 9940070cda8f..9c68b2da14c6 100644
@@ -10200,7 +10200,7 @@ struct mlx5_ifc_pbmc_reg_bits {
 
 	struct mlx5_ifc_bufferx_reg_bits buffer[10];
 
-	u8         reserved_at_2e0[0x40];
+	u8         reserved_at_2e0[0x80];
 };
 
 struct mlx5_ifc_qtct_reg_bits {
Signature · 1 line
2.30.2
#6 lore raw

PATCH 5/5 net/mlx5: fix kfree mismatch in indir_table.c

In reply to Saeed Mahameed

From: Xiaoming Ni <[email protected]>

Memory allocated by kvzalloc() should be freed by kvfree().

Fixes 34ca65352ddf2 ("net/mlx5: E-Switch, Indirect table infrastructur")
---
 .../net/ethernet/mellanox/mlx5/core/esw/indir_table.c  | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
drivers/net/ethernet/mellanox/mlx5/core/esw/indir_table.c +5 -5
index 6f6772bf61a2..3da7becc1069 100644
@@ -248,7 +248,7 @@ static int mlx5_esw_indir_table_rule_get(struct mlx5_eswitch *esw,
 err_ethertype:
 	kfree(rule);
 out:
-	kfree(rule_spec);
+	kvfree(rule_spec);
 	return err;
 }
 
@@ -328,7 +328,7 @@ static int mlx5_create_indir_recirc_group(struct mlx5_eswitch *esw,
 	e->recirc_cnt = 0;
 
 out:
-	kfree(in);
+	kvfree(in);
 	return err;
 }
 
@@ -347,7 +347,7 @@ static int mlx5_create_indir_fwd_group(struct mlx5_eswitch *esw,
 
 	spec = kvzalloc(sizeof(*spec), GFP_KERNEL);
 	if (!spec) {
-		kfree(in);
+		kvfree(in);
 		return -ENOMEM;
 	}
 
@@ -371,8 +371,8 @@ static int mlx5_create_indir_fwd_group(struct mlx5_eswitch *esw,
 	}
 
 err_out:
-	kfree(spec);
-	kfree(in);
+	kvfree(spec);
+	kvfree(in);
 	return err;
 }
 
Signature · 1 line
2.30.2
#2 lore raw

Re: [net 1/5] net/mlx5: Fix HW spec violation configuring uplink

In reply to Saeed Mahameed
This series was applied to netdev/net.git (refs/heads/master):

Hello:

This series was applied to netdev/net.git (refs/heads/master):

Quoted 8 lines · On Tue, 6 Apr 2021 21:06:16 -0700 you wrote:

From: Eli Cohen <[email protected]>

Make sure to modify uplink port to follow only if the uplink_follow capability is set as required by the HW spec. Failure to do so causes traffic to the uplink representor net device to cease after switching to switchdev mode.

[...]

Here is the summary with links:
- [net,1/5] net/mlx5: Fix HW spec violation configuring uplink

    https://git.kernel.org/netdev/net/c/1a73704c82ed
  - [net,2/5] net/mlx5: Fix placement of log_max_flow_counter
    https://git.kernel.org/netdev/net/c/a14587dfc5ad
  - [net,3/5] net/mlx5: Fix PPLM register mapping
    https://git.kernel.org/netdev/net/c/ce28f0fd670d
  - [net,4/5] net/mlx5: Fix PBMC register mapping
    https://git.kernel.org/netdev/net/c/534b1204ca46
  - [net,5/5] net/mlx5: fix kfree mismatch in indir_table.c
    https://git.kernel.org/netdev/net/c/d5f9b005c306

You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html