[v3,2/5] net/mlx5/hws: allow destroying rule resources on error
Checks
Commit Message
From: Alex Vesker <valex@nvidia.com>
In case the send engine is in error state API should provide
a way to free rule resources and provide a fake completion.
Otherwise there is no way to release these resources.
Signed-off-by: Alex Vesker <valex@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
---
drivers/net/mlx5/hws/mlx5dr_rule.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
@@ -521,6 +521,11 @@ static int mlx5dr_rule_destroy_hws(struct mlx5dr_rule *rule,
queue = &ctx->send_queue[attr->queue_id];
+ if (unlikely(mlx5dr_send_engine_err(queue))) {
+ mlx5dr_rule_destroy_failed_hws(rule, attr);
+ return 0;
+ }
+
/* Rule is not completed yet */
if (rule->status == MLX5DR_RULE_STATUS_CREATING) {
rte_errno = EBUSY;
@@ -533,11 +538,6 @@ static int mlx5dr_rule_destroy_hws(struct mlx5dr_rule *rule,
return 0;
}
- if (unlikely(mlx5dr_send_engine_err(queue))) {
- mlx5dr_rule_destroy_failed_hws(rule, attr);
- return 0;
- }
-
mlx5dr_send_engine_inc_rule(queue);
/* Send dependent WQE */