[PATCH] net: mv643xx_eth: fix packet corruption with TSO and tiny unaligned packets.

2016-01-26 Thread Nicolas Schichan
use that same space to place the ip headers, overwritting that small fragment data. Fixes: 91986fd3d335 (net: mv643xx_eth: Ensure proper data alignment in TSO TX path) Signed-off-by: Nicolas Schichan <nschic...@freebox.fr> --- drivers/net/ethernet/marvell/mv643xx_eth.c | 4 ++-- 1 file c

[PATCH net] ARM: net: make BPF_LD | BPF_IND instruction trigger r_X initialisation to 0.

2015-10-02 Thread Nicolas Schichan
makes the test "LD_IND byte default X" pass in the test_bpf module when the ARM JIT is enabled. Signed-off-by: Nicolas Schichan <nschic...@freebox.fr> --- arch/arm/net/bpf_jit_32.c | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/arm/net/bpf_jit_32.c b/arch/arm/net/bpf_jit_32

[PATCH net-next] ARM: net: support BPF_ALU | BPF_MOD instructions in the BPF JIT.

2015-10-02 Thread Nicolas Schichan
PASS ARMv5 QEMU jit: test_bpf: #3 DIV_MOD_KX jited:1 1104 PASS ARMv5 kirkwood nojit: test_bpf: #3 DIV_MOD_KX jited:0 1103 PASS ARMv5 kirkwood jit: test_bpf: #3 DIV_MOD_KX jited:1 311 PASS Signed-off-by: Nicolas Schichan <nschic...@freebox.fr> --- arch

[PATCH net-next V2] ARM: net: support BPF_ALU | BPF_MOD instructions in the BPF JIT.

2015-10-02 Thread Nicolas Schichan
PASS ARMv5 QEMU jit: test_bpf: #3 DIV_MOD_KX jited:1 1104 PASS ARMv5 kirkwood nojit: test_bpf: #3 DIV_MOD_KX jited:0 1103 PASS ARMv5 kirkwood jit: test_bpf: #3 DIV_MOD_KX jited:1 311 PASS Signed-off-by: Nicolas Schichan <nschic...@freebox.fr> --- Changes from V1: - Address spel

[PATCH V2 net-next 5/6] test_bpf: add more tests for LD_ABS and LD_IND.

2015-08-04 Thread Nicolas Schichan
This exerces the LD_ABS and LD_IND instructions for various sizes and alignments. This also checks that X when used as an offset to a BPF_IND instruction first in a filter is correctly set to 0. Signed-off-by: Nicolas Schichan nschic...@freebox.fr Acked-by: Alexei Starovoitov a...@plumgrid.com

[PATCH V2 net-next 6/6] test_bpf: add tests checking that JIT/interpreter sets A and X to 0.

2015-08-04 Thread Nicolas Schichan
It is mandatory for the JIT or interpreter to reset the A and X registers to 0 before running the filter. Check that it is the case on various ALU and JMP instructions. Signed-off-by: Nicolas Schichan nschic...@freebox.fr Acked-by: Alexei Starovoitov a...@plumgrid.com Acked-by: Daniel Borkmann

[PATCH V2 net-next 3/6] test_bpf: test LD_ABS and LD_IND instructions on fragmented skbs.

2015-08-04 Thread Nicolas Schichan
These new tests exercise various load sizes and offsets crossing the head/fragment boundary. Signed-off-by: Nicolas Schichan nschic...@freebox.fr Acked-by: Alexei Starovoitov a...@plumgrid.com Acked-by: Daniel Borkmann dan...@iogearbox.net --- lib/test_bpf.c | 142

[PATCH V2 net-next 1/6] test_bpf: avoid oopsing the kernel when generate_test_data() fails.

2015-08-04 Thread Nicolas Schichan
Signed-off-by: Nicolas Schichan nschic...@freebox.fr Acked-by: Alexei Starovoitov a...@plumgrid.com Acked-by: Daniel Borkmann dan...@iogearbox.net --- lib/test_bpf.c | 5 + 1 file changed, 5 insertions(+) diff --git a/lib/test_bpf.c b/lib/test_bpf.c index 3afddf2..6843d0b 100644 --- a/lib

[PATCH V2 net-next 2/6] test_bpf: allow tests to specify an skb fragment.

2015-08-04 Thread Nicolas Schichan
This introduce a new test-aux flag (FLAG_SKB_FRAG) to tell the populate_skb() function to add a fragment to the test skb containing the data specified in test-frag_data). Signed-off-by: Nicolas Schichan nschic...@freebox.fr Acked-by: Alexei Starovoitov a...@plumgrid.com Acked-by: Daniel Borkmann

[PATCH V2 net-next 4/6] test_bpf: add module parameters to filter the tests to run.

2015-08-04 Thread Nicolas Schichan
invalid range, test id or test name will result in -EINVAL being returned and no tests being run. Signed-off-by: Nicolas Schichan nschic...@freebox.fr Acked-by: Daniel Borkmann dan...@iogearbox.net --- lib/test_bpf.c | 71 ++ 1 file changed

[PATCH V2 net-next 0/6] test_bpf improvements

2015-08-04 Thread Nicolas Schichan
. Regards, Nicolas Schichan (6): test_bpf: avoid oopsing the kernel when generate_test_data() fails. test_bpf: allow tests to specify an skb fragment. test_bpf: test LD_ABS and LD_IND instructions on fragmented skbs. test_bpf: allow running of a single test specified as a module

Re: [PATCH 4/6] test_bpf: add module parameters to filter the tests to run.

2015-08-03 Thread Nicolas Schichan
On 08/03/2015 05:58 PM, Daniel Borkmann wrote: On 08/03/2015 04:02 PM, Nicolas Schichan wrote: When developping on the interpreter or a particular JIT, it can be insteresting to restrict the test list to a specific test or a s/insteresting/interesting/ [...] s/test_pbf/test_bpf/ [...] s

Re: [PATCH 2/6] test_bpf: allow tests to specify an skb fragment.

2015-08-03 Thread Nicolas Schichan
On 08/03/2015 05:29 PM, Daniel Borkmann wrote: On 08/03/2015 04:02 PM, Nicolas Schichan wrote: We now have 286 tests, which is awesome! Perhaps, we need to start thinking of a better test description method soonish as the test_bpf.ko module grew to ~1.6M, i.e. whenever we add to struct

[PATCH 0/6] test_bpf improvements

2015-08-03 Thread Nicolas Schichan
that the interpreter or JIT correctly resets A and X to 0. This serie is against today's net-next tree. Regards, Nicolas Schichan (6): test_bpf: avoid oopsing the kernel when generate_test_data() fails. test_bpf: allow tests to specify an skb fragment. test_bpf: test LD_ABS and LD_IND instructions

[PATCH 6/6] test_bpf: add tests checking that JIT/interpreter sets A and X to 0.

2015-08-03 Thread Nicolas Schichan
It is mandatory for the JIT or interpreter to reset the A and X registers to 0 before running the filter. Check that it is the case on various ALU and JMP instructions. Signed-off-by: Nicolas Schichan nschic...@freebox.fr Acked-by: Alexei Starovoitov a...@plumgrid.com --- lib/test_bpf.c | 158

[PATCH 2/6] test_bpf: allow tests to specify an skb fragment.

2015-08-03 Thread Nicolas Schichan
This introduce a new test-aux flag (FLAG_SKB_FRAG) to tell the populate_skb() function to add a fragment to the test skb containing the data specified in test-frag_data). Signed-off-by: Nicolas Schichan nschic...@freebox.fr Acked-by: Alexei Starovoitov a...@plumgrid.com --- lib/test_bpf.c | 38

[PATCH 1/6] test_bpf: avoid oopsing the kernel when generate_test_data() fails.

2015-08-03 Thread Nicolas Schichan
Signed-off-by: Nicolas Schichan nschic...@freebox.fr Acked-by: Alexei Starovoitov a...@plumgrid.com --- lib/test_bpf.c | 5 + 1 file changed, 5 insertions(+) diff --git a/lib/test_bpf.c b/lib/test_bpf.c index 3afddf2..6843d0b 100644 --- a/lib/test_bpf.c +++ b/lib/test_bpf.c @@ -4672,6

[PATCH 3/6] test_bpf: test LD_ABS and LD_IND instructions on fragmented skbs.

2015-08-03 Thread Nicolas Schichan
These new tests exercise various load sizes and offsets crossing the head/fragment boundary. Signed-off-by: Nicolas Schichan nschic...@freebox.fr Acked-by: Alexei Starovoitov a...@plumgrid.com --- lib/test_bpf.c | 142 + 1 file changed, 142

[PATCH 4/6] test_bpf: add module parameters to filter the tests to run.

2015-08-03 Thread Nicolas Schichan
invalid range, test id or test name will result in -EINVAL being returned and no tests being run. Signed-off-by: Nicolas Schichan nschic...@freebox.fr --- lib/test_bpf.c | 73 ++ 1 file changed, 73 insertions(+) diff --git a/lib/test_bpf.c b

[PATCH 5/6] test_bpf: add more tests for LD_ABS and LD_IND.

2015-08-03 Thread Nicolas Schichan
This exerces the LD_ABS and LD_IND instructions for various sizes and alignments. This also checks that X when used as an offset to a BPF_IND instruction first in a filter is correctly set to 0. Signed-off-by: Nicolas Schichan nschic...@freebox.fr Acked-by: Alexei Starovoitov a...@plumgrid.com

[PATCH V3 net-next 3/3] ARM: net: add support for BPF_ANC | SKF_AD_HATYPE in ARM JIT.

2015-07-27 Thread Nicolas Schichan
Signed-off-by: Nicolas Schichan nschic...@freebox.fr --- arch/arm/net/bpf_jit_32.c | 22 -- arch/arm/net/bpf_jit_32.h | 3 +++ 2 files changed, 23 insertions(+), 2 deletions(-) diff --git a/arch/arm/net/bpf_jit_32.c b/arch/arm/net/bpf_jit_32.c index 3c73caf..876060b 100644

[PATCH V3 net-next 0/3] ARM BPF JIT features

2015-07-27 Thread Nicolas Schichan
earlier. Regards, Changes from V1 to V2: * split fixes and features in separate patch series. Changes from V2 to V3: * respin against latest net-next. Nicolas Schichan (3): ARM: net: add support for BPF_ANC | SKF_AD_PKTTYPE in ARM JIT. ARM: net: add support for BPF_ANC | SKF_AD_PAY_OFFSET in ARM

[PATCH V3 net-next 1/3] ARM: net: add support for BPF_ANC | SKF_AD_PKTTYPE in ARM JIT.

2015-07-27 Thread Nicolas Schichan
Signed-off-by: Nicolas Schichan nschic...@freebox.fr --- arch/arm/net/bpf_jit_32.c | 11 +++ 1 file changed, 11 insertions(+) diff --git a/arch/arm/net/bpf_jit_32.c b/arch/arm/net/bpf_jit_32.c index c011e22..6ff248c 100644 --- a/arch/arm/net/bpf_jit_32.c +++ b/arch/arm/net/bpf_jit_32.c

[PATCH V3 net-next 2/3] ARM: net: add support for BPF_ANC | SKF_AD_PAY_OFFSET in ARM JIT.

2015-07-27 Thread Nicolas Schichan
Signed-off-by: Nicolas Schichan nschic...@freebox.fr --- arch/arm/net/bpf_jit_32.c | 8 1 file changed, 8 insertions(+) diff --git a/arch/arm/net/bpf_jit_32.c b/arch/arm/net/bpf_jit_32.c index 6ff248c..3c73caf 100644 --- a/arch/arm/net/bpf_jit_32.c +++ b/arch/arm/net/bpf_jit_32.c

[PATCH V2 net 0/3] BPF JIT fixes for ARM

2015-07-21 Thread Nicolas Schichan
. Nicolas Schichan (3): ARM: net: fix condition for load_order 0 when translating load instructions. ARM: net: handle negative offsets in BPF JIT. ARM: net: fix vlan access instructions in ARM JIT. arch/arm/net/bpf_jit_32.c | 57 --- 1 file

[PATCH V2 net 1/3] ARM: net: fix condition for load_order 0 when translating load instructions.

2015-07-21 Thread Nicolas Schichan
greater than 0. Signed-off-by: Nicolas Schichan nschic...@freebox.fr --- arch/arm/net/bpf_jit_32.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm/net/bpf_jit_32.c b/arch/arm/net/bpf_jit_32.c index 4550d24..21f5ace 100644 --- a/arch/arm/net/bpf_jit_32.c +++ b/arch/arm/net

[PATCH V2 net 3/3] ARM: net: fix vlan access instructions in ARM JIT.

2015-07-21 Thread Nicolas Schichan
This makes BPF_ANC | SKF_AD_VLAN_TAG and BPF_ANC | SKF_AD_VLAN_TAG_PRESENT have the same behaviour as the in kernel VM and makes the test_bpf LD_VLAN_TAG and LD_VLAN_TAG_PRESENT tests pass. Signed-off-by: Nicolas Schichan nschic...@freebox.fr --- arch/arm/net/bpf_jit_32.c | 8 +--- 1 file

[PATCH V2 net 2/3] ARM: net: handle negative offsets in BPF JIT.

2015-07-21 Thread Nicolas Schichan
path helpers when the offset is negative. Signed-off-by: Nicolas Schichan nschic...@freebox.fr --- arch/arm/net/bpf_jit_32.c | 47 ++- 1 file changed, 38 insertions(+), 9 deletions(-) diff --git a/arch/arm/net/bpf_jit_32.c b/arch/arm/net/bpf_jit_32.c

[PATCH V2 net-next 3/3] ARM: net: add support for BPF_ANC | SKF_AD_HATYPE in ARM JIT.

2015-07-21 Thread Nicolas Schichan
Signed-off-by: Nicolas Schichan nschic...@freebox.fr --- arch/arm/net/bpf_jit_32.c | 22 -- arch/arm/net/bpf_jit_32.h | 3 +++ 2 files changed, 23 insertions(+), 2 deletions(-) diff --git a/arch/arm/net/bpf_jit_32.c b/arch/arm/net/bpf_jit_32.c index fe28beb..6dcff2b 100644

[PATCH V2 net-next 2/3] ARM: net: add support for BPF_ANC | SKF_AD_PAY_OFFSET in ARM JIT.

2015-07-21 Thread Nicolas Schichan
Signed-off-by: Nicolas Schichan nschic...@freebox.fr --- arch/arm/net/bpf_jit_32.c | 8 1 file changed, 8 insertions(+) diff --git a/arch/arm/net/bpf_jit_32.c b/arch/arm/net/bpf_jit_32.c index 67a2d44..fe28beb 100644 --- a/arch/arm/net/bpf_jit_32.c +++ b/arch/arm/net/bpf_jit_32.c

[PATCH V2 next-next 1/3] ARM: net: add support for BPF_ANC | SKF_AD_PKTTYPE in ARM JIT.

2015-07-21 Thread Nicolas Schichan
Signed-off-by: Nicolas Schichan nschic...@freebox.fr --- arch/arm/net/bpf_jit_32.c | 11 +++ 1 file changed, 11 insertions(+) diff --git a/arch/arm/net/bpf_jit_32.c b/arch/arm/net/bpf_jit_32.c index 4550d24..67a2d44 100644 --- a/arch/arm/net/bpf_jit_32.c +++ b/arch/arm/net/bpf_jit_32.c

[PATCH V2 net-next 0/3] ARM BPF JIT features

2015-07-21 Thread Nicolas Schichan
. Regards, Changes from original submission: * split fixes and features in separate patch series. Nicolas Schichan (3): ARM: net: add support for BPF_ANC | SKF_AD_PKTTYPE in ARM JIT. ARM: net: add support for BPF_ANC | SKF_AD_PAY_OFFSET in ARM JIT. ARM: net: add support for BPF_ANC

[PATCH 4/6] ARM: net: add support for BPF_ANC | SKF_AD_PKTTYPE in ARM JIT.

2015-07-16 Thread Nicolas Schichan
Signed-off-by: Nicolas Schichan nschic...@freebox.fr --- arch/arm/net/bpf_jit_32.c | 11 +++ 1 file changed, 11 insertions(+) diff --git a/arch/arm/net/bpf_jit_32.c b/arch/arm/net/bpf_jit_32.c index c011e22..6ff248c 100644 --- a/arch/arm/net/bpf_jit_32.c +++ b/arch/arm/net/bpf_jit_32.c

[PATCH 6/6] ARM: net: add support for BPF_ANC | SKF_AD_HATYPE in ARM JIT.

2015-07-16 Thread Nicolas Schichan
Signed-off-by: Nicolas Schichan nschic...@freebox.fr --- arch/arm/net/bpf_jit_32.c | 22 -- arch/arm/net/bpf_jit_32.h | 3 +++ 2 files changed, 23 insertions(+), 2 deletions(-) diff --git a/arch/arm/net/bpf_jit_32.c b/arch/arm/net/bpf_jit_32.c index 3c73caf..876060b 100644

[PATCH 5/6] ARM: net: add support for BPF_ANC | SKF_AD_PAY_OFFSET in ARM JIT.

2015-07-16 Thread Nicolas Schichan
Signed-off-by: Nicolas Schichan nschic...@freebox.fr --- arch/arm/net/bpf_jit_32.c | 8 1 file changed, 8 insertions(+) diff --git a/arch/arm/net/bpf_jit_32.c b/arch/arm/net/bpf_jit_32.c index 6ff248c..3c73caf 100644 --- a/arch/arm/net/bpf_jit_32.c +++ b/arch/arm/net/bpf_jit_32.c

[PATCH 3/6] ARM: net: fix vlan access instructions in ARM JIT.

2015-07-16 Thread Nicolas Schichan
This makes BPF_ANC | SKF_AD_VLAN_TAG and BPF_ANC | SKF_AD_VLAN_TAG_PRESENT have the same behaviour as the in kernel VM and makes the test_bpf LD_VLAN_TAG and LD_VLAN_TAG_PRESENT tests pass. Signed-off-by: Nicolas Schichan nschic...@freebox.fr --- arch/arm/net/bpf_jit_32.c | 8 +--- 1 file

[PATCH 0/6] BPF JIT fixes and features for ARM

2015-07-16 Thread Nicolas Schichan
. Like previous ARM JIT patches this should go via the net tree. Regards, Nicolas Schichan (6): ARM: net: fix condition for load_order 0 when translating load instructions. ARM: net: handle negative offsets in BPF JIT. ARM: net: fix vlan access instructions in ARM JIT. ARM: net: add

[PATCH 2/6] ARM: net: handle negative offsets in BPF JIT.

2015-07-16 Thread Nicolas Schichan
path helpers when the offset is negative. Signed-off-by: Nicolas Schichan nschic...@freebox.fr --- arch/arm/net/bpf_jit_32.c | 47 ++- 1 file changed, 38 insertions(+), 9 deletions(-) diff --git a/arch/arm/net/bpf_jit_32.c b/arch/arm/net/bpf_jit_32.c

[PATCH 1/6] ARM: net: fix condition for load_order 0 when translating load instructions.

2015-07-16 Thread Nicolas Schichan
greater than 0. Signed-off-by: Nicolas Schichan nschic...@freebox.fr --- arch/arm/net/bpf_jit_32.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm/net/bpf_jit_32.c b/arch/arm/net/bpf_jit_32.c index 4550d24..21f5ace 100644 --- a/arch/arm/net/bpf_jit_32.c +++ b/arch/arm/net