* [PATCH net-next 0/5] net/mlx5: HWS misc enhancements
@ 2026-07-23 9:53 Tariq Toukan
2026-07-23 9:53 ` [PATCH net-next 1/5] net/mlx5: HWS, Print more details for bad completion Tariq Toukan
` (4 more replies)
0 siblings, 5 replies; 6+ messages in thread
From: Tariq Toukan @ 2026-07-23 9:53 UTC (permalink / raw)
To: Andrew Lunn, David S. Miller, Eric Dumazet, Jakub Kicinski,
netdev, Paolo Abeni
Cc: Akiva Goldberger, Alexei Lazar, Alex Vesker, Cosmin Ratiu,
Dragos Tatulea, Erez Shitrit, Feng Liu, Gal Pressman, Kees Cook,
Leon Romanovsky, linux-kernel, linux-rdma, Mark Bloch,
Moshe Shemesh, Parav Pandit, Saeed Mahameed, Simon Horman,
Tariq Toukan, Vlad Dogaru, Yevgeny Kliteynik
Hi,
This series by Yevgeny brings several misc improvements to the mlx5 HWS
driver.
Regards,
Tariq
Yevgeny Kliteynik (5):
net/mlx5: HWS, Print more details for bad completion
net/mlx5: HWS, Log syndrome on STC modify failure
net/mlx5: HWS, Set the num of queues only when alloc succeeded
net/mlx5: HWS, Remove redundant MLX5_SET in RTC creation
net/mlx5: HWS, Remove redundant FW command when reading caps
.../mellanox/mlx5/core/steering/hws/cmd.c | 15 ++--
.../mellanox/mlx5/core/steering/hws/send.c | 72 +++++++++++++------
2 files changed, 56 insertions(+), 31 deletions(-)
base-commit: 1df10cef2d1e7f9f2fb7eddb67fc70d3abf101f9
--
2.44.0
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH net-next 1/5] net/mlx5: HWS, Print more details for bad completion
2026-07-23 9:53 [PATCH net-next 0/5] net/mlx5: HWS misc enhancements Tariq Toukan
@ 2026-07-23 9:53 ` Tariq Toukan
2026-07-23 9:53 ` [PATCH net-next 2/5] net/mlx5: HWS, Log syndrome on STC modify failure Tariq Toukan
` (3 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: Tariq Toukan @ 2026-07-23 9:53 UTC (permalink / raw)
To: Andrew Lunn, David S. Miller, Eric Dumazet, Jakub Kicinski,
netdev, Paolo Abeni
Cc: Akiva Goldberger, Alexei Lazar, Alex Vesker, Cosmin Ratiu,
Dragos Tatulea, Erez Shitrit, Feng Liu, Gal Pressman, Kees Cook,
Leon Romanovsky, linux-kernel, linux-rdma, Mark Bloch,
Moshe Shemesh, Parav Pandit, Saeed Mahameed, Simon Horman,
Tariq Toukan, Vlad Dogaru, Yevgeny Kliteynik
From: Yevgeny Kliteynik <kliteyn@nvidia.com>
When polling for completion returned completion with error,
parse some more details: QP number and WQE count.
Also, extract all the long value-to-string if conditions
to a short value-to-string functions: do it for rule
resize state, rule status, and syndrome.
Signed-off-by: Yevgeny Kliteynik <kliteyn@nvidia.com>
Reviewed-by: Erez Shitrit <erezsh@nvidia.com>
Signed-off-by: Tariq Toukan <tariqt@nvidia.com>
---
.../mellanox/mlx5/core/steering/hws/send.c | 68 +++++++++++++------
1 file changed, 49 insertions(+), 19 deletions(-)
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/send.c b/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/send.c
index aed009aec4fe..1c9206f74aaa 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/send.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/send.c
@@ -344,6 +344,36 @@ hws_send_engine_update_rule_resize(struct mlx5hws_send_engine *queue,
}
}
+static const char *hws_rule_status_to_string(enum mlx5hws_rule_status status)
+{
+ switch (status) {
+ case MLX5HWS_RULE_STATUS_CREATING: return "CREATING";
+ case MLX5HWS_RULE_STATUS_UPDATING: return "UPDATING";
+ case MLX5HWS_RULE_STATUS_DELETING: return "DELETING";
+ case MLX5HWS_RULE_STATUS_FAILING: return "FAILING";
+ default: return "NA";
+ }
+}
+
+static const char *hws_rule_resize_state_to_string(u8 state)
+{
+ switch (state) {
+ case MLX5HWS_RULE_RESIZE_STATE_IDLE: return "IDLE";
+ case MLX5HWS_RULE_RESIZE_STATE_WRITING: return "WRITING";
+ case MLX5HWS_RULE_RESIZE_STATE_DELETING: return "DELETING";
+ default: return "UNKNOWN";
+ }
+}
+
+static const char *hws_gta_syndrome_to_string(u8 syndrome)
+{
+ switch (syndrome) {
+ case 1: return "SET_FLOW_FAIL";
+ case 2: return "DISABLE_FLOW_FAIL";
+ default: return "UNKNOWN";
+ }
+}
+
static void hws_send_engine_dump_error_cqe(struct mlx5hws_send_engine *queue,
struct mlx5hws_send_ring_priv *priv,
struct mlx5_cqe64 *cqe)
@@ -352,6 +382,7 @@ static void hws_send_engine_dump_error_cqe(struct mlx5hws_send_engine *queue,
struct mlx5hws_context *ctx = priv->rule->matcher->tbl->ctx;
u32 opcode = cqe ? get_cqe_opcode(cqe) : 0;
struct mlx5hws_rule *rule = priv->rule;
+ u8 syndrome;
/* If something bad happens and lots of rules are failing, we don't
* want to pollute dmesg. Print only the first bad cqe per engine,
@@ -364,26 +395,17 @@ static void hws_send_engine_dump_error_cqe(struct mlx5hws_send_engine *queue,
if (mlx5hws_rule_move_in_progress(rule))
mlx5hws_err(ctx,
- "--- rule 0x%08llx: error completion moving rule: phase %s, wqes left %d\n",
+ "--- rule 0x%08llx: error completion moving rule: phase %s (%d), wqes left %d\n",
HWS_PTR_TO_ID(rule),
- rule->resize_info->state ==
- MLX5HWS_RULE_RESIZE_STATE_WRITING ? "WRITING" :
- rule->resize_info->state ==
- MLX5HWS_RULE_RESIZE_STATE_DELETING ? "DELETING" :
- "UNKNOWN",
+ hws_rule_resize_state_to_string
+ (rule->resize_info->state),
+ rule->resize_info->state,
rule->pending_wqes);
else
mlx5hws_err(ctx,
"--- rule 0x%08llx: error completion %s (%d), wqes left %d\n",
HWS_PTR_TO_ID(rule),
- rule->status ==
- MLX5HWS_RULE_STATUS_CREATING ? "CREATING" :
- rule->status ==
- MLX5HWS_RULE_STATUS_DELETING ? "DELETING" :
- rule->status ==
- MLX5HWS_RULE_STATUS_FAILING ? "FAILING" :
- rule->status ==
- MLX5HWS_RULE_STATUS_UPDATING ? "UPDATING" : "NA",
+ hws_rule_status_to_string(rule->status),
rule->status,
rule->pending_wqes);
@@ -423,6 +445,15 @@ static void hws_send_engine_dump_error_cqe(struct mlx5hws_send_engine *queue,
" rule 0x%08llx: |--- syndrome = 0x%x\n",
HWS_PTR_TO_ID(rule),
err_cqe->syndrome);
+ mlx5hws_err(ctx,
+ " rule 0x%08llx: |--- QPN = 0x%x\n",
+ HWS_PTR_TO_ID(rule),
+ be32_to_cpu(err_cqe->s_wqe_opcode_qpn) &
+ 0xffffff);
+ mlx5hws_err(ctx,
+ " rule 0x%08llx: |--- WQE_CNT = 0x%04x\n",
+ HWS_PTR_TO_ID(rule),
+ (u32)be16_to_cpu(err_cqe->wqe_counter));
}
mlx5hws_err(ctx,
@@ -433,13 +464,12 @@ static void hws_send_engine_dump_error_cqe(struct mlx5hws_send_engine *queue,
HWS_PTR_TO_ID(rule),
(be32_to_cpu(cqe->byte_cnt) & 0x80000000) ?
"FAILURE" : "SUCCESS");
+ /* syndrome is in the lower 2 bits of byte_cnt */
+ syndrome = be32_to_cpu(cqe->byte_cnt) & 3;
mlx5hws_err(ctx,
- " rule 0x%08llx: |------- SYNDROME = %s\n",
+ " rule 0x%08llx: |------- SYNDROME = %s (%u)\n",
HWS_PTR_TO_ID(rule),
- ((be32_to_cpu(cqe->byte_cnt) & 0x00000003) == 1) ?
- "SET_FLOW_FAIL" :
- ((be32_to_cpu(cqe->byte_cnt) & 0x00000003) == 2) ?
- "DISABLE_FLOW_FAIL" : "UNKNOWN");
+ hws_gta_syndrome_to_string(syndrome), syndrome);
mlx5hws_err(ctx,
" rule 0x%08llx: cqe->sop_drop_qpn = 0x%08x\n",
HWS_PTR_TO_ID(rule), be32_to_cpu(cqe->sop_drop_qpn));
--
2.44.0
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH net-next 2/5] net/mlx5: HWS, Log syndrome on STC modify failure
2026-07-23 9:53 [PATCH net-next 0/5] net/mlx5: HWS misc enhancements Tariq Toukan
2026-07-23 9:53 ` [PATCH net-next 1/5] net/mlx5: HWS, Print more details for bad completion Tariq Toukan
@ 2026-07-23 9:53 ` Tariq Toukan
2026-07-23 9:53 ` [PATCH net-next 3/5] net/mlx5: HWS, Set the num of queues only when alloc succeeded Tariq Toukan
` (2 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: Tariq Toukan @ 2026-07-23 9:53 UTC (permalink / raw)
To: Andrew Lunn, David S. Miller, Eric Dumazet, Jakub Kicinski,
netdev, Paolo Abeni
Cc: Akiva Goldberger, Alexei Lazar, Alex Vesker, Cosmin Ratiu,
Dragos Tatulea, Erez Shitrit, Feng Liu, Gal Pressman, Kees Cook,
Leon Romanovsky, linux-kernel, linux-rdma, Mark Bloch,
Moshe Shemesh, Parav Pandit, Saeed Mahameed, Simon Horman,
Tariq Toukan, Vlad Dogaru, Yevgeny Kliteynik
From: Yevgeny Kliteynik <kliteyn@nvidia.com>
When mlx5_cmd_exec fails for STC modify, include the command syndrome
from the output buffer in the error message to aid debugging.
Signed-off-by: Yevgeny Kliteynik <kliteyn@nvidia.com>
Reviewed-by: Erez Shitrit <erezsh@nvidia.com>
Signed-off-by: Tariq Toukan <tariqt@nvidia.com>
---
.../net/ethernet/mellanox/mlx5/core/steering/hws/cmd.c | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/cmd.c b/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/cmd.c
index e624f5da96c8..c04ac970705b 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/cmd.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/cmd.c
@@ -611,9 +611,11 @@ int mlx5hws_cmd_stc_modify(struct mlx5_core_dev *mdev,
ret = mlx5_cmd_exec(mdev, in, sizeof(in), out, sizeof(out));
if (ret)
- mlx5_core_err(mdev, "Failed to modify STC FW action_type %d\n",
- stc_attr->action_type);
-
+ mlx5_core_err(mdev,
+ "Failed to modify STC action_type %d, err %d, syndrome 0x%x\n",
+ stc_attr->action_type, ret,
+ MLX5_GET(general_obj_out_cmd_hdr,
+ out, syndrome));
return ret;
}
--
2.44.0
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH net-next 3/5] net/mlx5: HWS, Set the num of queues only when alloc succeeded
2026-07-23 9:53 [PATCH net-next 0/5] net/mlx5: HWS misc enhancements Tariq Toukan
2026-07-23 9:53 ` [PATCH net-next 1/5] net/mlx5: HWS, Print more details for bad completion Tariq Toukan
2026-07-23 9:53 ` [PATCH net-next 2/5] net/mlx5: HWS, Log syndrome on STC modify failure Tariq Toukan
@ 2026-07-23 9:53 ` Tariq Toukan
2026-07-23 9:53 ` [PATCH net-next 4/5] net/mlx5: HWS, Remove redundant MLX5_SET in RTC creation Tariq Toukan
2026-07-23 9:53 ` [PATCH net-next 5/5] net/mlx5: HWS, Remove redundant FW command when reading caps Tariq Toukan
4 siblings, 0 replies; 6+ messages in thread
From: Tariq Toukan @ 2026-07-23 9:53 UTC (permalink / raw)
To: Andrew Lunn, David S. Miller, Eric Dumazet, Jakub Kicinski,
netdev, Paolo Abeni
Cc: Akiva Goldberger, Alexei Lazar, Alex Vesker, Cosmin Ratiu,
Dragos Tatulea, Erez Shitrit, Feng Liu, Gal Pressman, Kees Cook,
Leon Romanovsky, linux-kernel, linux-rdma, Mark Bloch,
Moshe Shemesh, Parav Pandit, Saeed Mahameed, Simon Horman,
Tariq Toukan, Vlad Dogaru, Yevgeny Kliteynik
From: Yevgeny Kliteynik <kliteyn@nvidia.com>
When initializing send queues, set the number of queues only
when allocations are over.
Signed-off-by: Yevgeny Kliteynik <kliteyn@nvidia.com>
Reviewed-by: Erez Shitrit <erezsh@nvidia.com>
Signed-off-by: Tariq Toukan <tariqt@nvidia.com>
---
drivers/net/ethernet/mellanox/mlx5/core/steering/hws/send.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/send.c b/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/send.c
index 1c9206f74aaa..f0c3a2bda0c7 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/send.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/send.c
@@ -1121,8 +1121,6 @@ static int hws_bwc_send_queues_init(struct mlx5hws_context *ctx)
if (!mlx5hws_context_bwc_supported(ctx))
return 0;
- ctx->queues += bwc_queues;
-
ctx->bwc_send_queue_locks = kzalloc_objs(*ctx->bwc_send_queue_locks,
bwc_queues);
@@ -1134,6 +1132,8 @@ static int hws_bwc_send_queues_init(struct mlx5hws_context *ctx)
if (!ctx->bwc_lock_class_keys)
goto err_lock_class_keys;
+ ctx->queues += bwc_queues;
+
for (i = 0; i < bwc_queues; i++) {
mutex_init(&ctx->bwc_send_queue_locks[i]);
lockdep_register_key(ctx->bwc_lock_class_keys + i);
--
2.44.0
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH net-next 4/5] net/mlx5: HWS, Remove redundant MLX5_SET in RTC creation
2026-07-23 9:53 [PATCH net-next 0/5] net/mlx5: HWS misc enhancements Tariq Toukan
` (2 preceding siblings ...)
2026-07-23 9:53 ` [PATCH net-next 3/5] net/mlx5: HWS, Set the num of queues only when alloc succeeded Tariq Toukan
@ 2026-07-23 9:53 ` Tariq Toukan
2026-07-23 9:53 ` [PATCH net-next 5/5] net/mlx5: HWS, Remove redundant FW command when reading caps Tariq Toukan
4 siblings, 0 replies; 6+ messages in thread
From: Tariq Toukan @ 2026-07-23 9:53 UTC (permalink / raw)
To: Andrew Lunn, David S. Miller, Eric Dumazet, Jakub Kicinski,
netdev, Paolo Abeni
Cc: Akiva Goldberger, Alexei Lazar, Alex Vesker, Cosmin Ratiu,
Dragos Tatulea, Erez Shitrit, Feng Liu, Gal Pressman, Kees Cook,
Leon Romanovsky, linux-kernel, linux-rdma, Mark Bloch,
Moshe Shemesh, Parav Pandit, Saeed Mahameed, Simon Horman,
Tariq Toukan, Vlad Dogaru, Yevgeny Kliteynik
From: Yevgeny Kliteynik <kliteyn@nvidia.com>
Remove duplicated setting of field in mlx5hws_cmd_rtc_create().
Signed-off-by: Yevgeny Kliteynik <kliteyn@nvidia.com>
Reviewed-by: Erez Shitrit <erezsh@nvidia.com>
Signed-off-by: Tariq Toukan <tariqt@nvidia.com>
---
drivers/net/ethernet/mellanox/mlx5/core/steering/hws/cmd.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/cmd.c b/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/cmd.c
index c04ac970705b..c645b7e4bd98 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/cmd.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/cmd.c
@@ -398,7 +398,6 @@ int mlx5hws_cmd_rtc_create(struct mlx5_core_dev *mdev,
MLX5_SET(rtc, attr, update_method, rtc_attr->fw_gen_wqe);
MLX5_SET(rtc, attr, update_index_mode, rtc_attr->update_index_mode);
MLX5_SET(rtc, attr, access_index_mode, rtc_attr->access_index_mode);
- MLX5_SET(rtc, attr, num_hash_definer, rtc_attr->num_hash_definer);
MLX5_SET(rtc, attr, log_depth, rtc_attr->log_depth);
MLX5_SET(rtc, attr, log_hash_size, rtc_attr->log_size);
MLX5_SET(rtc, attr, table_type, rtc_attr->table_type);
--
2.44.0
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH net-next 5/5] net/mlx5: HWS, Remove redundant FW command when reading caps
2026-07-23 9:53 [PATCH net-next 0/5] net/mlx5: HWS misc enhancements Tariq Toukan
` (3 preceding siblings ...)
2026-07-23 9:53 ` [PATCH net-next 4/5] net/mlx5: HWS, Remove redundant MLX5_SET in RTC creation Tariq Toukan
@ 2026-07-23 9:53 ` Tariq Toukan
4 siblings, 0 replies; 6+ messages in thread
From: Tariq Toukan @ 2026-07-23 9:53 UTC (permalink / raw)
To: Andrew Lunn, David S. Miller, Eric Dumazet, Jakub Kicinski,
netdev, Paolo Abeni
Cc: Akiva Goldberger, Alexei Lazar, Alex Vesker, Cosmin Ratiu,
Dragos Tatulea, Erez Shitrit, Feng Liu, Gal Pressman, Kees Cook,
Leon Romanovsky, linux-kernel, linux-rdma, Mark Bloch,
Moshe Shemesh, Parav Pandit, Saeed Mahameed, Simon Horman,
Tariq Toukan, Vlad Dogaru, Yevgeny Kliteynik
From: Yevgeny Kliteynik <kliteyn@nvidia.com>
Remove redundant FW query that isn't really in use.
Signed-off-by: Yevgeny Kliteynik <kliteyn@nvidia.com>
Reviewed-by: Erez Shitrit <erezsh@nvidia.com>
Signed-off-by: Tariq Toukan <tariqt@nvidia.com>
---
drivers/net/ethernet/mellanox/mlx5/core/steering/hws/cmd.c | 6 ------
1 file changed, 6 deletions(-)
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/cmd.c b/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/cmd.c
index c645b7e4bd98..afe5818294d9 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/cmd.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/cmd.c
@@ -1182,12 +1182,6 @@ int mlx5hws_cmd_query_caps(struct mlx5_core_dev *mdev,
capability.esw_cap.merged_eswitch);
}
- ret = mlx5_cmd_exec(mdev, in, sizeof(in), out, out_size);
- if (ret) {
- mlx5_core_err(mdev, "Failed to query device attributes\n");
- goto out;
- }
-
snprintf(caps->fw_ver, sizeof(caps->fw_ver), "%d.%d.%d",
fw_rev_maj(mdev), fw_rev_min(mdev), fw_rev_sub(mdev));
--
2.44.0
^ permalink raw reply related [flat|nested] 6+ messages in thread
end of thread, other threads:[~2026-07-23 9:55 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-23 9:53 [PATCH net-next 0/5] net/mlx5: HWS misc enhancements Tariq Toukan
2026-07-23 9:53 ` [PATCH net-next 1/5] net/mlx5: HWS, Print more details for bad completion Tariq Toukan
2026-07-23 9:53 ` [PATCH net-next 2/5] net/mlx5: HWS, Log syndrome on STC modify failure Tariq Toukan
2026-07-23 9:53 ` [PATCH net-next 3/5] net/mlx5: HWS, Set the num of queues only when alloc succeeded Tariq Toukan
2026-07-23 9:53 ` [PATCH net-next 4/5] net/mlx5: HWS, Remove redundant MLX5_SET in RTC creation Tariq Toukan
2026-07-23 9:53 ` [PATCH net-next 5/5] net/mlx5: HWS, Remove redundant FW command when reading caps Tariq Toukan
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox