Skip to contentSkip to conversation

Mellanox, mlx5 fixes 2018-09-17

GIT PULL New Saeed Mahameed 2 participants 5 messages Sep 18, 2018 – Sep 19, 2018

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

Hi Dave,

Sorry about the previous submission of this series which was mistakenly marked for net-next, here I am resending with 'net' mark.

This series provides three fixes to mlx5 core and mlx5e netdevice driver.

Please pull and let me know if there's any problem.

For -stable v4.16:
('net/mlx5: Check for SQ and not RQ state when modifying hairpin SQ')

Thanks,
Saeed.

---

The following changes since commit c73480910e9686a5c25155cb4d418d594b678196:

net: ethernet: Fix a unused function warning. (2018-09-17 08:24:25 -0700)

are available in the Git repository at:

git://git.kernel.org/pub/scm/linux/kernel/git/saeed/linux.git tags/mlx5-fixes-2018-09-17

for you to fetch changes up to 8f92e35aff9692028279d3c03e88547df6d15020:

net/mlx5e: TLS, Read capabilities only when it is safe (2018-09-17 15:12:31 -0700)

----------------------------------------------------------------
mlx5-fixes-2018-09-17

----------------------------------------------------------------
Alaa Hleihel (1):
net/mlx5: Check for SQ and not RQ state when modifying hairpin SQ

Eli Cohen (1):
net/mlx5: Fix read from coherent memory

Saeed Mahameed (1):
net/mlx5e: TLS, Read capabilities only when it is safe

 drivers/net/ethernet/mellanox/mlx5/core/cmd.c          | 2 +-
 drivers/net/ethernet/mellanox/mlx5/core/en_accel/tls.c | 3 ++-
 drivers/net/ethernet/mellanox/mlx5/core/transobj.c     | 2 +-
 3 files changed, 4 insertions(+), 3 deletions(-)
#1 lore raw

PATCH RESEND 1/3 net/mlx5: Fix read from coherent memory

From: Eli Cohen <[email protected]>

Use accessor function READ_ONCE to read from coherent memory modified by the device and read by the driver. This becomes most important in preemptive kernels where cond_resched implementation does not have the side effect which guaranteed the updated value.

Fixes 269d26f47f6f ("net/mlx5: Reduce command polling interval")
---
 drivers/net/ethernet/mellanox/mlx5/core/cmd.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/mellanox/mlx5/core/cmd.c +1 -1
index 3ce14d42ddc8..a53736c26c0c 100644
@@ -206,7 +206,7 @@ static void poll_timeout(struct mlx5_cmd_work_ent *ent)
 	u8 own;
 
 	do {
-		own = ent->lay->status_own;
+		own = READ_ONCE(ent->lay->status_own);
 		if (!(own & CMD_OWNER_HW)) {
 			ent->ret = 0;
 			return;
Signature · 1 line
2.17.1
#2 lore raw

PATCH RESEND 2/3 net/mlx5: Check for SQ and not RQ state when modifying hairpin SQ

In reply to Saeed Mahameed

From: Alaa Hleihel <[email protected]>

When modifying hairpin SQ, instead of checking if the next state equals to MLX5_SQC_STATE_RDY, we compare it against the MLX5_RQC_STATE_RDY enum value.

The code worked since both of MLX5_RQC_STATE_RDY and MLX5_SQC_STATE_RDY have the same value today.

This patch fixes this issue.

Fixes 18e568c390c6 ("net/mlx5: Hairpin pair core object setup")
---
 drivers/net/ethernet/mellanox/mlx5/core/transobj.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/mellanox/mlx5/core/transobj.c +1 -1
index dae1c5c5d27c..d2f76070ea7c 100644
@@ -509,7 +509,7 @@ static int mlx5_hairpin_modify_sq(struct mlx5_core_dev *peer_mdev, u32 sqn,
 
 	sqc = MLX5_ADDR_OF(modify_sq_in, in, ctx);
 
-	if (next_state == MLX5_RQC_STATE_RDY) {
+	if (next_state == MLX5_SQC_STATE_RDY) {
 		MLX5_SET(sqc, sqc, hairpin_peer_rq, peer_rq);
 		MLX5_SET(sqc, sqc, hairpin_peer_vhca, peer_vhca);
 	}
Signature · 1 line
2.17.1
#3 lore raw

PATCH RESEND 3/3 net/mlx5e: TLS, Read capabilities only when it is safe

In reply to Saeed Mahameed

Read TLS caps from the core driver only when TLS is supported, i.e mlx5_accel_is_tls_device returns true.

Fixes 790af90c00d2 ("net/mlx5e: TLS, build TLS netdev from capabilities")
---
 drivers/net/ethernet/mellanox/mlx5/core/en_accel/tls.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/net/ethernet/mellanox/mlx5/core/en_accel/tls.c +2 -1
index eddd7702680b..e88340e196f7 100644
@@ -183,12 +183,13 @@ static const struct tlsdev_ops mlx5e_tls_ops = {
 
 void mlx5e_tls_build_netdev(struct mlx5e_priv *priv)
 {
-	u32 caps = mlx5_accel_tls_device_caps(priv->mdev);
 	struct net_device *netdev = priv->netdev;
+	u32 caps;
 
 	if (!mlx5_accel_is_tls_device(priv->mdev))
 		return;
 
+	caps = mlx5_accel_tls_device_caps(priv->mdev);
 	if (caps & MLX5_ACCEL_TLS_TX) {
 		netdev->features          |= NETIF_F_HW_TLS_TX;
 		netdev->hw_features       |= NETIF_F_HW_TLS_TX;
Signature · 1 line
2.17.1
#4 lore raw
In reply to Saeed Mahameed

From: Saeed Mahameed <[email protected]>
Date: Mon, 17 Sep 2018 20:49:25 -0700

Quoted 7 lines

Sorry about the previous submission of this series which was mistakenly marked for net-next, here I am resending with 'net' mark.

This series provides three fixes to mlx5 core and mlx5e netdevice driver.

Please pull and let me know if there's any problem.

Puled.

Quoted 2 lines

For -stable v4.16:
('net/mlx5: Check for SQ and not RQ state when modifying hairpin SQ')

Queued up.

Thanks.