net: sched: set dedicated tcf_walker flag when tp is empty
authorVlad Buslov <vladbu@mellanox.com>
Mon, 25 Feb 2019 15:38:31 +0000 (17:38 +0200)
committerDavid S. Miller <davem@davemloft.net>
Mon, 25 Feb 2019 18:18:17 +0000 (10:18 -0800)
commit6676d5e416eecaf4e823a2c3903aa132ffc2ede0
tree81e76c70ae94703bfa4e235ea6ec5e888606a5e8
parente3af71a36f9a68bd5d5a63d9960c9b624324784f
net: sched: set dedicated tcf_walker flag when tp is empty

Using tcf_walker->stop flag to determine when tcf_walker->fn() was called
at least once is unreliable. Some classifiers set 'stop' flag on error
before calling walker callback, other classifiers used to call it with NULL
filter pointer when empty. In order to prevent further regressions, extend
tcf_walker structure with dedicated 'nonempty' flag. Set this flag in
tcf_walker->fn() implementation that is used to check if classifier has
filters configured.

Fixes: 8b64678e0af8 ("net: sched: refactor tp insert/delete for concurrent execution")
Signed-off-by: Vlad Buslov <vladbu@mellanox.com>
Suggested-by: Cong Wang <xiyou.wangcong@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/net/pkt_cls.h
net/sched/cls_api.c