Blame SOURCES/0285-netdrv-net-mlx5-Fix-cleaning-unmanaged-flow-tables.patch

d8f823
From db6d49db1b50825fc1d5efde0d113fea05ab412a Mon Sep 17 00:00:00 2001
d8f823
From: Alaa Hleihel <ahleihel@redhat.com>
d8f823
Date: Mon, 1 Jun 2020 15:40:38 -0400
d8f823
Subject: [PATCH 285/312] [netdrv] net/mlx5: Fix cleaning unmanaged flow tables
d8f823
d8f823
Message-id: <20200601154102.25980-16-ahleihel@redhat.com>
d8f823
Patchwork-id: 315720
d8f823
Patchwork-instance: patchwork
d8f823
O-Subject: [RHEL8.3 BZ 1842258 15/39] net/mlx5: Fix cleaning unmanaged flow tables
d8f823
Bugzilla: 1842258 1840408
d8f823
RH-Acked-by: Honggang Li <honli@redhat.com>
d8f823
RH-Acked-by: Kamal Heib <kheib@redhat.com>
d8f823
RH-Acked-by: Marcelo Leitner <mleitner@redhat.com>
d8f823
RH-Acked-by: Jarod Wilson <jarod@redhat.com>
d8f823
d8f823
Bugzilla: http://bugzilla.redhat.com/1842258
d8f823
Bugzilla: http://bugzilla.redhat.com/1840408
d8f823
Upstream: v5.7-rc7
d8f823
d8f823
commit aee37f3d940ca732df71c3df49347bccaafc0b24
d8f823
Author: Roi Dayan <roid@mellanox.com>
d8f823
Date:   Mon May 11 16:32:09 2020 +0300
d8f823
d8f823
    net/mlx5: Fix cleaning unmanaged flow tables
d8f823
d8f823
    Unmanaged flow tables doesn't have a parent and tree_put_node()
d8f823
    assume there is always a parent if cleaning is needed. fix that.
d8f823
d8f823
    Fixes: 5281a0c90919 ("net/mlx5: fs_core: Introduce unmanaged flow tables")
d8f823
    Signed-off-by: Roi Dayan <roid@mellanox.com>
d8f823
    Reviewed-by: Mark Bloch <markb@mellanox.com>
d8f823
    Reviewed-by: Paul Blakey <paulb@mellanox.com>
d8f823
    Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
d8f823
d8f823
Signed-off-by: Alaa Hleihel <ahleihel@redhat.com>
d8f823
Signed-off-by: Frantisek Hrbata <fhrbata@redhat.com>
d8f823
---
d8f823
 drivers/net/ethernet/mellanox/mlx5/core/fs_core.c | 11 ++++++-----
d8f823
 1 file changed, 6 insertions(+), 5 deletions(-)
d8f823
d8f823
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/fs_core.c b/drivers/net/ethernet/mellanox/mlx5/core/fs_core.c
d8f823
index f44e366ecfa8..6927d9a1c910 100644
d8f823
--- a/drivers/net/ethernet/mellanox/mlx5/core/fs_core.c
d8f823
+++ b/drivers/net/ethernet/mellanox/mlx5/core/fs_core.c
d8f823
@@ -323,14 +323,13 @@ static void tree_put_node(struct fs_node *node, bool locked)
d8f823
 		if (node->del_hw_func)
d8f823
 			node->del_hw_func(node);
d8f823
 		if (parent_node) {
d8f823
-			/* Only root namespace doesn't have parent and we just
d8f823
-			 * need to free its node.
d8f823
-			 */
d8f823
 			down_write_ref_node(parent_node, locked);
d8f823
 			list_del_init(&node->list);
d8f823
 			if (node->del_sw_func)
d8f823
 				node->del_sw_func(node);
d8f823
 			up_write_ref_node(parent_node, locked);
d8f823
+		} else if (node->del_sw_func) {
d8f823
+			node->del_sw_func(node);
d8f823
 		} else {
d8f823
 			kfree(node);
d8f823
 		}
d8f823
@@ -447,8 +446,10 @@ static void del_sw_flow_table(struct fs_node *node)
d8f823
 	fs_get_obj(ft, node);
d8f823
 
d8f823
 	rhltable_destroy(&ft->fgs_hash);
d8f823
-	fs_get_obj(prio, ft->node.parent);
d8f823
-	prio->num_ft--;
d8f823
+	if (ft->node.parent) {
d8f823
+		fs_get_obj(prio, ft->node.parent);
d8f823
+		prio->num_ft--;
d8f823
+	}
d8f823
 	kfree(ft);
d8f823
 }
d8f823
 
d8f823
-- 
d8f823
2.13.6
d8f823