On Mon 18 Feb 2019 at 19:55, Cong Wang <xiyou.wangc...@gmail.com> wrote: > On Mon, Feb 18, 2019 at 3:19 AM Vlad Buslov <vla...@mellanox.com> wrote: >> >> >> On Fri 15 Feb 2019 at 23:17, Cong Wang <xiyou.wangc...@gmail.com> wrote: >> > 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? >> >> This lock is intended to be used by unlocked classifiers and I use it in >> my following flower patch set extensively. Classifiers that do not set >> 'unlocked' flag continue to rely on rtnl lock for synchronization. > > It is never late to add it when you seriously use it. The way you > split the patches is really annoying for reviewers...
I made a decision to put all required cls API changes so at this point anyone can implement their own rtnl-unlocked classifier (or refactor existing one for unlocked execution) without any further changes to cls API. However, I can see how this can be confusing to reviewer, especially if they are not familiar with proposed flower changes. I will split my patches according to your suggestions in the future. Thanks, Vlad