Re: [PATCH net] net/sched: properly init chain in case of multiple control actions

2018-10-18 Thread Davide Caratti
On Wed, 2018-10-17 at 22:35 -0700, Cong Wang wrote: > > (well, after some more thinking I looked again at that patch and yes, it > > lacked the most important thing:) > > Hmm, as I said, I am not sure if the logic is correct, if we have two > different > goto actions, we must have two pointers. >

Re: [PATCH net] net/sched: properly init chain in case of multiple control actions

2018-10-17 Thread Cong Wang
On Tue, Oct 16, 2018 at 10:38 AM Davide Caratti wrote: > > On Mon, 2018-10-15 at 11:31 -0700, Cong Wang wrote: > > On Sat, Oct 13, 2018 at 8:23 AM Davide Caratti wrote: > > > > > > On Fri, 2018-10-12 at 13:57 -0700, Cong Wang wrote: > > > > Why not just validate the fallback action in each action

Re: [PATCH net] net/sched: properly init chain in case of multiple control actions

2018-10-16 Thread Davide Caratti
On Mon, 2018-10-15 at 11:31 -0700, Cong Wang wrote: > On Sat, Oct 13, 2018 at 8:23 AM Davide Caratti wrote: > > > > On Fri, 2018-10-12 at 13:57 -0700, Cong Wang wrote: > > > Why not just validate the fallback action in each action init()? > > > For example, checking tcfg_paction in tcf_gact_init(

Re: [PATCH net] net/sched: properly init chain in case of multiple control actions

2018-10-15 Thread Cong Wang
On Sat, Oct 13, 2018 at 8:23 AM Davide Caratti wrote: > > On Fri, 2018-10-12 at 13:57 -0700, Cong Wang wrote: > > Why not just validate the fallback action in each action init()? > > For example, checking tcfg_paction in tcf_gact_init(). > > > > I don't see the need of making it generic. > > hello

Re: [PATCH net] net/sched: properly init chain in case of multiple control actions

2018-10-14 Thread Davide Caratti
On Sun, 2018-10-14 at 09:46 -0400, Jamal Hadi Salim wrote: > On 2018-10-13 11:23 a.m., Davide Caratti wrote: > > > > A (legal?) trick is to let tcf_action store the fallback action when it > > contains a 'goto chain' command, I just posted a proposal for gact. If you > > think it's ok, I will tes

Re: [PATCH net] net/sched: properly init chain in case of multiple control actions

2018-10-14 Thread Jamal Hadi Salim
On 2018-10-13 11:23 a.m., Davide Caratti wrote: On Fri, 2018-10-12 at 13:57 -0700, Cong Wang wrote: Why not just validate the fallback action in each action init()? For example, checking tcfg_paction in tcf_gact_init(). I don't see the need of making it generic. hello Cong, once again thanks

Re: [PATCH net] net/sched: properly init chain in case of multiple control actions

2018-10-13 Thread Davide Caratti
On Fri, 2018-10-12 at 13:57 -0700, Cong Wang wrote: > Why not just validate the fallback action in each action init()? > For example, checking tcfg_paction in tcf_gact_init(). > > I don't see the need of making it generic. hello Cong, once again thanks for looking at this. what you say is doable

Re: [PATCH net] net/sched: properly init chain in case of multiple control actions

2018-10-12 Thread Cong Wang
On Fri, Oct 12, 2018 at 1:39 PM Davide Caratti wrote: > Several TC actions allow users to specify a fallback control action, that > is usually stored in the action private data. 'goto chain x' never worked > for that case, because the action handler was never initialized. There is > only one 'goto

[PATCH net] net/sched: properly init chain in case of multiple control actions

2018-10-12 Thread Davide Caratti
the following script: # tc f a dev v0 egress chain 4 matchall action simple sdata "A triumph!" # tc f a dev v0 egress matchall action pass random determ goto chain 4 5 produces the following crash: BUG: unable to handle kernel NULL pointer dereference at PGD 0 P4D 0 Oops: 0