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")
Cc: [email protected]

Signed-off-by: Itamar Gozlan <[email protected]>
Acked-by: Bing Zhao <[email protected]>
---
 drivers/net/mlx5/hws/mlx5dr_rule.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/mlx5/hws/mlx5dr_rule.c 
b/drivers/net/mlx5/hws/mlx5dr_rule.c
index 878224d8b3f..895ac858eca 100644
--- a/drivers/net/mlx5/hws/mlx5dr_rule.c
+++ b/drivers/net/mlx5/hws/mlx5dr_rule.c
@@ -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;
-- 
2.21.0

Reply via email to