Netdev Archive on lore.kernel.org
 help / color / Atom feed
* [pull request][net 0/5] mlx5 fixes 2021-04-06
@ 2021-04-07  4:06 Saeed Mahameed
  2021-04-07  4:06 ` [net 1/5] net/mlx5: Fix HW spec violation configuring uplink Saeed Mahameed
                   ` (4 more replies)
  0 siblings, 5 replies; 7+ messages in thread
From: Saeed Mahameed @ 2021-04-07  4:06 UTC (permalink / raw)
  To: David S. Miller, Jakub Kicinski; +Cc: netdev, Tariq Toukan, Saeed Mahameed

From: Saeed Mahameed <saeedm@nvidia.com>

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(-)

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [net 1/5] net/mlx5: Fix HW spec violation configuring uplink
  2021-04-07  4:06 [pull request][net 0/5] mlx5 fixes 2021-04-06 Saeed Mahameed
@ 2021-04-07  4:06 ` Saeed Mahameed
  2021-04-07 22:00   ` patchwork-bot+netdevbpf
  2021-04-07  4:06 ` [net 2/5] net/mlx5: Fix placement of log_max_flow_counter Saeed Mahameed
                   ` (3 subsequent siblings)
  4 siblings, 1 reply; 7+ messages in thread
From: Saeed Mahameed @ 2021-04-07  4:06 UTC (permalink / raw)
  To: David S. Miller, Jakub Kicinski
  Cc: netdev, Tariq Toukan, Eli Cohen, Roi Dayan, Saeed Mahameed

From: Eli Cohen <elic@nvidia.com>

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")
Signed-off-by: Eli Cohen <elic@nvidia.com>
Reviewed-by: Roi Dayan <roid@nvidia.com>
Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
---
 drivers/net/ethernet/mellanox/mlx5/core/en_rep.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_rep.c b/drivers/net/ethernet/mellanox/mlx5/core/en_rep.c
index a132fff7a980..8d39bfee84a9 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en_rep.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en_rep.c
@@ -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);
-- 
2.30.2


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [net 2/5] net/mlx5: Fix placement of log_max_flow_counter
  2021-04-07  4:06 [pull request][net 0/5] mlx5 fixes 2021-04-06 Saeed Mahameed
  2021-04-07  4:06 ` [net 1/5] net/mlx5: Fix HW spec violation configuring uplink Saeed Mahameed
@ 2021-04-07  4:06 ` Saeed Mahameed
  2021-04-07  4:06 ` [net 3/5] net/mlx5: Fix PPLM register mapping Saeed Mahameed
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 7+ messages in thread
From: Saeed Mahameed @ 2021-04-07  4:06 UTC (permalink / raw)
  To: David S. Miller, Jakub Kicinski
  Cc: netdev, Tariq Toukan, Raed Salem, Roi Dayan, Saeed Mahameed

From: Raed Salem <raeds@nvidia.com>

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")
Signed-off-by: Raed Salem <raeds@nvidia.com>
Reviewed-by: Roi Dayan <roid@nvidia.com>
Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
---
 include/linux/mlx5/mlx5_ifc.h | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/include/linux/mlx5/mlx5_ifc.h b/include/linux/mlx5/mlx5_ifc.h
index df5d91c8b2d4..1ccedb7816d0 100644
--- a/include/linux/mlx5/mlx5_ifc.h
+++ b/include/linux/mlx5/mlx5_ifc.h
@@ -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];
-- 
2.30.2


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [net 3/5] net/mlx5: Fix PPLM register mapping
  2021-04-07  4:06 [pull request][net 0/5] mlx5 fixes 2021-04-06 Saeed Mahameed
  2021-04-07  4:06 ` [net 1/5] net/mlx5: Fix HW spec violation configuring uplink Saeed Mahameed
  2021-04-07  4:06 ` [net 2/5] net/mlx5: Fix placement of log_max_flow_counter Saeed Mahameed
@ 2021-04-07  4:06 ` Saeed Mahameed
  2021-04-07  4:06 ` [net 4/5] net/mlx5: Fix PBMC " Saeed Mahameed
  2021-04-07  4:06 ` [net 5/5] net/mlx5: fix kfree mismatch in indir_table.c Saeed Mahameed
  4 siblings, 0 replies; 7+ messages in thread
From: Saeed Mahameed @ 2021-04-07  4:06 UTC (permalink / raw)
  To: David S. Miller, Jakub Kicinski
  Cc: netdev, Tariq Toukan, Aya Levin, Moshe Shemesh, Saeed Mahameed

From: Aya Levin <ayal@nvidia.com>

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")
Signed-off-by: Aya Levin <ayal@nvidia.com>
Reviewed-by: Moshe Shemesh <moshe@nvidia.com>
Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
---
 include/linux/mlx5/mlx5_ifc.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/include/linux/mlx5/mlx5_ifc.h b/include/linux/mlx5/mlx5_ifc.h
index 1ccedb7816d0..9940070cda8f 100644
--- a/include/linux/mlx5/mlx5_ifc.h
+++ b/include/linux/mlx5/mlx5_ifc.h
@@ -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 {
-- 
2.30.2


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [net 4/5] net/mlx5: Fix PBMC register mapping
  2021-04-07  4:06 [pull request][net 0/5] mlx5 fixes 2021-04-06 Saeed Mahameed
                   ` (2 preceding siblings ...)
  2021-04-07  4:06 ` [net 3/5] net/mlx5: Fix PPLM register mapping Saeed Mahameed
@ 2021-04-07  4:06 ` Saeed Mahameed
  2021-04-07  4:06 ` [net 5/5] net/mlx5: fix kfree mismatch in indir_table.c Saeed Mahameed
  4 siblings, 0 replies; 7+ messages in thread
From: Saeed Mahameed @ 2021-04-07  4:06 UTC (permalink / raw)
  To: David S. Miller, Jakub Kicinski
  Cc: netdev, Tariq Toukan, Aya Levin, Moshe Shemesh, Saeed Mahameed

From: Aya Levin <ayal@nvidia.com>

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")
Signed-off-by: Aya Levin <ayal@nvidia.com>
Reviewed-by: Moshe Shemesh <moshe@nvidia.com>
Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
---
 include/linux/mlx5/mlx5_ifc.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/linux/mlx5/mlx5_ifc.h b/include/linux/mlx5/mlx5_ifc.h
index 9940070cda8f..9c68b2da14c6 100644
--- a/include/linux/mlx5/mlx5_ifc.h
+++ b/include/linux/mlx5/mlx5_ifc.h
@@ -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 {
-- 
2.30.2


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [net 5/5] net/mlx5: fix kfree mismatch in indir_table.c
  2021-04-07  4:06 [pull request][net 0/5] mlx5 fixes 2021-04-06 Saeed Mahameed
                   ` (3 preceding siblings ...)
  2021-04-07  4:06 ` [net 4/5] net/mlx5: Fix PBMC " Saeed Mahameed
@ 2021-04-07  4:06 ` Saeed Mahameed
  4 siblings, 0 replies; 7+ messages in thread
From: Saeed Mahameed @ 2021-04-07  4:06 UTC (permalink / raw)
  To: David S. Miller, Jakub Kicinski
  Cc: netdev, Tariq Toukan, Xiaoming Ni, Leon Romanovsky, Saeed Mahameed

From: Xiaoming Ni <nixiaoming@huawei.com>

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

Fixes: 34ca65352ddf2 ("net/mlx5: E-Switch, Indirect table infrastructur")
Signed-off-by: Xiaoming Ni <nixiaoming@huawei.com>
Reviewed-by: Leon Romanovsky <leonro@nvidia.com>
Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
---
 .../net/ethernet/mellanox/mlx5/core/esw/indir_table.c  | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/net/ethernet/mellanox/mlx5/core/esw/indir_table.c b/drivers/net/ethernet/mellanox/mlx5/core/esw/indir_table.c
index 6f6772bf61a2..3da7becc1069 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/esw/indir_table.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/esw/indir_table.c
@@ -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;
 }
 
-- 
2.30.2


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [net 1/5] net/mlx5: Fix HW spec violation configuring uplink
  2021-04-07  4:06 ` [net 1/5] net/mlx5: Fix HW spec violation configuring uplink Saeed Mahameed
@ 2021-04-07 22:00   ` patchwork-bot+netdevbpf
  0 siblings, 0 replies; 7+ messages in thread
From: patchwork-bot+netdevbpf @ 2021-04-07 22:00 UTC (permalink / raw)
  To: Saeed Mahameed; +Cc: davem, kuba, netdev, tariqt, elic, roid, saeedm

Hello:

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

On Tue,  6 Apr 2021 21:06:16 -0700 you wrote:
> From: Eli Cohen <elic@nvidia.com>
> 
> 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



^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, back to index

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-07  4:06 [pull request][net 0/5] mlx5 fixes 2021-04-06 Saeed Mahameed
2021-04-07  4:06 ` [net 1/5] net/mlx5: Fix HW spec violation configuring uplink Saeed Mahameed
2021-04-07 22:00   ` patchwork-bot+netdevbpf
2021-04-07  4:06 ` [net 2/5] net/mlx5: Fix placement of log_max_flow_counter Saeed Mahameed
2021-04-07  4:06 ` [net 3/5] net/mlx5: Fix PPLM register mapping Saeed Mahameed
2021-04-07  4:06 ` [net 4/5] net/mlx5: Fix PBMC " Saeed Mahameed
2021-04-07  4:06 ` [net 5/5] net/mlx5: fix kfree mismatch in indir_table.c Saeed Mahameed

Netdev Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/netdev/0 netdev/git/0.git
	git clone --mirror https://lore.kernel.org/netdev/1 netdev/git/1.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 netdev netdev/ https://lore.kernel.org/netdev \
		netdev@vger.kernel.org
	public-inbox-index netdev

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.netdev


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git