Skip to contentSkip to conversation

net/mlx5/hws: fix cap check for hash calc

PATCH In review Maayan Kashani 2 participants 2 messages Nov 16, 2025 – Nov 18, 2025 Network drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net/mlx5/hws: fix cap check for hash calc

From: Itamar Gozlan <[email protected]>

Some cases are not supported for rule hash calculation. For example when the matcher defined as FW matcher, or is the hash type is different than CRC32. One case is when the distribute mode is not by hash, the previous condition checked a wrong capability, while this commit fixes it to the correct check.

Fixes 7f5e6de53aae ("net/mlx5/hws: query flow rule hash")
---
 drivers/net/mlx5/hws/mlx5dr_rule.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/mlx5/hws/mlx5dr_rule.c +1 -1
index 878224d8b3f..895ac858eca 100644
@@ -1084,7 +1084,7 @@ int mlx5dr_rule_hash_calculate(struct mlx5dr_matcher *matcher,
 
 	if (mlx5dr_matcher_req_fw_wqe(matcher) ||
 	    mlx5dr_table_is_root(matcher->tbl) ||
-	    matcher->tbl->ctx->caps->access_index_mode == MLX5DR_MATCHER_INSERT_BY_HASH ||
+	    matcher->attr.distribute_mode != MLX5DR_MATCHER_DISTRIBUTE_BY_HASH ||
 	    matcher->tbl->ctx->caps->flow_table_hash_type != MLX5_FLOW_TABLE_HASH_TYPE_CRC32) {
 		DR_LOG(DEBUG, "Matcher is not supported");
 		rte_errno = ENOTSUP;
Signature · 1 line
2.21.0
#1 lore raw

Hi,

Quoted 8 lines · Maayan Kashani

From: Itamar Gozlan <[email protected]>

Some cases are not supported for rule hash calculation. For example when the matcher defined as FW matcher, or is the hash type is different than CRC32. One case is when the distribute mode is not by hash, the previous condition checked a wrong capability, while this commit fixes it to the correct check.

Quoted 5 lines
Fixes 7f5e6de53aae ("net/mlx5/hws: query flow rule hash")

Patch applied to next-net-mlx,

Kindest regards
Raslan Darawsheh