aboutsummaryrefslogtreecommitdiffstats
path: root/net/sched/act_pedit.c
diff options
context:
space:
mode:
authorVlad Buslov <vladbu@mellanox.com>2018-07-05 17:24:24 +0300
committerDavid S. Miller <davem@davemloft.net>2018-07-08 12:42:28 +0900
commit036bb44327f50273e85ee4a2c9b56eebce1c0838 (patch)
tree7760e998967d7a32ba06550c2c169abab9cc0b19 /net/sched/act_pedit.c
parentnet: sched: use rcu for action cookie update (diff)
downloadlinux-dev-036bb44327f50273e85ee4a2c9b56eebce1c0838.tar.xz
linux-dev-036bb44327f50273e85ee4a2c9b56eebce1c0838.zip
net: sched: change type of reference and bind counters
Change type of action reference counter to refcount_t. Change type of action bind counter to atomic_t. This type is used to allow decrementing bind counter without testing for 0 result. Reviewed-by: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com> Signed-off-by: Vlad Buslov <vladbu@mellanox.com> Signed-off-by: Jiri Pirko <jiri@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/sched/act_pedit.c')
-rw-r--r--net/sched/act_pedit.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/net/sched/act_pedit.c b/net/sched/act_pedit.c
index e43aef28fdac..889690e0ec39 100644
--- a/net/sched/act_pedit.c
+++ b/net/sched/act_pedit.c
@@ -409,8 +409,8 @@ static int tcf_pedit_dump(struct sk_buff *skb, struct tc_action *a,
opt->nkeys = p->tcfp_nkeys;
opt->flags = p->tcfp_flags;
opt->action = p->tcf_action;
- opt->refcnt = p->tcf_refcnt - ref;
- opt->bindcnt = p->tcf_bindcnt - bind;
+ opt->refcnt = refcount_read(&p->tcf_refcnt) - ref;
+ opt->bindcnt = atomic_read(&p->tcf_bindcnt) - bind;
if (p->tcfp_keys_ex) {
tcf_pedit_key_ex_dump(skb, p->tcfp_keys_ex, p->tcfp_nkeys);