Re: [PATCH net 0/4] net/sched: forbid 'goto_chain' on fallback actions

2018-10-22 Thread Jamal Hadi Salim
police and gact, to let them return an error when users try to set 'goto chain x' in the fallback action. Patch 3/4 and 4/4 add TDC selftest coverage to this new behavior. For the series, Acked-by: Jamal Hadi Salim cheers, jamal

Re: [PATCH net v2] net/sched: act_gact: properly init 'goto chain'

2018-10-18 Thread Jamal Hadi Salim
On 2018-10-18 8:05 a.m., Davide Caratti wrote: 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

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-next 0/9] net: Kernel side filtering for route dumps

2018-10-11 Thread Jamal Hadi Salim
On 2018-10-11 2:44 p.m., David Ahern wrote: On 10/11/18 12:05 PM, Jamal Hadi Salim wrote: On 2018-10-11 1:04 p.m., David Ahern wrote: I meant the general API of users passing filter arguments as attributes to the dump (or values in the header) -- KIND, MASTER, device index, etc

Re: [PATCH net-next 0/9] net: Kernel side filtering for route dumps

2018-10-11 Thread Jamal Hadi Salim
On 2018-10-11 1:04 p.m., David Ahern wrote: You can already filter link dumps by kind. How? By passing in the KIND attribute on a dump request. This type of filtering exists for link dumps, neighbor dumps, fdb dumps. Why is there a push to make route dumps different? Why can't they be

Re: [PATCH net-next 0/9] net: Kernel side filtering for route dumps

2018-10-11 Thread Jamal Hadi Salim
On 2018-10-11 12:16 p.m., David Ahern wrote: IMO, bpf at the fill_info stage is not appropriate. Somewhere before the skb is formed (and nlmsg is built). If you go as far as constructing it, then cBPF per what Sowmini should work; but there will be constructs which are trickier.

Re: [PATCH net-next 0/9] net: Kernel side filtering for route dumps

2018-10-11 Thread Jamal Hadi Salim
On 2018-10-11 11:46 a.m., Sowmini Varadhan wrote: On (10/11/18 08:26), Stephen Hemminger wrote: You can do the something like this already with BPF socket filters. But writing BPF for multi-part messages is hard. Indeed. And I was just experimenting with this for ARP just last week. So to

[PATCH net-next v2 10/12] net: sched: cls_u32: get rid of tp_c

2018-10-08 Thread Jamal Hadi Salim
From: Al Viro Both hnode ->tp_c and tp_c argument of u32_set_parms() the latter is redundant, the former - never read... Signed-off-by: Al Viro Signed-off-by: Jamal Hadi Salim --- net/sched/cls_u32.c | 11 --- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/net/sc

[PATCH net-next v2 07/12] net: sched: cls_u32: clean tc_u_common hashtable

2018-10-08 Thread Jamal Hadi Salim
From: Al Viro * calculate key *once*, not for each hash chain element * let tc_u_hash() return the pointer to chain head rather than index - callers are cleaner that way. Signed-off-by: Al Viro Signed-off-by: Jamal Hadi Salim --- net/sched/cls_u32.c | 24 +--- 1 file

[PATCH net-next v2 05/12] net: sched: cls_u32: get rid of tc_u_knode ->tp

2018-10-08 Thread Jamal Hadi Salim
From: Al Viro not used anymore Signed-off-by: Al Viro Signed-off-by: Jamal Hadi Salim --- net/sched/cls_u32.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/net/sched/cls_u32.c b/net/sched/cls_u32.c index ef0f2e6ec422..810c49ac1bbe 100644 --- a/net/sched/cls_u32.c +++ b/net/sched

[PATCH net-next v2 02/12] net: sched: cls_u32: disallow linking to root hnode

2018-10-08 Thread Jamal Hadi Salim
Signed-off-by: Jamal Hadi Salim --- net/sched/cls_u32.c | 4 1 file changed, 4 insertions(+) diff --git a/net/sched/cls_u32.c b/net/sched/cls_u32.c index 622f4657da94..3357331a80a2 100644 --- a/net/sched/cls_u32.c +++ b/net/sched/cls_u32.c @@ -797,6 +797,10 @@ static int u32_set_parms(struct

[PATCH net-next v2 06/12] net: sched: cls_u32: get rid of tc_u_common ->rcu

2018-10-08 Thread Jamal Hadi Salim
From: Al Viro unused Signed-off-by: Al Viro Signed-off-by: Jamal Hadi Salim --- net/sched/cls_u32.c | 1 - 1 file changed, 1 deletion(-) diff --git a/net/sched/cls_u32.c b/net/sched/cls_u32.c index 810c49ac1bbe..c378168f4562 100644 --- a/net/sched/cls_u32.c +++ b/net/sched/cls_u32.c

[PATCH net-next v2 01/12] net: sched: cls_u32: mark root hnode explicitly

2018-10-08 Thread Jamal Hadi Salim
ring an hnode to be deleted with tp->root won't catch the case when one tp is used to try deleting the root of another. Solution is trivial - mark the root hnodes explicitly upon allocation and check for that. Signed-off-by: Al Viro Signed-off-by: Jamal Hadi Salim --- net/sched/cls_u32.c | 4 +++- 1

[PATCH net-next v2 12/12] net: sched: cls_u32: simplify the hell out u32_delete() emptiness check

2018-10-08 Thread Jamal Hadi Salim
From: Al Viro Now that we have the knode count, we can instantly check if any hnodes are non-empty. And that kills the check for extra references to root hnode - those could happen only if there was a knode to carry such a link. Signed-off-by: Al Viro Signed-off-by: Jamal Hadi Salim --- net

[PATCH net-next v2 04/12] net: sched: cls_u32: get rid of unused argument of u32_destroy_key()

2018-10-08 Thread Jamal Hadi Salim
From: Al Viro Signed-off-by: Al Viro Signed-off-by: Jamal Hadi Salim --- net/sched/cls_u32.c | 13 ++--- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/net/sched/cls_u32.c b/net/sched/cls_u32.c index ce55eea448a0..ef0f2e6ec422 100644 --- a/net/sched/cls_u32.c +++ b/net

[PATCH net-next v2 08/12] net: sched: cls_u32: pass tc_u_common to u32_set_parms() instead of tc_u_hnode

2018-10-08 Thread Jamal Hadi Salim
From: Al Viro the only thing we used ht for was ht->tp_c and callers can get that without going through ->tp_c at all; start with lifting that into the callers, next commits will massage those, eventually removing ->tp_c altogether. Signed-off-by: Al Viro Signed-off-by: Jamal H

[PATCH net-next v2 03/12] net: sched: cls_u32: make sure that divisor is a power of 2

2018-10-08 Thread Jamal Hadi Salim
From: Al Viro Tested by modifying iproute2 to allow sending a divisor > 255 Tested-by: Jamal Hadi Salim Signed-off-by: Al Viro Signed-off-by: Jamal Hadi Salim --- net/sched/cls_u32.c | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/net/sched/cls_u32.c b/net/sc

[PATCH net-next v2 11/12] net: sched: cls_u32: keep track of knodes count in tc_u_common

2018-10-08 Thread Jamal Hadi Salim
From: Al Viro allows to simplify u32_delete() considerably Signed-off-by: Al Viro Signed-off-by: Jamal Hadi Salim --- net/sched/cls_u32.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/net/sched/cls_u32.c b/net/sched/cls_u32.c index 3d4c360f9b0c..61593bee08db 100644 --- a/net

[PATCH net-next v2 00/12] net: sched: cls_u32 Various improvements

2018-10-08 Thread Jamal Hadi Salim
From: Jamal Hadi Salim Various improvements from Al. Changes from version 1: Add missing commit Al Viro (11): net: sched: cls_u32: mark root hnode explicitly net: sched: cls_u32: disallow linking to root hnode net: sched: cls_u32: make sure that divisor is a power of 2 net: sched

[PATCH net-next v2 09/12] net: sched: cls_u32: the tp_c argument of u32_set_parms() is always tp->data

2018-10-08 Thread Jamal Hadi Salim
so anything returned by u32_lookup_key(ht, ...) will have ->ht_up equal to ht. * any knode returned by u32_get(tp, ...) will have ->ht_up->tp_c point to tp->data Signed-off-by: Al Viro Signed-off-by: Jamal Hadi Salim --- net/sched/cls_u32.c | 5 ++--- 1 file changed, 2 in

Re: [PATCH net-next 02/11] net: sched: cls_u32: make sure that divisor is a power of 2

2018-10-08 Thread Jamal Hadi Salim
On 2018-10-08 4:46 a.m., Sergei Shtylyov wrote: Hello! On 07.10.2018 19:38, Jamal Hadi Salim wrote: From: Al Viro Tested by modifying iproute2 to to allow    One "to" is enough, no? :-) Will fix in updated version. cheers, jamal

Re: [PATCH net-next 00/11] net: sched: cls_u32 Various improvements

2018-10-08 Thread Jamal Hadi Salim
On 2018-10-08 2:11 a.m., Al Viro wrote: On Sun, Oct 07, 2018 at 10:55:52PM -0700, David Miller wrote: From: Al Viro Date: Mon, 8 Oct 2018 06:45:15 +0100 Er... Both are due to missing in the very beginning of the series (well, on top of "net: sched: cls_u32: fix hnode refcounting") commit

[PATCH net-next 08/11] net: sched: cls_u32: the tp_c argument of u32_set_parms() is always tp->data

2018-10-07 Thread Jamal Hadi Salim
so anything returned by u32_lookup_key(ht, ...) will have ->ht_up equal to ht. * any knode returned by u32_get(tp, ...) will have ->ht_up->tp_c point to tp->data Signed-off-by: Al Viro Signed-off-by: Jamal Hadi Salim --- net/sched/cls_u32.c | 5 ++--- 1 file changed, 2 in

[PATCH net-next 00/11] net: sched: cls_u32 Various improvements

2018-10-07 Thread Jamal Hadi Salim
From: Jamal Hadi Salim Various improvements from Al. Al Viro (11): net: sched: cls_u32: disallow linking to root hnode net: sched: cls_u32: make sure that divisor is a power of 2 net: sched: cls_u32: get rid of unused argument of u32_destroy_key() net: sched: cls_u32: get rid

[PATCH net-next 05/11] net: sched: cls_u32: get rid of tc_u_common ->rcu

2018-10-07 Thread Jamal Hadi Salim
From: Al Viro unused Signed-off-by: Al Viro Signed-off-by: Jamal Hadi Salim --- net/sched/cls_u32.c | 1 - 1 file changed, 1 deletion(-) diff --git a/net/sched/cls_u32.c b/net/sched/cls_u32.c index 810c49ac1bbe..c378168f4562 100644 --- a/net/sched/cls_u32.c +++ b/net/sched/cls_u32.c

[PATCH net-next 04/11] net: sched: cls_u32: get rid of tc_u_knode ->tp

2018-10-07 Thread Jamal Hadi Salim
From: Al Viro not used anymore Signed-off-by: Al Viro Signed-off-by: Jamal Hadi Salim --- net/sched/cls_u32.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/net/sched/cls_u32.c b/net/sched/cls_u32.c index ef0f2e6ec422..810c49ac1bbe 100644 --- a/net/sched/cls_u32.c +++ b/net/sched

[PATCH net-next 09/11] net: sched: cls_u32: get rid of tp_c

2018-10-07 Thread Jamal Hadi Salim
From: Al Viro Both hnode ->tp_c and tp_c argument of u32_set_parms() the latter is redundant, the former - never read... Signed-off-by: Al Viro Signed-off-by: Jamal Hadi Salim --- net/sched/cls_u32.c | 11 --- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/net/sc

[PATCH net-next 01/11] net: sched: cls_u32: disallow linking to root hnode

2018-10-07 Thread Jamal Hadi Salim
Signed-off-by: Jamal Hadi Salim --- net/sched/cls_u32.c | 4 1 file changed, 4 insertions(+) diff --git a/net/sched/cls_u32.c b/net/sched/cls_u32.c index 622f4657da94..3357331a80a2 100644 --- a/net/sched/cls_u32.c +++ b/net/sched/cls_u32.c @@ -797,6 +797,10 @@ static int u32_set_parms(struct

[PATCH net-next 06/11] net: sched: cls_u32: clean tc_u_common hashtable

2018-10-07 Thread Jamal Hadi Salim
From: Al Viro * calculate key *once*, not for each hash chain element * let tc_u_hash() return the pointer to chain head rather than index - callers are cleaner that way. Signed-off-by: Al Viro Signed-off-by: Jamal Hadi Salim --- net/sched/cls_u32.c | 24 +--- 1 file

[PATCH net-next 07/11] net: sched: cls_u32: pass tc_u_common to u32_set_parms() instead of tc_u_hnode

2018-10-07 Thread Jamal Hadi Salim
From: Al Viro the only thing we used ht for was ht->tp_c and callers can get that without going through ->tp_c at all; start with lifting that into the callers, next commits will massage those, eventually removing ->tp_c altogether. Signed-off-by: Al Viro Signed-off-by: Jamal H

[PATCH net-next 10/11] net: sched: cls_u32: keep track of knodes count in tc_u_common

2018-10-07 Thread Jamal Hadi Salim
From: Al Viro allows to simplify u32_delete() considerably Signed-off-by: Al Viro Signed-off-by: Jamal Hadi Salim --- net/sched/cls_u32.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/net/sched/cls_u32.c b/net/sched/cls_u32.c index 3d4c360f9b0c..61593bee08db 100644 --- a/net

[PATCH net-next 02/11] net: sched: cls_u32: make sure that divisor is a power of 2

2018-10-07 Thread Jamal Hadi Salim
From: Al Viro Tested by modifying iproute2 to to allow sending a divisor > 255 Tested-by: Jamal Hadi Salim Signed-off-by: Al Viro Signed-off-by: Jamal Hadi Salim --- net/sched/cls_u32.c | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/net/sched/cls_u32.c b/net/sc

[PATCH net-next 11/11] net: sched: cls_u32: simplify the hell out u32_delete() emptiness check

2018-10-07 Thread Jamal Hadi Salim
From: Al Viro Now that we have the knode count, we can instantly check if any hnodes are non-empty. And that kills the check for extra references to root hnode - those could happen only if there was a knode to carry such a link. Signed-off-by: Al Viro Signed-off-by: Jamal Hadi Salim --- net

[PATCH net-next 03/11] net: sched: cls_u32: get rid of unused argument of u32_destroy_key()

2018-10-07 Thread Jamal Hadi Salim
From: Al Viro Signed-off-by: Al Viro Signed-off-by: Jamal Hadi Salim --- net/sched/cls_u32.c | 13 ++--- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/net/sched/cls_u32.c b/net/sched/cls_u32.c index ce55eea448a0..ef0f2e6ec422 100644 --- a/net/sched/cls_u32.c +++ b/net

[PATCH net 1/1] net: sched: cls_u32: fix hnode refcounting

2018-10-07 Thread Jamal Hadi Salim
handle 1:0:11 u32 ht 1: link 0: offset at 0 mask 0f00 shift 6 plus 0 \ eat match ip protocol 6 ff tc filter delete dev eth0 parent : protocol ip prio 100 Signed-off-by: Al Viro Signed-off-by: Jamal Hadi Salim --- net/sched/cls_u32.c | 10 +- 1 file changed, 5 insertions(+), 5 deleti

Re: Offloaded u32 classifier tables WAS (Re: [PATCH net 00/13] cls_u32 cleanups and fixes.

2018-09-10 Thread Jamal Hadi Salim
On 2018-09-10 8:25 a.m., Jamal Hadi Salim wrote: On 2018-09-09 11:48 a.m., Al Viro wrote: BTW, shouldn't we issue u32_clear_hw_hnode() every time we destroy an hnode?  It's done on u32_delete(), it's done (for root ht) on u32_destroy(), but it's not done for any other hnodes when you remove

Offloaded u32 classifier tables WAS (Re: [PATCH net 00/13] cls_u32 cleanups and fixes.

2018-09-10 Thread Jamal Hadi Salim
On 2018-09-09 11:48 a.m., Al Viro wrote: BTW, shouldn't we issue u32_clear_hw_hnode() every time we destroy an hnode? It's done on u32_delete(), it's done (for root ht) on u32_destroy(), but it's not done for any other hnodes when you remove the entire (not shared) filter. Looks fishy...

Re: [PATCH net 00/13] cls_u32 cleanups and fixes.

2018-09-10 Thread Jamal Hadi Salim
On 2018-09-09 10:15 a.m., Al Viro wrote: [..] Umm... Interesting - TCA_U32_SEL is not the only thing that gets ignored there; TCA_U32_MARK gets the same treatment. And then there's a lovely question what to do with n->pf - it's an array of n->sel.nkeys counters, and apparently we want (at

Re: [PATCH net 00/13] cls_u32 cleanups and fixes.

2018-09-09 Thread Jamal Hadi Salim
Since you have the momentum here: i noticed something unusual while i was trying to craft a test that would vet some of your changes. This has nothing to do with your changes, same happens on my stock debian laptop with kernel: 4.17.0-0.bpo.3-amd64 #1 SMP Debian 4.17.17-1~bpo9+1 (2018-08-27)

Re: [PATCH net 13/13] net: sched: cls_u32: simplify the hell out u32_delete() emptiness check

2018-09-09 Thread Jamal Hadi Salim
Acked-by: Jamal Hadi Salim cheers, jamal

Re: [PATCH net 12/13] net: sched: cls_u32: keep track of knodes count in tc_u_common

2018-09-09 Thread Jamal Hadi Salim
On 2018-09-08 9:31 p.m., Al Viro wrote: From: Al Viro allows to simplify u32_delete() considerably Signed-off-by: Al Viro Acked-by: Jamal Hadi Salim cheers, jamal

Re: [PATCH net 11/13] net: sched: cls_u32: get rid of hnode ->tp_c and tp_c argument of u32_set_parms()

2018-09-09 Thread Jamal Hadi Salim
On 2018-09-08 9:31 p.m., Al Viro wrote: From: Al Viro Acked-by: Jamal Hadi Salim cheers, jamal

Re: [PATCH net 10/13] net: sched: cls_u32: the tp_c argument of u32_set_parms() is always tp->data

2018-09-09 Thread Jamal Hadi Salim
On 2018-09-08 9:31 p.m., Al Viro wrote: From: Al Viro Acked-by: Jamal Hadi Salim cheers, jamal

Re: [PATCH net 09/13] net: sched: cls_u32: pass tc_u_common to u32_set_parms() instead of tc_u_hnode

2018-09-09 Thread Jamal Hadi Salim
ff-by: Al Viro Acked-by: Jamal Hadi Salim cheers, jamal

Re: [PATCH net 08/13] net: sched: cls_u32: clean tc_u_common hashtable

2018-09-09 Thread Jamal Hadi Salim
On 2018-09-08 9:31 p.m., Al Viro wrote: From: Al Viro * calculate key *once*, not for each hash chain element * let tc_u_hash() return the pointer to chain head rather than index - callers are cleaner that way. Signed-off-by: Al Viro Acked-by: Jamal Hadi Salim cheers, jamal

Re: [PATCH net 07/13] net: sched: cls_u32: get rid of tc_u_common ->rcu

2018-09-09 Thread Jamal Hadi Salim
On 2018-09-08 9:31 p.m., Al Viro wrote: From: Al Viro unused Signed-off-by: Al Viro Acked-by: Jamal Hadi Salim cheers, jamal

Re: [PATCH net 06/13] net: sched: cls_u32: get rid of tc_u_knode ->tp

2018-09-09 Thread Jamal Hadi Salim
On 2018-09-08 9:31 p.m., Al Viro wrote: From: Al Viro not used anymore Signed-off-by: Al Viro Acked-by: Jamal Hadi Salim cheers, jamal

Re: [PATCH net 05/13] net: sched: cls_u32: get rid of unused argument of u32_destroy_key()

2018-09-09 Thread Jamal Hadi Salim
On 2018-09-08 9:31 p.m., Al Viro wrote: From: Al Viro Signed-off-by: Al Viro Acked-by: Jamal Hadi Salim cheers, jamal

Re: [PATCH net 04/13] net: sched: cls_u32: make sure that divisor is a power of 2

2018-09-09 Thread Jamal Hadi Salim
On 2018-09-08 9:31 p.m., Al Viro wrote: From: Al Viro > Signed-off-by: Al Viro Test is by hacking user space iproute2 to allow sending a divisor > 255 Tested-by: Jamal Hadi Salim Acked-by: Jamal Hadi Salim cheers, jamal

Re: [PATCH net 02/13] net: sched: cls_u32: mark root hnode explicitly

2018-09-09 Thread Jamal Hadi Salim
On 2018-09-08 9:31 p.m., Al Viro wrote: From: Al Viro Acked-by: Jamal Hadi Salim cheers, jamal

Re: [PATCH net 03/13] net: sched: cls_u32: disallow linking to root hnode

2018-09-09 Thread Jamal Hadi Salim
: Not linking to root node Signed-off-by: Al Viro Tested-by: Jamal Hadi Salim Acked-by: Jamal Hadi Salim cheers, jamal

Re: [PATCH net 01/13] net: sched: cls_u32: fix hnode refcounting

2018-09-09 Thread Jamal Hadi Salim
i.e this you posted earlier, otherwise: Tested-by: Jamal Hadi Salim Acked-by: Jamal Hadi Salim Reminder: -- tc qdisc add dev eth0 ingress tc filter add dev eth0 parent : protocol ip prio 100 handle 1: u32 divisor 1 tc filter add dev eth0 parent : protocol ip prio 200 handle 2: u32 diviso

Re: [PATCH 1/7] fix hnode refcounting

2018-09-07 Thread Jamal Hadi Salim
To clarify with an example i used to test your patches: #0 add ingress filter $TC qdisc add dev $P ingress #1 add filter $TC filter add dev $P parent : protocol ip prio 10 \ u32 match ip protocol 1 0xff #2 display $TC filter ls dev $P parent : #3 try to delete root $TC filter delete dev

Re: [PATCH 1/7] fix hnode refcounting

2018-09-07 Thread Jamal Hadi Salim
On 2018-09-06 10:35 p.m., Al Viro wrote: On Thu, Sep 06, 2018 at 06:21:09AM -0400, Jamal Hadi Salim wrote: [..] Argh... Unfortunately, there's this: in u32_delete() we have if (root_ht) { if (root_ht->refcnt > 1) { *last =

Re: [PATCH 2/7] mark root hnode explicitly

2018-09-06 Thread Jamal Hadi Salim
On 2018-09-06 6:59 a.m., Al Viro wrote: On Thu, Sep 06, 2018 at 06:34:00AM -0400, Jamal Hadi Salim wrote: On 2018-09-06 6:28 a.m., Jamal Hadi Salim wrote: [..] Point, and that one is IMO enough to give up on using ->flags for that. How about simply diff --git a/net/sched/cls_u32.c b/

Re: [PATCH 2/7] mark root hnode explicitly

2018-09-06 Thread Jamal Hadi Salim
And a bunch of indentations... cheers, jamal diff --git a/net/sched/cls_u32.c b/net/sched/cls_u32.c index 6d45ec4c218c..cb3bee12af78 100644 --- a/net/sched/cls_u32.c +++ b/net/sched/cls_u32.c @@ -485,7 +485,8 @@ static void u32_clear_hw_hnode(struct tcf_proto *tp, struct tc_u_hnode *h, struct

Re: [PATCH 7/7] clean tc_u_common hashtable

2018-09-06 Thread Jamal Hadi Salim
On 2018-09-05 3:04 p.m., Al Viro wrote: From: Al Viro * calculate key *once*, not for each hash chain element * let tc_u_hash() return the pointer to chain head rather than index - callers are cleaner that way. Signed-off-by: Al Viro Acked-by: Jamal Hadi Salim cheers, jamal

Re: [PATCH 6/7] get rid of tc_u_common ->rcu

2018-09-06 Thread Jamal Hadi Salim
On 2018-09-05 3:04 p.m., Al Viro wrote: From: Al Viro unused Signed-off-by: Al Viro Acked-by: Jamal Hadi Salim cheers, jamal

Re: [PATCH 5/7] get rid of tc_u_knode ->tp

2018-09-06 Thread Jamal Hadi Salim
On 2018-09-05 3:04 p.m., Al Viro wrote: From: Al Viro not used anymore Signed-off-by: Al Viro Acked-by: Jamal Hadi Salim cheers, jamal

Re: [PATCH 4/7] get rid of unused argument of u32_destroy_key()

2018-09-06 Thread Jamal Hadi Salim
On 2018-09-05 3:04 p.m., Al Viro wrote: From: Al Viro Signed-off-by: Al Viro Acked-by: Jamal Hadi Salim cheers, jamal

Re: [PATCH 2/7] mark root hnode explicitly

2018-09-06 Thread Jamal Hadi Salim
On 2018-09-06 6:28 a.m., Jamal Hadi Salim wrote: On 2018-09-05 3:04 p.m., Al Viro wrote: From: Al Viro ... and disallow deleting or linking to such Signed-off-by: Al Viro Same comment as other one in regards to subject Since the flag space is coming from htnode which is exposed via uapi

Re: [PATCH 3/7] make sure that divisor is a power of 2

2018-09-06 Thread Jamal Hadi Salim
On 2018-09-05 3:04 p.m., Al Viro wrote: From: Al Viro Signed-off-by: Al Viro Acked-by: Jamal Hadi Salim cheers, jamal

Re: [PATCH 2/7] mark root hnode explicitly

2018-09-06 Thread Jamal Hadi Salim
it is for private use; but a comment in include/uapi/linux/pkt_cls.h that this flag or maybe a set of bits is reserved for internal use. Otherwise: Acked-by: Jamal Hadi Salim cheers, jamal

Re: [PATCH 1/7] fix hnode refcounting

2018-09-06 Thread Jamal Hadi Salim
this one: "[PATCH net 1/7]:net: sched: cls_u32: fix hnode refcounting" Also useful to have a cover letter summarizing the patchset in 0/7. Otherwise Acked-by: Jamal Hadi Salim cheers, jamal

Re: broken behaviour of TC filter delete

2018-08-26 Thread Jamal Hadi Salim
On 2018-08-25 9:02 a.m., Jiri Pirko wrote: Fri, Aug 24, 2018 at 08:11:07PM CEST, xiyou.wangc...@gmail.com wrote: ENOENT seems to be more logical to return when there's no more filter to delete. Yeah, at least we should keep ENOENT for compatibility. The bug here is chain 0 is gone after the

Re: [PATCH net-next] net: sched: act_ife: disable bh when taking ife_mod_lock

2018-08-13 Thread Jamal Hadi Salim
case tasks deadlock because they take same two locks in different order. To prevent potential deadlock reported by lockdep, always disable bh when obtaining ife_mod_lock. Looks like your recent changes on net-next exposed this. Acked-by: Jamal Hadi Salim cheers, jamal

[PATCH net-next 04/13] net: sched: act_gact method rename for grep-ability and consistency

2018-08-12 Thread Jamal Hadi Salim
From: Jamal Hadi Salim Signed-off-by: Jamal Hadi Salim --- net/sched/act_gact.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/net/sched/act_gact.c b/net/sched/act_gact.c index bfccd34a3968..52a3e474d822 100644 --- a/net/sched/act_gact.c +++ b/net/sched/act_gact.c

[PATCH net-next 11/13] net: sched: act_skbmod method rename for grep-ability and consistency

2018-08-12 Thread Jamal Hadi Salim
From: Jamal Hadi Salim Signed-off-by: Jamal Hadi Salim --- net/sched/act_skbmod.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/net/sched/act_skbmod.c b/net/sched/act_skbmod.c index e9c86ade3b40..d6a1af0c4171 100644 --- a/net/sched/act_skbmod.c +++ b/net/sched

[PATCH net-next 07/13] net: sched: act_pedit method rename for grep-ability and consistency

2018-08-12 Thread Jamal Hadi Salim
From: Jamal Hadi Salim Signed-off-by: Jamal Hadi Salim --- net/sched/act_pedit.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/net/sched/act_pedit.c b/net/sched/act_pedit.c index 3f62da72ab6a..8a7a7cb94e83 100644 --- a/net/sched/act_pedit.c +++ b/net/sched

[PATCH net-next 10/13] net: sched: act_skbedit method rename for grep-ability and consistency

2018-08-12 Thread Jamal Hadi Salim
From: Jamal Hadi Salim Signed-off-by: Jamal Hadi Salim --- net/sched/act_skbedit.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/net/sched/act_skbedit.c b/net/sched/act_skbedit.c index a6db47ebec11..926d7bc4a89d 100644 --- a/net/sched/act_skbedit.c +++ b/net/sched

[PATCH net-next 00/13] net: sched: actions rename for grep-ability and consistency

2018-08-12 Thread Jamal Hadi Salim
From: Jamal Hadi Salim Having a structure (example tcf_mirred) and a function with the same name is not good for readability or grepability. This long overdue patchset improves it and make sure there is consistency across all actions Jamal Hadi Salim (13): net: sched: act_connmark method

[PATCH net-next 03/13] net: sched: act_sum method rename for grep-ability and consistency

2018-08-12 Thread Jamal Hadi Salim
From: Jamal Hadi Salim Signed-off-by: Jamal Hadi Salim --- net/sched/act_csum.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/net/sched/act_csum.c b/net/sched/act_csum.c index f01c59ba6d12..5596fae4e478 100644 --- a/net/sched/act_csum.c +++ b/net/sched/act_csum.c

[PATCH net-next 01/13] net: sched: act_connmark method rename for grep-ability and consistency

2018-08-12 Thread Jamal Hadi Salim
From: Jamal Hadi Salim Signed-off-by: Jamal Hadi Salim --- net/sched/act_connmark.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/net/sched/act_connmark.c b/net/sched/act_connmark.c index 2f9bc833d046..54c0bf54f2ac 100644 --- a/net/sched/act_connmark.c +++ b/net

[PATCH net-next 13/13] net: sched: act_mirred method rename for grep-ability and consistency

2018-08-12 Thread Jamal Hadi Salim
From: Jamal Hadi Salim Signed-off-by: Jamal Hadi Salim --- net/sched/act_mirred.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/net/sched/act_mirred.c b/net/sched/act_mirred.c index 327be257033d..8ec216001077 100644 --- a/net/sched/act_mirred.c +++ b/net/sched

[PATCH net-next 06/13] net: sched: act_nat method rename for grep-ability and consistency

2018-08-12 Thread Jamal Hadi Salim
From: Jamal Hadi Salim Signed-off-by: Jamal Hadi Salim --- net/sched/act_nat.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/net/sched/act_nat.c b/net/sched/act_nat.c index 4dd9188a72fd..822e903bfc25 100644 --- a/net/sched/act_nat.c +++ b/net/sched/act_nat.c

[PATCH net-next 12/13] net: sched: act_vlan method rename for grep-ability and consistency

2018-08-12 Thread Jamal Hadi Salim
From: Jamal Hadi Salim Signed-off-by: Jamal Hadi Salim --- net/sched/act_vlan.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/net/sched/act_vlan.c b/net/sched/act_vlan.c index 5bde17fe3608..d1f5028384c9 100644 --- a/net/sched/act_vlan.c +++ b/net/sched/act_vlan.c

[PATCH net-next 09/13] net: sched: act_simple method rename for grep-ability and consistency

2018-08-12 Thread Jamal Hadi Salim
From: Jamal Hadi Salim Signed-off-by: Jamal Hadi Salim --- net/sched/act_simple.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/net/sched/act_simple.c b/net/sched/act_simple.c index 18e4452574cd..e616523ba3c1 100644 --- a/net/sched/act_simple.c +++ b/net/sched

[PATCH net-next 02/13] net: sched: act_bpf method rename for grep-ability and consistency

2018-08-12 Thread Jamal Hadi Salim
From: Jamal Hadi Salim Signed-off-by: Jamal Hadi Salim --- net/sched/act_bpf.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/net/sched/act_bpf.c b/net/sched/act_bpf.c index 9e8a33f9fee3..9b30e62805c7 100644 --- a/net/sched/act_bpf.c +++ b/net/sched/act_bpf.c

[PATCH net-next 08/13] net: sched: act_police method rename for grep-ability and consistency

2018-08-12 Thread Jamal Hadi Salim
From: Jamal Hadi Salim Signed-off-by: Jamal Hadi Salim --- net/sched/act_police.c | 16 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/net/sched/act_police.c b/net/sched/act_police.c index 88c16d80c1cf..06f0742db593 100644 --- a/net/sched/act_police.c +++ b/net

[PATCH net-next 05/13] net: sched: act_ipt method rename for grep-ability and consistency

2018-08-12 Thread Jamal Hadi Salim
From: Jamal Hadi Salim Signed-off-by: Jamal Hadi Salim --- net/sched/act_ipt.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/net/sched/act_ipt.c b/net/sched/act_ipt.c index e149f0e66cb6..51f235bbeb5b 100644 --- a/net/sched/act_ipt.c +++ b/net/sched/act_ipt.c

Re: [PATCH net-next v5 1/4] net/sched: user-space can't set unknown tcfa_action values

2018-08-01 Thread Jamal Hadi Salim
On 31/07/18 10:40 AM, Paolo Abeni wrote: If we choose to reject unknown opcodes, such user-space configuration will fail. I think that is a good thing. The kernel should not be accepting things it doesnt understand. This is a good opportunity to enforce that. What would happen before this

Re: [PATCH net-next v5 1/4] net/sched: user-space can't set unknown tcfa_action values

2018-07-31 Thread Jamal Hadi Salim
On 31/07/18 05:41 AM, Paolo Abeni wrote: Before this patch, the kernel exposed the same behaviour for negative value of 'bar', while, for positive 'bar' values, the overall behaviour was more complex (some classifier always stops with unknown positive action value, others go to lower prio). >

Re: [PATCH net-next v5 1/4] net/sched: user-space can't set unknown tcfa_action values

2018-07-30 Thread Jamal Hadi Salim
On 30/07/18 12:41 PM, Paolo Abeni wrote: On Mon, 2018-07-30 at 10:03 -0400, Jamal Hadi Salim wrote: On 30/07/18 08:30 AM, Paolo Abeni wrote: } + if (!tcf_action_valid(a->tcfa_action)) { + NL_SET_ERR_MSG(extack, "invalid action value, using TC_ACT_UNSPEC

Re: [PATCH net-next v5 1/4] net/sched: user-space can't set unknown tcfa_action values

2018-07-30 Thread Jamal Hadi Salim
On 30/07/18 08:30 AM, Paolo Abeni wrote: } + if (!tcf_action_valid(a->tcfa_action)) { + NL_SET_ERR_MSG(extack, "invalid action value, using TC_ACT_UNSPEC instead"); + a->tcfa_action = TC_ACT_UNSPEC; + } + return a; I think it would

Re: [PATCH net-next v3 4/5] net/tc: introduce TC_ACT_REINJECT.

2018-07-26 Thread Jamal Hadi Salim
On 25/07/18 01:09 PM, Marcelo Ricardo Leitner wrote: On Wed, Jul 25, 2018 at 09:48:16AM -0700, Cong Wang wrote: On Wed, Jul 25, 2018 at 5:27 AM Jamal Hadi Salim wrote: Those changes were there from the beginning (above patch did not introduce them). IIRC, the reason was to distinguish

Re: [PATCH net-next v3 4/5] net/tc: introduce TC_ACT_REINJECT.

2018-07-25 Thread Jamal Hadi Salim
On 25/07/18 10:24 AM, Paolo Abeni wrote: On Wed, 2018-07-25 at 08:27 -0400, Jamal Hadi Salim wrote: Those changes were there from the beginning (above patch did not introduce them). IIRC, the reason was to distinguish between policy intended drops and drops because of errors. Double

Re: [PATCH net-next v3 4/5] net/tc: introduce TC_ACT_REINJECT.

2018-07-25 Thread Jamal Hadi Salim
think it makes sense. Yep, I chose to increment 'overlimits' to preserve the current mirred semantic. AFAICS, that was first introduced with: commit 8919bc13e8d92c5b082c5c0321567383a071f5bc Author: Jamal Hadi Salim Date: Mon Aug 15 05:25:40 2011 + net_sched: fix port mirror

Re: [PATCH net-next v3 4/5] net/tc: introduce TC_ACT_REINJECT.

2018-07-25 Thread Jamal Hadi Salim
+Cc Shmulik Paolo - please also run the tdc tests (and add anymore if you feel they dont do coverage to your changes) On 24/07/18 04:06 PM, Paolo Abeni wrote: This is similar TC_ACT_REDIRECT, but with a slightly different semantic: - on ingress the mirred skbs are passed to the target device

Re: [PATCH net-next v3 3/5] tc/act: remove unneeded RCU lock in action callback

2018-07-25 Thread Jamal Hadi Salim
On 24/07/18 04:06 PM, Paolo Abeni wrote: Each lockless action currently does its own RCU locking in ->act(). This is allows using plain RCU accessor, even if the context is really RCU BH. This change drops the per action RCU lock, replace the accessors with _bh variant, cleans up a bit the

Re: [PATCH net-next v3 1/5] tc/act: user space can't use TC_ACT_REDIRECT directly

2018-07-25 Thread Jamal Hadi Salim
On 24/07/18 04:06 PM, Paolo Abeni wrote: --- a/net/sched/act_api.c +++ b/net/sched/act_api.c @@ -895,6 +895,11 @@ struct tc_action *tcf_action_init_1(struct net *net, struct tcf_proto *tp, } } + if (a->tcfa_action == TC_ACT_REDIRECT) { +

Re: [PATCH net-next v3 5/5] act_mirred: use TC_ACT_REINJECT when possible

2018-07-25 Thread Jamal Hadi Salim
On 24/07/18 05:15 PM, Cong Wang wrote: On Tue, Jul 24, 2018 at 1:07 PM Paolo Abeni wrote: + + /* let's the caller reinject the packet, if possible */ + if (skb_at_tc_ingress(skb)) { + res->ingress = want_ingress; +

Re: [patch net-next v2 0/9] net: sched: introduce chain templates support with offloading to mlxsw

2018-06-29 Thread Jamal Hadi Salim
On 29/06/18 04:39 AM, Jiri Pirko wrote: Fri, Jun 29, 2018 at 12:25:53AM CEST, xiyou.wangc...@gmail.com wrote: On Thu, Jun 28, 2018 at 6:10 AM Jiri Pirko wrote: Add a template of type flower allowing to insert rules matching on last 2 bytes of destination mac address: # tc chaintemplate add

Re: [patch net-next v2 0/9] net: sched: introduce chain templates support with offloading to mlxsw

2018-06-28 Thread Jamal Hadi Salim
On 28/06/18 09:22 AM, Jiri Pirko wrote: Thu, Jun 28, 2018 at 03:13:30PM CEST, j...@mojatatu.com wrote: On 26/06/18 03:59 AM, Jiri Pirko wrote: From: Jiri Pirko For the TC clsact offload these days, some of HW drivers need to hold a magic ball. The reason is, with the first inserted rule

Re: [patch net-next v2 0/9] net: sched: introduce chain templates support with offloading to mlxsw

2018-06-28 Thread Jamal Hadi Salim
On 26/06/18 03:59 AM, Jiri Pirko wrote: From: Jiri Pirko For the TC clsact offload these days, some of HW drivers need to hold a magic ball. The reason is, with the first inserted rule inside HW they need to guess what fields will be used for the matching. If later on this guess proves to be

Re: [PATCH v2 net-next] net/sched: add skbprio scheduler

2018-06-24 Thread Jamal Hadi Salim
On 23/06/18 04:47 PM, Nishanth Devarajan wrote: [..] + /* Drop the packet at the tail of the lowest priority qdisc. */ + lp_qdisc = >qdiscs[lp]; + to_drop = __skb_dequeue_tail(lp_qdisc); + BUG_ON(!to_drop); + qdisc_qstats_backlog_dec(sch, to_drop); +

Re: [PATCH v4 net-next] net:sched: add action inheritdsfield to skbedit

2018-06-20 Thread Jamal Hadi Salim
ould have been fine to match the size of the kernel flags), but other than that LGTM. Acked-by: Jamal Hadi Salim cheers, jamal

Re: [PATCH v4 net-next] net:sched: add action inheritdsfield to skbedit

2018-06-19 Thread Jamal Hadi Salim
nables later classification of packets based on the DS field. v4: *Not allow setting flags other than the expected ones. *Allow dumping the pure flags. Original idea by Jamal Hadi Salim Signed-off-by: Qiaobin Fu Reviewed-by: Michel Machado --- Note that the motivation for this patch is found in t

Re: [PATCH net-next v4 00/11] Modify action API for implementing lockless actions

2018-06-01 Thread Jamal Hadi Salim
On 31/05/18 08:38 AM, Vlad Buslov wrote: Hi Jamal, On current net-next I still have action with single reference after last step: ~$ sudo $TC -s actions ls action skbedit total acts 1 action order 0: skbedit mark 1 pipe

Re: [PATCH net-next v4 00/11] Modify action API for implementing lockless actions

2018-05-31 Thread Jamal Hadi Salim
Hi Vlad, Can you try one simple test below with these patches? #create an action sudo $TC actions add action skbedit mark 1 pipe # sudo $TC qdisc del dev lo parent : sudo $TC qdisc add dev lo ingress # bind action to filter sudo $TC filter add dev lo parent : protocol ip prio 1 \

Re: [PATCH] net: sched: split tc_ctl_tfilter into three handlers

2018-05-28 Thread Jamal Hadi Salim
On 28/05/18 12:02 PM, Jamal Hadi Salim wrote: On 27/05/18 03:55 PM, Vlad Buslov wrote: tc_ctl_tfilter handles three netlink message types: RTM_NEWTFILTER, RTM_DELTFILTER, RTM_GETTFILTER. However, implementation of this function involves a lot of branching on specific message type because most

  1   2   3   4   5   6   7   8   9   10   >