* [pull request][RESEND net 0/3] Mellanox, mlx5 fixes 2018-09-17
@ 2018-09-18 3:49 Saeed Mahameed
2018-09-18 3:49 ` [RESEND net 1/3] net/mlx5: Fix read from coherent memory Saeed Mahameed
` (3 more replies)
0 siblings, 4 replies; 5+ messages in thread
From: Saeed Mahameed @ 2018-09-18 3:49 UTC (permalink / raw)
To: David S. Miller; +Cc: netdev, Saeed Mahameed
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(-)
^ permalink raw reply [flat|nested] 5+ messages in thread
* [RESEND net 1/3] net/mlx5: Fix read from coherent memory
2018-09-18 3:49 [pull request][RESEND net 0/3] Mellanox, mlx5 fixes 2018-09-17 Saeed Mahameed
@ 2018-09-18 3:49 ` Saeed Mahameed
2018-09-18 3:49 ` [RESEND net 2/3] net/mlx5: Check for SQ and not RQ state when modifying hairpin SQ Saeed Mahameed
` (2 subsequent siblings)
3 siblings, 0 replies; 5+ messages in thread
From: Saeed Mahameed @ 2018-09-18 3:49 UTC (permalink / raw)
To: David S. Miller; +Cc: netdev, Eli Cohen, Saeed Mahameed
From: Eli Cohen <eli@mellanox.com>
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")
Signed-off-by: Eli Cohen <eli@mellanox.com>
Reported-by: Jesper Dangaard Brouer <brouer@redhat.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
---
drivers/net/ethernet/mellanox/mlx5/core/cmd.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/cmd.c b/drivers/net/ethernet/mellanox/mlx5/core/cmd.c
index 3ce14d42ddc8..a53736c26c0c 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/cmd.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/cmd.c
@@ -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;
--
2.17.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [RESEND net 2/3] net/mlx5: Check for SQ and not RQ state when modifying hairpin SQ
2018-09-18 3:49 [pull request][RESEND net 0/3] Mellanox, mlx5 fixes 2018-09-17 Saeed Mahameed
2018-09-18 3:49 ` [RESEND net 1/3] net/mlx5: Fix read from coherent memory Saeed Mahameed
@ 2018-09-18 3:49 ` Saeed Mahameed
2018-09-18 3:49 ` [RESEND net 3/3] net/mlx5e: TLS, Read capabilities only when it is safe Saeed Mahameed
2018-09-19 3:00 ` [pull request][RESEND net 0/3] Mellanox, mlx5 fixes 2018-09-17 David Miller
3 siblings, 0 replies; 5+ messages in thread
From: Saeed Mahameed @ 2018-09-18 3:49 UTC (permalink / raw)
To: David S. Miller; +Cc: netdev, Alaa Hleihel, Saeed Mahameed
From: Alaa Hleihel <alaa@mellanox.com>
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")
Signed-off-by: Alaa Hleihel <alaa@mellanox.com>
Reviewed-by: Or Gerlitz <ogerlitz@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
---
drivers/net/ethernet/mellanox/mlx5/core/transobj.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/transobj.c b/drivers/net/ethernet/mellanox/mlx5/core/transobj.c
index dae1c5c5d27c..d2f76070ea7c 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/transobj.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/transobj.c
@@ -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);
}
--
2.17.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [RESEND net 3/3] net/mlx5e: TLS, Read capabilities only when it is safe
2018-09-18 3:49 [pull request][RESEND net 0/3] Mellanox, mlx5 fixes 2018-09-17 Saeed Mahameed
2018-09-18 3:49 ` [RESEND net 1/3] net/mlx5: Fix read from coherent memory Saeed Mahameed
2018-09-18 3:49 ` [RESEND net 2/3] net/mlx5: Check for SQ and not RQ state when modifying hairpin SQ Saeed Mahameed
@ 2018-09-18 3:49 ` Saeed Mahameed
2018-09-19 3:00 ` [pull request][RESEND net 0/3] Mellanox, mlx5 fixes 2018-09-17 David Miller
3 siblings, 0 replies; 5+ messages in thread
From: Saeed Mahameed @ 2018-09-18 3:49 UTC (permalink / raw)
To: David S. Miller; +Cc: netdev, 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")
Reported-by: Michal Kubecek <mkubecek@suse.cz>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
Reviewed-by: Boris Pismenny <borisp@mellanox.com>
Reviewed-by: Tariq Toukan <tariqt@mellanox.com>
---
drivers/net/ethernet/mellanox/mlx5/core/en_accel/tls.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_accel/tls.c b/drivers/net/ethernet/mellanox/mlx5/core/en_accel/tls.c
index eddd7702680b..e88340e196f7 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en_accel/tls.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en_accel/tls.c
@@ -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;
--
2.17.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [pull request][RESEND net 0/3] Mellanox, mlx5 fixes 2018-09-17
2018-09-18 3:49 [pull request][RESEND net 0/3] Mellanox, mlx5 fixes 2018-09-17 Saeed Mahameed
` (2 preceding siblings ...)
2018-09-18 3:49 ` [RESEND net 3/3] net/mlx5e: TLS, Read capabilities only when it is safe Saeed Mahameed
@ 2018-09-19 3:00 ` David Miller
3 siblings, 0 replies; 5+ messages in thread
From: David Miller @ 2018-09-19 3:00 UTC (permalink / raw)
To: saeedm; +Cc: netdev
From: Saeed Mahameed <saeedm@mellanox.com>
Date: Mon, 17 Sep 2018 20:49:25 -0700
> 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.
> For -stable v4.16:
> ('net/mlx5: Check for SQ and not RQ state when modifying hairpin SQ')
Queued up.
Thanks.
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2018-09-19 8:35 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-09-18 3:49 [pull request][RESEND net 0/3] Mellanox, mlx5 fixes 2018-09-17 Saeed Mahameed
2018-09-18 3:49 ` [RESEND net 1/3] net/mlx5: Fix read from coherent memory Saeed Mahameed
2018-09-18 3:49 ` [RESEND net 2/3] net/mlx5: Check for SQ and not RQ state when modifying hairpin SQ Saeed Mahameed
2018-09-18 3:49 ` [RESEND net 3/3] net/mlx5e: TLS, Read capabilities only when it is safe Saeed Mahameed
2018-09-19 3:00 ` [pull request][RESEND net 0/3] Mellanox, mlx5 fixes 2018-09-17 David Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).