From: Yevgeny Kliteynik <klit...@nvidia.com>

If error happens during disconnect of the first matcher in the
list, the matcher should be reconnected back as the first matcher.

Fixes: b81f95ca770d ("net/mlx5/hws: support default miss table")
Cc: sta...@dpdk.org
Signed-off-by: Yevgeny Kliteynik <klit...@nvidia.com>
---
 drivers/net/mlx5/hws/mlx5dr_matcher.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/mlx5/hws/mlx5dr_matcher.c 
b/drivers/net/mlx5/hws/mlx5dr_matcher.c
index 79e7401dfd..2a84145566 100644
--- a/drivers/net/mlx5/hws/mlx5dr_matcher.c
+++ b/drivers/net/mlx5/hws/mlx5dr_matcher.c
@@ -340,7 +340,7 @@ static int mlx5dr_matcher_disconnect(struct mlx5dr_matcher 
*matcher)
        return 0;
 
 matcher_reconnect:
-       if (LIST_EMPTY(&tbl->head))
+       if (LIST_EMPTY(&tbl->head) || prev_matcher == matcher)
                LIST_INSERT_HEAD(&matcher->tbl->head, matcher, next);
        else
                LIST_INSERT_AFTER(prev_matcher, matcher, next);
-- 
2.25.1

Reply via email to