Re: [PATCH net v2 2/3] net: sched: fix action overwrite reference counting

2021-04-08 Thread Cong Wang
On Thu, Apr 8, 2021 at 4:59 AM Jamal Hadi Salim wrote: > > On 2021-04-07 7:50 p.m., Cong Wang wrote: > > On Wed, Apr 7, 2021 at 8:36 AM Vlad Buslov wrote: > >> > >> Action init code increments reference counter when it changes an action. > >> This is the desired behavior for cls API which needs t

Re: [PATCH net v2 2/3] net: sched: fix action overwrite reference counting

2021-04-08 Thread Cong Wang
On Thu, Apr 8, 2021 at 12:50 AM Vlad Buslov wrote: > > > On Thu 08 Apr 2021 at 02:50, Cong Wang wrote: > > In my last comments, I actually meant whether we can avoid this > > 'init_res[]' array. Since here you want to check whether an action > > returned by tcf_action_init_1() is a new one or an

Re: [PATCH net v2 2/3] net: sched: fix action overwrite reference counting

2021-04-08 Thread Jamal Hadi Salim
On 2021-04-08 3:50 a.m., Vlad Buslov wrote: On Thu 08 Apr 2021 at 02:50, Cong Wang wrote: Origins of setting ovr based on NLM_F_REPLACE are lost since this code goes back to Linus' Linux-2.6.12-rc2 commit. Jamal, do you know if this is the expected behavior or just something unintended? Se

Re: [PATCH net v2 2/3] net: sched: fix action overwrite reference counting

2021-04-08 Thread Jamal Hadi Salim
On 2021-04-07 7:50 p.m., Cong Wang wrote: On Wed, Apr 7, 2021 at 8:36 AM Vlad Buslov wrote: Action init code increments reference counter when it changes an action. This is the desired behavior for cls API which needs to obtain action reference for every classifier that points to action. Howev

Re: [PATCH net v2 2/3] net: sched: fix action overwrite reference counting

2021-04-08 Thread Vlad Buslov
On Thu 08 Apr 2021 at 02:50, Cong Wang wrote: > On Wed, Apr 7, 2021 at 8:36 AM Vlad Buslov wrote: >> >> Action init code increments reference counter when it changes an action. >> This is the desired behavior for cls API which needs to obtain action >> reference for every classifier that points

Re: [PATCH net v2 2/3] net: sched: fix action overwrite reference counting

2021-04-07 Thread Cong Wang
On Wed, Apr 7, 2021 at 8:36 AM Vlad Buslov wrote: > > Action init code increments reference counter when it changes an action. > This is the desired behavior for cls API which needs to obtain action > reference for every classifier that points to action. However, act API just > needs to change the

[PATCH net v2 2/3] net: sched: fix action overwrite reference counting

2021-04-07 Thread Vlad Buslov
Action init code increments reference counter when it changes an action. This is the desired behavior for cls API which needs to obtain action reference for every classifier that points to action. However, act API just needs to change the action and releases the reference before returning. This seq