Re: [PATCH net] net: sched: cls: Fix offloading when ingress dev is vxlan

2018-06-06 Thread Paul Blakey
On 06/06/2018 00:27, Jakub Kicinski wrote: On Tue, 05 Jun 2018 15:06:40 -0400 (EDT), David Miller wrote: From: Jakub Kicinski Date: Tue, 5 Jun 2018 11:57:47 -0700 Do we still care about correctness and not breaking backward compatibility? Jakub let me know if you want me to revert this

[PATCH net] net: sched: cls: Fix offloading when ingress dev is vxlan

2018-06-05 Thread Paul Blakey
s attached to it is not offload capable, but make sure egress on such case is capable instead. Fixes: caa7260156eb ("net: sched: keep track of offloaded filters [..]") Reviewed-by: Roi Dayan Acked-by: Jiri Pirko Signed-off-by: Paul Blakey --- net/sched/cls_api.c | 26 ++

Re: [PATCH net-next V2 1/2] cls_flower: Fix missing free of rhashtable

2018-06-05 Thread Paul Blakey
On 05/06/2018 00:04, David Miller wrote: From: Paul Blakey Date: Sun, 3 Jun 2018 10:06:13 +0300 When destroying the instance, destroy the head rhashtable. Fixes: 05cd271fd61a ("cls_flower: Support multiple masks per priority") Reported-by: Vlad Buslov Reviewed-by: Roi Dayan

[PATCH net-next V2 2/2] cls_flower: Fix comparing of old filter mask with new filter

2018-06-03 Thread Paul Blakey
We incorrectly compare the mask and the result is that we can't modify an already existing rule. Fix that by comparing correctly. Fixes: 05cd271fd61a ("cls_flower: Support multiple masks per priority") Reported-by: Vlad Buslov Reviewed-by: Roi Dayan Reviewed-by: Jiri Pirko Signed-of

[PATCH net-next V2 1/2] cls_flower: Fix missing free of rhashtable

2018-06-03 Thread Paul Blakey
When destroying the instance, destroy the head rhashtable. Fixes: 05cd271fd61a ("cls_flower: Support multiple masks per priority") Reported-by: Vlad Buslov Reviewed-by: Roi Dayan Reviewed-by: Jiri Pirko Signed-off-by: Paul Blakey --- Changelog: v0 -> v2: rebased. net/sched/cls

[PATCH net] cls_flower: Fix incorrect idr release when failing to modify rule

2018-05-30 Thread Paul Blakey
Signed-off-by: Paul Blakey --- net/sched/cls_flower.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/sched/cls_flower.c b/net/sched/cls_flower.c index d964e60..c79f6e7 100644 --- a/net/sched/cls_flower.c +++ b/net/sched/cls_flower.c @@ -977,7 +977,7 @@ static int fl_change(

[PATCH net-next 2/2] cls_flower: Fix comparing of old filter mask with new filter

2018-05-30 Thread Paul Blakey
We incorrectly compare the mask and the result is that we can't modify an already existing rule. Fix that by comparing correctly. Fixes: 05cd271fd61a ("cls_flower: Support multiple masks per priority") Reported-by: Vlad Buslov Reviewed-by: Roi Dayan Reviewed-by: Jiri Pirko Signed-of

[PATCH net-next 0/2] cls_flower: Various fixes

2018-05-30 Thread Paul Blakey
Two of the fixes are for my multiple mask patch Paul Blakey (2): cls_flower: Fix missing free of rhashtable cls_flower: Fix comparing of old filter mask with new filter net/sched/cls_flower.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) -- 2.7.4

[PATCH net-next 1/2] cls_flower: Fix missing free of rhashtable

2018-05-30 Thread Paul Blakey
When destroying the instance, destroy the head rhashtable. Fixes: 05cd271fd61a ("cls_flower: Support multiple masks per priority") Reported-by: Vlad Buslov Reviewed-by: Roi Dayan Reviewed-by: Jiri Pirko Signed-off-by: Paul Blakey --- net/sched/cls_flower.c | 2 ++ 1 file

[PATCH net-next V2] cls_flower: Support multiple masks per priority

2018-04-30 Thread Paul Blakey
is left with the responsibility of ensuring non overlapping flows, otherwise precedence is not guaranteed. Signed-off-by: Paul Blakey <pa...@mellanox.com> Signed-off-by: Jiri Pirko <j...@mellanox.com> --- Changes: V1 -> V2: in fl_init, removed unnessecry err variable, just return

[PATCH net-next] cls_flower: Support multiple masks per priority

2018-04-30 Thread Paul Blakey
is left with the responsibilty of ensuring non overlapping flows, otherwise precedence is not guaranteed. Signed-off-by: Paul Blakey <pa...@mellanox.com> --- net/sched/cls_flower.c | 279 +++-- 1 file changed, 179 insertions(+), 100 deletions(-)

Re: [PATCH net] test_rhashtable: Add missing rcu_read_lock()

2018-03-08 Thread Paul Blakey
On 08/03/2018 17:58, Herbert Xu wrote: On Thu, Mar 08, 2018 at 01:54:57PM +0200, Paul Blakey wrote: Suppress "suspicious rcu_dereference_protected() usage!" on duplicate insertion test. Fixes: 499ac3b60f65 ('test_rhashtable: add test case for rhl_table with duplicate objects')

[PATCH net] test_rhashtable: Add missing rcu_read_lock()

2018-03-08 Thread Paul Blakey
Suppress "suspicious rcu_dereference_protected() usage!" on duplicate insertion test. Fixes: 499ac3b60f65 ('test_rhashtable: add test case for rhl_table with duplicate objects') Signed-off-by: Paul Blakey <pa...@mellanox.com> --- lib/test_rhashtable.c | 14 +- 1

Re: [PATCH net v4 0/2] rhashtable: Fix rhltable duplicates insertion

2018-03-08 Thread Paul Blakey
On 07/03/2018 18:23, David Miller wrote: From: Paul Blakey <pa...@mellanox.com> Date: Wed, 7 Mar 2018 16:00:11 +0200 On our mlx5 driver fs_core.c, we use the rhltable interface to store flow groups. We noticed that sometimes we get a warning that flow group isn't found at removal. Thi

[PATCH net v4 2/2] test_rhashtable: add test case for rhltable with duplicate objects

2018-03-07 Thread Paul Blakey
Tries to insert duplicates in the middle of bucket's chain: bucket 1: [[val 21 (tid=1)]] -> [[ val 1 (tid=2), val 1 (tid=0) ]] Reuses tid to distinguish the elements insertion order. Signed-off-by: Paul Blakey <pa...@mellanox.com> --- lib/test_rhashtabl

[PATCH net v4 1/2] rhashtable: Fix rhlist duplicates insertion

2018-03-07 Thread Paul Blakey
pointer to point to the correct rhash_head next pointer. Fixes: ca26893f05e8 ('rhashtable: Add rhlist interface') Signed-off-by: Paul Blakey <pa...@mellanox.com> --- include/linux/rhashtable.h | 4 +++- lib/rhashtable.c | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-)

[PATCH net v4 0/2] rhashtable: Fix rhltable duplicates insertion

2018-03-07 Thread Paul Blakey
gt; v2 changes: * Added missing fix in rhashtable_lookup_one code path as well. v2 --> v1 changes: * Changed commit messages to better reflect the change Paul Blakey (2): rhashtable: Fix rhlist duplicates insertion test_rhashtable: add test case for rhltable with duplicate objects

Re: [PATCH net v2 1/2] rhashtable: Fix rhlist duplicates insertion

2018-03-04 Thread Paul Blakey
On 04/03/2018 17:13, Mark Bloch wrote: On 04/03/2018 15:26, Paul Blakey wrote: When inserting duplicate objects (those with the same key), current rhlist implementation messes up the chain pointers by updating the bucket pointer instead of prev next pointer to the newly inserted node

[PATCH net v3 0/2] rhashtable: Fix rhltable duplicates insertion

2018-03-04 Thread Paul Blakey
gt; v2 changes: * Changed commit messages to better reflect the change Paul Blakey (2): rhashtable: Fix rhlist duplicates insertion test_rhashtable: add test case for rhltable with duplicate objects include/linux/rhashtable.h | 4 +- lib/rhashtable.c | 4 +- lib/test_rhasht

[PATCH net v3 2/2] test_rhashtable: add test case for rhltable with duplicate objects

2018-03-04 Thread Paul Blakey
Tries to insert duplicates in the middle of bucket's chain: bucket 1: [[val 21 (tid=1)]] -> [[ val 1 (tid=2), val 1 (tid=0) ]] Reuses tid to distinguish the elements insertion order. Signed-off-by: Paul Blakey <pa...@mellanox.com> --- lib/test_rhashtabl

[PATCH net v3 1/2] rhashtable: Fix rhlist duplicates insertion

2018-03-04 Thread Paul Blakey
pointer to point to the correct rhash_head next pointer. Issue: 1241076 Change-Id: I86b2c140bcb4aeb10b70a72a267ff590bb2b17e7 Fixes: ca26893f05e8 ('rhashtable: Add rhlist interface') Signed-off-by: Paul Blakey <pa...@mellanox.com> --- include/linux/rhashtable.h | 4 +++- lib/rhasht

Re: [PATCH net 1/2] rhashtable: Fix rhltable duplicates insertion

2018-03-04 Thread Paul Blakey
On 04/03/2018 14:57, Herbert Xu wrote: On Sun, Mar 04, 2018 at 02:34:26PM +0200, Paul Blakey wrote: When inserting duplicate objects (those with the same key), current rhashtable implementation messes up the chain pointers by updating the bucket pointer instead of prev next pointer

[PATCH net v2 0/2] rhlist: Fix rhltable duplicates insertion

2018-03-04 Thread Paul Blakey
), but only where the flow group rhash_head was second (or not first) on the relevant rhashtable bucket list. The first patch fixes it, and the second one adds a test that show it is now working. Paul. v1 --> v2 changes: * Changed commit messages to better reflect the change Paul Blakey

[PATCH net v2 1/2] rhashtable: Fix rhlist duplicates insertion

2018-03-04 Thread Paul Blakey
pointer to point to the correct rhash_head next pointer. Fixes: ca26893f05e8 ('rhashtable: Add rhlist interface') Signed-off-by: Paul Blakey <pa...@mellanox.com> --- include/linux/rhashtable.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/include/linux/rhashtab

[PATCH net v2 2/2] test_rhashtable: add test case for rhltable with duplicate objects

2018-03-04 Thread Paul Blakey
Tries to insert duplicates in the middle of bucket's chain: bucket 1: [[val 21 (tid=1)]] -> [[ val 1 (tid=2), val 1 (tid=0) ]] Reuses tid to distinguish the elements insertion order. Signed-off-by: Paul Blakey <pa...@mellanox.com> --- lib/test_rhashtabl

[PATCH net 0/2] rhashtable: Fix rhltable duplicates insertion

2018-03-04 Thread Paul Blakey
), but only where the flow group rhash_head was second (or not first) on the relevant rhashtable bucket list. The first patch fixes it, and the second one adds a test that show it is now working. Paul Blakey (2): rhashtable: Fix rhltable duplicates insertion test_rhashtable: add test case

[PATCH net 2/2] test_rhashtable: add test case for rhl_table with duplicate objects

2018-03-04 Thread Paul Blakey
Tries to insert duplicates in the middle of bucket's chain: bucket 1: [[val 21 (tid=1)]] -> [[ val 1 (tid=2), val 1 (tid=0) ]] Reuses tid to distinguish the elements insertion order. Signed-off-by: Paul Blakey <pa...@mellanox.com> --- lib/test_rhashtabl

[PATCH net 1/2] rhashtable: Fix rhltable duplicates insertion

2018-03-04 Thread Paul Blakey
pprev pointer to point to the correct rhash_head next pointer. Fixes: ca26893f05e8 ('rhashtable: Add rhlist interface') Signed-off-by: Paul Blakey <pa...@mellanox.com> --- include/linux/rhashtable.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/include/linux/rhashtab

Re: [PATCH iproute2 v3 1/1] actions: Add support for user cookies

2017-03-22 Thread Paul Blakey
Hi Jamal, I've tested the patch some and I've put some comments below: On 22/03/2017 00:01, Jamal Hadi Salim wrote: From: Jamal Hadi Salim Make use of 128b user cookies Introduce optional 128-bit action cookie. Like all other cookie schemes in the networking world (eg in

Re: [PATCH net-next V4] tc: flower: Refactor matching flags to be more user friendly

2017-01-19 Thread Paul Blakey
On 19/01/2017 16:22, Jiri Benc wrote: On Thu, 19 Jan 2017 16:17:48 +0200, Paul Blakey wrote: + while (token) { + if (!strncmp(token, "no", 2)) { + no = true; + token = strchr(token, '_') + 1; This seems to st

[PATCH iproute2 net-next V5] tc: flower: Refactor matching flags to be more user friendly

2017-01-19 Thread Paul Blakey
src_mac e4:1d:2d:fd:8b:01 \ dst_mac e4:1d:2d:fd:8b:02 \ indev ens4f0 \ ip_flags nofrag \ action drop Fixes: 22a8f019891c ('tc: flower: support matching flags') Signed-off-by: Paul Blakey <pa...@mellanox.com> Reviewed-by: Roi Dayan <r...

[PATCH net-next V4] tc: flower: Refactor matching flags to be more user friendly

2017-01-19 Thread Paul Blakey
src_mac e4:1d:2d:fd:8b:01 \ dst_mac e4:1d:2d:fd:8b:02 \ indev ens4f0 \ ip_flags nofrag \ action drop Fixes: 22a8f019891c ('tc: flower: support matching flags') Signed-off-by: Paul Blakey <pa...@mellanox.com> Reviewed-by: Roi Dayan <r...

[PATCH iproute2 net-next V3] tc: flower: Refactor matching flags to be more user friendly

2017-01-19 Thread Paul Blakey
src_mac e4:1d:2d:fd:8b:01 \ dst_mac e4:1d:2d:fd:8b:02 \ indev ens4f0 \ ip_flags nofrag \ action drop Fixes: 22a8f019891c ('tc: flower: support matching flags') Signed-off-by: Paul Blakey <pa...@mellanox.com> Reviewed-by: Roi Dayan <r...

Re: [PATCH iproute2 net-next V3] tc: flower: Refactor matching flags to be more user friendly

2017-01-19 Thread Paul Blakey
On 19/01/2017 16:14, Paul Blakey wrote: Instead of "magic numbers" we can now specify each flag by name. Prefix of "no" (e.g nofrag) unsets the flag, otherwise it wil be set. Example: # add a flower filter that will drop fragmented packets tc filter add dev ens4f

Re: [PATCH iproute2 net-next V2] tc: flower: Refactor matching flags to be more user friendly

2017-01-19 Thread Paul Blakey
On 19/01/2017 16:04, Jiri Benc wrote: On Thu, 19 Jan 2017 14:17:57 +0200, Paul Blakey wrote: Instead of "magic numbers" we can now specify each flag by name. Prefix of "no_" (e.g no_frag) unsets the flag, otherwise it wil be set. Other parts of the tc tool use the

Re: [PATCH iproute2 net-next] tc: flower: Refactor matching flags to be more user friendly

2017-01-19 Thread Paul Blakey
On 19/01/2017 13:32, Paul Blakey wrote: Instead of "magic numbers" we can now specify each flag by name. Prefix of "no_" (e.g no_frag) unsets the flag, otherwise it wil be set. Example: # add a flower filter that will drop fragmented packets tc filter add de

[PATCH iproute2 net-next V2] tc: flower: Refactor matching flags to be more user friendly

2017-01-19 Thread Paul Blakey
src_mac e4:1d:2d:fd:8b:01 \ dst_mac e4:1d:2d:fd:8b:02 \ indev ens4f0 \ ip_flags no_frag \ action drop Fixes: 22a8f019891c ('tc: flower: support matching flags') Signed-off-by: Paul Blakey <pa...@mellanox.com> Reviewed-by: Roi Dayan <r...

[PATCH iproute2 net-next] tc: flower: Refactor matching flags to be more user friendly

2017-01-19 Thread Paul Blakey
src_mac e4:1d:2d:fd:8b:01 \ dst_mac e4:1d:2d:fd:8b:02 \ indev ens4f0 \ ip_flags no_frag \ action drop Fixes: 22a8f019891c ('tc: flower: support matching flags') Signed-off-by: Paul Blakey <pa...@mellanox.com> Reviewed-by: Roi Dayan <r...

Re: [PATCH iproute2 net-next] tc: flower: support matching flags

2017-01-19 Thread Paul Blakey
On 18/01/2017 14:41, Jiri Benc wrote: On Wed, 4 Jan 2017 12:55:59 +0100, Jiri Benc wrote: On Wed, 4 Jan 2017 13:51:13 +0200, Paul Blakey wrote: It mimics the kernel packing of flags, I have no problem either way (flags, or ip_flags/tcp_flags pairs), what do you think jiri? What Simon says

Re: [PATCH net-next v4 1/2] net sched actions: Add support for user cookies

2017-01-18 Thread Paul Blakey
On 17/01/2017 13:11, Jamal Hadi Salim wrote: From: Jamal Hadi Salim Introduce optional 128-bit action cookie. Like all other cookie schemes in the networking world (eg in protocols like http or existing kernel fib protocol field, etc) the idea is to save user state that

Re: [PATCH net-next] net/sched: cls_flower: Add user specified data

2017-01-17 Thread Paul Blakey
On 17/01/2017 13:23, Jamal Hadi Salim wrote: On 17-01-16 04:51 AM, Jiri Pirko wrote: Mon, Jan 16, 2017 at 08:54:18AM CET, pa...@mellanox.com wrote: I think we should do it in a generic way, for every classifier, right away. Same as Jamal is doing for actions. I think that first we

[PATCH net-next] net/sched: cls_flower: Disallow duplicate internal elements

2017-01-16 Thread Paul Blakey
Flower currently allows having the same filter twice with the same priority. Actions (and statistics update) will always execute on the first inserted rule leaving the second rule unused. This patch disallows that. Signed-off-by: Paul Blakey <pa...@mellanox.com> Acked-by: Jiri Pi

Re: [PATCH net-next] net/sched: cls_flower: Add user specified data

2017-01-15 Thread Paul Blakey
On 15/01/2017 21:08, John Fastabend wrote: On 17-01-15 09:36 AM, Paul Blakey wrote: On 08/01/2017 19:12, Jiri Pirko wrote: Mon, Jan 02, 2017 at 03:59:49PM CET, j...@mojatatu.com wrote: We have been using a cookie as well for actions (which we have been using but have been too lazy

Re: [PATCH net-next] net/sched: cls_flower: Add user specified data

2017-01-15 Thread Paul Blakey
is less code to change (instead of changing each classifier), but might be slower. I'm afraid how it will affect dumping several filters. Third is this patch. Thanks, Paul. cheers, jamal On 17-01-02 08:13 AM, Paul Blakey wrote: This is to support saving extra data that might be helpful

Re: [PATCH iproute2 net-next] tc: flower: support matching flags

2017-01-04 Thread Paul Blakey
On 04/01/2017 12:33, Simon Horman wrote: On Tue, Jan 03, 2017 at 01:54:34PM +0200, Paul Blakey wrote: ... Hi Paul, Matching name was from the idea that we are doing is matching. And regarding documentation/flag names I didn't want tc tool to be need of a update each time a new flag

Re: [PATCH net-next] net/sched: cls_flower: Add user specified data

2017-01-04 Thread Paul Blakey
On 04/01/2017 12:14, Simon Horman wrote: On Tue, Jan 03, 2017 at 02:22:05PM +0200, Paul Blakey wrote: On 03/01/2017 13:44, Jamal Hadi Salim wrote: On 17-01-02 11:33 PM, John Fastabend wrote: On 17-01-02 05:22 PM, Jamal Hadi Salim wrote: [..] Like all cookie semantics it is for storing

Re: [PATCH net-next] net/sched: cls_flower: Add user specified data

2017-01-03 Thread Paul Blakey
On 03/01/2017 13:44, Jamal Hadi Salim wrote: On 17-01-02 11:33 PM, John Fastabend wrote: On 17-01-02 05:22 PM, Jamal Hadi Salim wrote: [..] Like all cookie semantics it is for storing state. The receiver (kernel) is not just store it and not intepret it. The user when reading it back

Re: [PATCH iproute2 net-next] tc: flower: support matching flags

2017-01-03 Thread Paul Blakey
On 02/01/2017 20:55, Jiri Benc wrote: On Wed, 28 Dec 2016 15:06:49 +0200, Paul Blakey wrote: Enhance flower to support matching on flags. The 1st flag allows to match on whether the packet is an IP fragment. Example: # add a flower filter that will drop fragmented packets

[PATCH net-next] net/sched: cls_flower: Add user specified data

2017-01-02 Thread Paul Blakey
This is to support saving extra data that might be helpful on retrieval. First use case is upcoming openvswitch flow offloads, extra data will include UFID and port mappings for each added flow. Signed-off-by: Paul Blakey <pa...@mellanox.com> Reviewed-by: Roi Dayan <r...@mellanox.c

[PATCH iproute2 net-next] tc: flower: support matching flags

2016-12-28 Thread Paul Blakey
: \ flower \ src_mac e4:1d:2d:fd:8b:01 \ dst_mac e4:1d:2d:fd:8b:02 \ indev ens4f0 \ matching_flags 0x1/0x1 \ action drop Signed-off-by: Paul Blakey <pa...@mellanox.com> Signed-off-by: Or Gerlitz <ogerl...@mellanox.com&

[PATCH net] net/sched: cls_flower: Fix missing addr_type in classify

2016-12-28 Thread Paul Blakey
/sched: cls_flower: Use mask for addr_type') Signed-off-by: Paul Blakey <pa...@mellanox.com> Reviewed-by: Hadar Hen Zion <had...@mellanox.com> --- net/sched/cls_flower.c | 4 1 file changed, 4 insertions(+) diff --git a/net/sched/cls_flower.c b/net/sched/cls_flower.c index 333f8e2..97

[PATCH net 2/2] net/sched: cls_flower: Use masked key when calling HW offloads

2016-12-14 Thread Paul Blakey
t') Signed-off-by: Paul Blakey <pa...@mellanox.com> Reviewed-by: Roi Dayan <r...@mellanox.com> Acked-by: Jiri Pirko <j...@mellanox.com> --- net/sched/cls_flower.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/sched/cls_flower.c b/net/sched/cls_flower.c i

[PATCH net 0/2] net/sched: cls_flower: Fix mask handling

2016-12-14 Thread Paul Blakey
Hi, The series fix how the mask is being handled. Thanks. Paul Blakey (2): net/sched: cls_flower: Use mask for addr_type net/sched: cls_flower: Use masked key when calling HW offloads net/sched/cls_flower.c | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) -- 1.8.3.1

[PATCH net 1/2] net/sched: cls_flower: Use mask for addr_type

2016-12-14 Thread Paul Blakey
When addr_type is set, mask should also be set. Fixes: 66530bdf85eb ('sched,cls_flower: set key address type when present') Fixes: bc3103f1ed40 ('net/sched: cls_flower: Classify packet in ip tunnels') Signed-off-by: Paul Blakey <pa...@mellanox.com> Reviewed-by: Roi Dayan <r...@mellanox.c

[PATCH iproute2] tc: flower: Fix usage message

2016-11-02 Thread Paul Blakey
Remove left over usage from removal of eth_type argument. Fixes: 488b41d020fb ('tc: flower no need to specify the ethertype') Signed-off-by: Paul Blakey <pa...@mellanox.com> --- man/man8/tc-flower.8 | 9 - tc/f_flower.c| 3 +-- 2 files changed, 1 insertion(+), 11 del