On Mon, Feb 11, 2019 at 12:56 AM Vlad Buslov <vla...@mellanox.com> wrote: > +static bool tcf_proto_is_empty(struct tcf_proto *tp) > +{ > + struct tcf_walker walker = { .fn = walker_noop, }; > + > + if (tp->ops->walk) { > + tp->ops->walk(tp, &walker); > + return !walker.stop; > + } > + return true; > +} > + > +static bool tcf_proto_check_delete(struct tcf_proto *tp) > +{ > + spin_lock(&tp->lock); > + if (tcf_proto_is_empty(tp)) > + tp->deleting = true; > + spin_unlock(&tp->lock); > + return tp->deleting;
If you use this spinlock for walking each tp data structure, why it is not needed for adding to/deleting filters from each tp?