Mellanox, mlx5 fixes 2018-09-17
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(-)
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.
--- 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
@@ -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
PATCH RESEND 2/3 net/mlx5: Check for SQ and not RQ state when modifying hairpin SQ
In reply to Saeed MahameedFrom: 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.
--- 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
@@ -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
PATCH RESEND 3/3 net/mlx5e: TLS, Read capabilities only when it is safe
In reply to Saeed MahameedRead TLS caps from the core driver only when TLS is supported, i.e mlx5_accel_is_tls_device returns true.
--- 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
@@ -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
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.