]> git.baikalelectronics.ru Git - kernel.git/commit
net: sched: fix notifications for action-held chains
authorJiri Pirko <jiri@mellanox.com>
Wed, 1 Aug 2018 10:36:56 +0000 (12:36 +0200)
committerDavid S. Miller <davem@davemloft.net>
Wed, 1 Aug 2018 17:06:19 +0000 (10:06 -0700)
commitb02d346e397c921113eefbb5e24046d14f0a0d7a
tree72d78f70e4d8ac4f0c2e8069340990d75f3a84c2
parentb2aac4b3165f8eeb61630b80d74caa402bd80710
net: sched: fix notifications for action-held chains

Chains that only have action references serve as placeholders.
Until a non-action reference is created, user should not be aware
of the chain. Also he should not receive any notifications about it.
So send notifications for the new chain only in case the chain gets
the first non-action reference. Symmetrically to that, when
the last non-action reference is dropped, send the notification about
deleted chain.

Reported-by: Cong Wang <xiyou.wangcong@gmail.com>
Signed-off-by: Jiri Pirko <jiri@mellanox.com>
Acked-by: Cong Wang <xiyou.wangcong@gmail.com>
v1->v2:
- made __tcf_chain_{get,put}() static as suggested by Cong

Signed-off-by: David S. Miller <davem@davemloft.net>
net/sched/cls_api.c