Blob Blame History Raw
From: Jiri Pirko <jiri@mellanox.com>
Date: Fri, 13 Oct 2017 14:01:04 +0200
Subject: net: sched: use tcf_block_q helper to get q pointer for sch_tree_lock
Patch-mainline: v4.15-rc1
Git-commit: 74e3be6021d22df2ffcb691eae1affeb2bd0128e
References: bsc#1109837

Use tcf_block_q helper to get q pointer to be used for direct call of
sch_tree_lock/unlock instead of tcf_tree_lock/unlock.

Signed-off-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Acked-by: Thomas Bogendoerfer <tbogendoerfer@suse.de>
---
 include/net/sch_generic.h |    3 ---
 net/sched/sch_api.c       |    6 ++++--
 2 files changed, 4 insertions(+), 5 deletions(-)

--- a/include/net/sch_generic.h
+++ b/include/net/sch_generic.h
@@ -361,9 +361,6 @@ static inline void sch_tree_unlock(const
 	spin_unlock_bh(qdisc_root_sleeping_lock(q));
 }
 
-#define tcf_tree_lock(tp)	sch_tree_lock((tp)->q)
-#define tcf_tree_unlock(tp)	sch_tree_unlock((tp)->q)
-
 extern struct Qdisc noop_qdisc;
 extern struct Qdisc_ops noop_qdisc_ops;
 extern struct Qdisc_ops pfifo_fast_ops;
--- a/net/sched/sch_api.c
+++ b/net/sched/sch_api.c
@@ -1663,9 +1663,11 @@ static int tcf_node_bind(struct tcf_prot
 	struct tcf_bind_args *a = (void *)arg;
 
 	if (tp->ops->bind_class) {
-		tcf_tree_lock(tp);
+		struct Qdisc *q = tcf_block_q(tp->chain->block);
+
+		sch_tree_lock(q);
 		tp->ops->bind_class(n, a->classid, a->cl);
-		tcf_tree_unlock(tp);
+		sch_tree_unlock(q);
 	}
 	return 0;
 }