1. 12 May, 2014 4 commits
    • David S. Miller's avatar
      Merge branch 'filter-next' · bb399fbd
      David S. Miller authored
      Alexei Starovoitov says:
      
      ====================
      BPF testsuite and cleanup
      
      This patchset adds BPF testsuite and improves readability of classic
      to internal BPF converter.
      
      The testsuite helped to find 'negative offset bug' in x64 JIT that was
      fixed by commit fdfaf64e ("x86: bpf_jit: support negative offsets")
      
      It can be very useful for classic and internal JIT compiler developers.
      Also it serves as performance benchmark.
      
      x86_64/i386 pass all tests with and without JIT. arm32 JIT is failing
      negative offset tests which are unsupported.
      
      Internal BPF tests are much larger than classic tests to cover different
      combinations of registers. Negative tests check correctness of classic
      BPF verifier which must reject them.
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      bb399fbd
    • Alexei Starovoitov's avatar
      net: filter: additional BPF tests · 9def624a
      Alexei Starovoitov authored
      All tests should pass with and without JIT.
      
      Example output:
      test_bpf: #0 TAX 35 16 16 PASS
      test_bpf: #1 TXA 7 7 7 PASS
      test_bpf: #2 ADD_SUB_MUL_K 10 PASS
      test_bpf: #3 DIV_KX 33 PASS
      test_bpf: #4 AND_OR_LSH_K 10 10 PASS
      test_bpf: #5 LD_IND 8 8 8 PASS
      test_bpf: #6 LD_ABS 8 8 8 PASS
      test_bpf: #7 LD_ABS_LL 13 14 PASS
      test_bpf: #8 LD_IND_LL 12 12 12 PASS
      test_bpf: #9 LD_ABS_NET 10 12 PASS
      test_bpf: #10 LD_IND_NET 11 12 12 PASS
      ...
      
      Numbers are times in nsec per filter for given input data.
      Signed-off-by: default avatarAlexei Starovoitov <ast@plumgrid.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      9def624a
    • Alexei Starovoitov's avatar
      net: filter: BPF testsuite · 64a8946b
      Alexei Starovoitov authored
      The testsuite covers classic and internal BPF instructions.
      It is particularly useful for JIT compiler developers.
      Adds to "net" selftest target.
      
      The testsuite can be used as a set of micro-benchmarks.
      It measures execution time of each BPF program in nsec.
      
      This patch adds core framework.
      Signed-off-by: default avatarAlexei Starovoitov <ast@plumgrid.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      64a8946b
    • Alexei Starovoitov's avatar
      net: filter: make BPF conversion more readable · 9739eef1
      Alexei Starovoitov authored
      Introduce BPF helper macros to define instructions
      (similar to old BPF_STMT/BPF_JUMP macros)
      
      Use them while converting classic BPF to internal
      and in BPF testsuite later.
      Signed-off-by: default avatarAlexei Starovoitov <ast@plumgrid.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      9739eef1
  2. 09 May, 2014 36 commits