* [PATCH net 0/2] mlx5 misc fixes 2026-04-09
@ 2026-04-09 20:28 Tariq Toukan
2026-04-09 20:28 ` [PATCH net 1/2] net/mlx5e: Fix features not applied during netdev registration Tariq Toukan
2026-04-09 20:28 ` [PATCH net 2/2] net/mlx5e: IPsec, fix ASO poll timeout with read_poll_timeout_atomic() Tariq Toukan
0 siblings, 2 replies; 3+ messages in thread
From: Tariq Toukan @ 2026-04-09 20:28 UTC (permalink / raw)
To: Eric Dumazet, Jakub Kicinski, Paolo Abeni, Andrew Lunn,
David S. Miller
Cc: Boris Pismenny, Saeed Mahameed, Leon Romanovsky, Tariq Toukan,
Mark Bloch, Jianbo Liu, Kees Cook, Lama Kayal, Michal Swiatkowski,
Gal Pressman, Roy Novich, Roi Dayan, Raed Salem, netdev,
linux-rdma, linux-kernel, Dragos Tatulea
Hi,
This small patchset provides misc bug fixes from Gal to the mlx5 Eth
driver.
Thanks,
Tariq.
Gal Pressman (2):
net/mlx5e: Fix features not applied during netdev registration
net/mlx5e: IPsec, fix ASO poll timeout with read_poll_timeout_atomic()
.../mellanox/mlx5/core/en_accel/ipsec_offload.c | 12 ++++--------
drivers/net/ethernet/mellanox/mlx5/core/en_main.c | 8 ++++++++
2 files changed, 12 insertions(+), 8 deletions(-)
base-commit: ebe560ea5f54134279356703e73b7f867c89db13
--
2.44.0
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH net 1/2] net/mlx5e: Fix features not applied during netdev registration
2026-04-09 20:28 [PATCH net 0/2] mlx5 misc fixes 2026-04-09 Tariq Toukan
@ 2026-04-09 20:28 ` Tariq Toukan
2026-04-09 20:28 ` [PATCH net 2/2] net/mlx5e: IPsec, fix ASO poll timeout with read_poll_timeout_atomic() Tariq Toukan
1 sibling, 0 replies; 3+ messages in thread
From: Tariq Toukan @ 2026-04-09 20:28 UTC (permalink / raw)
To: Eric Dumazet, Jakub Kicinski, Paolo Abeni, Andrew Lunn,
David S. Miller
Cc: Boris Pismenny, Saeed Mahameed, Leon Romanovsky, Tariq Toukan,
Mark Bloch, Jianbo Liu, Kees Cook, Lama Kayal, Michal Swiatkowski,
Gal Pressman, Roy Novich, Roi Dayan, Raed Salem, netdev,
linux-rdma, linux-kernel, Dragos Tatulea
From: Gal Pressman <gal@nvidia.com>
mlx5e_fix_features() returns early when the netdevice is not present.
This is correct during profile transitions where priv is cleared, but it
also incorrectly blocks feature fixups during register_netdev(), when
the device is also not yet present.
It is not trivial to distinguish between both cases as we cannot use
priv to carry state, and in both cases reg_state == NETREG_REGISTERED.
Force a netdev features update after register_netdev() completes, where
the device is present and fix_features() can actually work.
This is not a pretty solution, as it results in an additional features
update call (register_netdevice() already calls
__netdev_update_features() internally), but it is the simplest,
cleanest, and most robust way I found to fix this issue after multiple
attempts.
This fixes an issue on systems where CQE compression is enabled by
default, RXHASH remains enabled after registration despite the two
features being mutually exclusive.
Fixes: ab4b01bfdaa6 ("net/mlx5e: Verify dev is present for fix features ndo")
Signed-off-by: Gal Pressman <gal@nvidia.com>
Reviewed-by: Dragos Tatulea <dtatulea@nvidia.com>
Signed-off-by: Tariq Toukan <tariqt@nvidia.com>
---
drivers/net/ethernet/mellanox/mlx5/core/en_main.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
index b6c12460b54a..0b8b44bbcb9e 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
@@ -6756,6 +6756,14 @@ static int _mlx5e_probe(struct auxiliary_device *adev)
goto err_resume;
}
+ /* mlx5e_fix_features() returns early when the device is not present
+ * to avoid dereferencing cleared priv during profile changes.
+ * This also causes it to be a no-op during register_netdev(), where
+ * the device is not yet present.
+ * Trigger an additional features update that will actually work.
+ */
+ mlx5e_update_features(netdev);
+
mlx5e_dcbnl_init_app(priv);
mlx5_core_uplink_netdev_set(mdev, netdev);
mlx5e_params_print_info(mdev, &priv->channels.params);
--
2.44.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [PATCH net 2/2] net/mlx5e: IPsec, fix ASO poll timeout with read_poll_timeout_atomic()
2026-04-09 20:28 [PATCH net 0/2] mlx5 misc fixes 2026-04-09 Tariq Toukan
2026-04-09 20:28 ` [PATCH net 1/2] net/mlx5e: Fix features not applied during netdev registration Tariq Toukan
@ 2026-04-09 20:28 ` Tariq Toukan
1 sibling, 0 replies; 3+ messages in thread
From: Tariq Toukan @ 2026-04-09 20:28 UTC (permalink / raw)
To: Eric Dumazet, Jakub Kicinski, Paolo Abeni, Andrew Lunn,
David S. Miller
Cc: Boris Pismenny, Saeed Mahameed, Leon Romanovsky, Tariq Toukan,
Mark Bloch, Jianbo Liu, Kees Cook, Lama Kayal, Michal Swiatkowski,
Gal Pressman, Roy Novich, Roi Dayan, Raed Salem, netdev,
linux-rdma, linux-kernel, Dragos Tatulea
From: Gal Pressman <gal@nvidia.com>
The do-while poll loop uses jiffies for its timeout:
expires = jiffies + msecs_to_jiffies(10);
jiffies is sampled at an arbitrary point within the current tick, so the
first partial tick contributes anywhere from a full tick down to nearly
zero real time. For small msecs_to_jiffies() results this is
significant, the effective poll window can be much shorter than the
requested 10ms, and in the worst case the loop exits after a single
iteration (e.g., when HZ=100), well before the device has delivered the
CQE.
Replace the loop with read_poll_timeout_atomic(), which counts elapsed
time via udelay() accounting rather than jiffies, guaranteeing the full
poll window regardless of HZ.
Additionally, read_poll_timeout_atomic() executes the poll operation one
more time after the timeout has expired, giving the CQE a final chance
to be detected. The old do-while loop could exit without a final poll if
the timeout expired during the udelay() between iterations.
Fixes: 76e463f6508b ("net/mlx5e: Overcome slow response for first IPsec ASO WQE")
Signed-off-by: Gal Pressman <gal@nvidia.com>
Reviewed-by: Jianbo Liu <jianbol@nvidia.com>
Signed-off-by: Tariq Toukan <tariqt@nvidia.com>
---
.../mellanox/mlx5/core/en_accel/ipsec_offload.c | 12 ++++--------
1 file changed, 4 insertions(+), 8 deletions(-)
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_accel/ipsec_offload.c b/drivers/net/ethernet/mellanox/mlx5/core/en_accel/ipsec_offload.c
index 05faad5083d9..145677ce9640 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en_accel/ipsec_offload.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en_accel/ipsec_offload.c
@@ -1,6 +1,8 @@
// SPDX-License-Identifier: GPL-2.0 OR Linux-OpenIB
/* Copyright (c) 2017, Mellanox Technologies inc. All rights reserved. */
+#include <linux/iopoll.h>
+
#include "mlx5_core.h"
#include "en.h"
#include "ipsec.h"
@@ -592,7 +594,6 @@ int mlx5e_ipsec_aso_query(struct mlx5e_ipsec_sa_entry *sa_entry,
struct mlx5_wqe_aso_ctrl_seg *ctrl;
struct mlx5e_hw_objs *res;
struct mlx5_aso_wqe *wqe;
- unsigned long expires;
u8 ds_cnt;
int ret;
@@ -614,13 +615,8 @@ int mlx5e_ipsec_aso_query(struct mlx5e_ipsec_sa_entry *sa_entry,
mlx5e_ipsec_aso_copy(ctrl, data);
mlx5_aso_post_wqe(aso->aso, false, &wqe->ctrl);
- expires = jiffies + msecs_to_jiffies(10);
- do {
- ret = mlx5_aso_poll_cq(aso->aso, false);
- if (ret)
- /* We are in atomic context */
- udelay(10);
- } while (ret && time_is_after_jiffies(expires));
+ read_poll_timeout_atomic(mlx5_aso_poll_cq, ret, !ret, 10,
+ 10 * USEC_PER_MSEC, false, aso->aso, false);
if (!ret)
memcpy(sa_entry->ctx, aso->ctx, MLX5_ST_SZ_BYTES(ipsec_aso));
spin_unlock_bh(&aso->lock);
--
2.44.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-04-09 20:29 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-04-09 20:28 [PATCH net 0/2] mlx5 misc fixes 2026-04-09 Tariq Toukan
2026-04-09 20:28 ` [PATCH net 1/2] net/mlx5e: Fix features not applied during netdev registration Tariq Toukan
2026-04-09 20:28 ` [PATCH net 2/2] net/mlx5e: IPsec, fix ASO poll timeout with read_poll_timeout_atomic() Tariq Toukan
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox