1. 08 11月, 2021 6 次提交
  2. 02 11月, 2021 10 次提交
  3. 01 11月, 2021 4 次提交
  4. 31 10月, 2021 1 次提交
  5. 29 10月, 2021 12 次提交
    • A
      selftests/bpf: Fix fclose/pclose mismatch in test_progs · f48ad690
      Andrea Righi 提交于
      Make sure to use pclose() to properly close the pipe opened by popen().
      
      Fixes: 81f77fd0 ("bpf: add selftest for stackmap with BPF_F_STACK_BUILD_ID")
      Signed-off-by: NAndrea Righi <andrea.righi@canonical.com>
      Signed-off-by: NDaniel Borkmann <daniel@iogearbox.net>
      Reviewed-by: NShuah Khan <skhan@linuxfoundation.org>
      Acked-by: NMartin KaFai Lau <kafai@fb.com>
      Link: https://lore.kernel.org/bpf/20211026143409.42666-1-andrea.righi@canonical.com
      f48ad690
    • N
      selftests: net: bridge: update IGMP/MLD membership interval value · 34d7ecb3
      Nikolay Aleksandrov 提交于
      When I fixed IGMPv3/MLDv2 to use the bridge's multicast_membership_interval
      value which is chosen by user-space instead of calculating it based on
      multicast_query_interval and multicast_query_response_interval I forgot
      to update the selftests relying on that behaviour. Now we have to
      manually set the expected GMI value to perform the tests correctly and get
      proper results (similar to IGMPv2 behaviour).
      
      Fixes: fac3cb82 ("net: bridge: mcast: use multicast_membership_interval for IGMPv3")
      Signed-off-by: NNikolay Aleksandrov <nikolay@nvidia.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      34d7ecb3
    • S
      selftests/net: update .gitignore with newly added tests · e300a85d
      Shuah Khan 提交于
      Update .gitignore with newly added tests:
      	tools/testing/selftests/net/af_unix/test_unix_oob
      	tools/testing/selftests/net/gro
      	tools/testing/selftests/net/ioam6_parser
      	tools/testing/selftests/net/toeplitz
      Signed-off-by: NShuah Khan <skhan@linuxfoundation.org>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      e300a85d
    • P
      selftests: mlxsw: Test port shaper · 2b11e24e
      Petr Machata 提交于
      TBF can be used as a root qdisc, in which case it is supposed to configure
      port shaper. Add a test that verifies that this is so by installing a root
      TBF with a ETS or PRIO below it, and then expecting individual bands to all
      be shaped according to the root TBF configuration.
      Signed-off-by: NPetr Machata <petrm@nvidia.com>
      Signed-off-by: NIdo Schimmel <idosch@nvidia.com>
      Signed-off-by: NJakub Kicinski <kuba@kernel.org>
      2b11e24e
    • P
      selftests: mlxsw: Test offloadability of root TBF · 3d5290ea
      Petr Machata 提交于
      TBF can be used as a root qdisc, with the usual ETS/RED/TBF hierarchy below
      it. This use should now be offloaded. Add a test that verifies that it is.
      Signed-off-by: NPetr Machata <petrm@nvidia.com>
      Signed-off-by: NIdo Schimmel <idosch@nvidia.com>
      Signed-off-by: NJakub Kicinski <kuba@kernel.org>
      3d5290ea
    • D
      tools/testing/selftests/vm/split_huge_page_test.c: fix application of sizeof to pointer · 9c7516d6
      David Yang 提交于
      The coccinelle check report:
      
        ./tools/testing/selftests/vm/split_huge_page_test.c:344:36-42:
        ERROR: application of sizeof to pointer
      
      Use "strlen" to fix it.
      
      Link: https://lkml.kernel.org/r/20211012030116.184027-1-davidcomponentone@gmail.comSigned-off-by: NDavid Yang <davidcomponentone@gmail.com>
      Reported-by: NZeal Robot <zealci@zte.com.cn>
      Cc: Zi Yan <ziy@nvidia.com>
      Cc: Shuah Khan <shuah@kernel.org>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      9c7516d6
    • K
      selftests/bpf: Fix memory leak in test_ima · efadf2ad
      Kumar Kartikeya Dwivedi 提交于
      The allocated ring buffer is never freed, do so in the cleanup path.
      
      Fixes: f446b570 ("bpf/selftests: Update the IMA test to use BPF ring buffer")
      Signed-off-by: NKumar Kartikeya Dwivedi <memxor@gmail.com>
      Signed-off-by: NAlexei Starovoitov <ast@kernel.org>
      Acked-by: NAndrii Nakryiko <andrii@kernel.org>
      Acked-by: NSong Liu <songliubraving@fb.com>
      Link: https://lore.kernel.org/bpf/20211028063501.2239335-9-memxor@gmail.com
      efadf2ad
    • K
      selftests/bpf: Fix fd cleanup in sk_lookup test · c3fc706e
      Kumar Kartikeya Dwivedi 提交于
      Similar to the fix in commit:
      e31eec77 ("bpf: selftests: Fix fd cleanup in get_branch_snapshot")
      
      We use designated initializer to set fds to -1 without breaking on
      future changes to MAX_SERVER constant denoting the array size.
      
      The particular close(0) occurs on non-reuseport tests, so it can be seen
      with -n 115/{2,3} but not 115/4. This can cause problems with future
      tests if they depend on BTF fd never being acquired as fd 0, breaking
      internal libbpf assumptions.
      
      Fixes: 0ab5539f ("selftests/bpf: Tests for BPF_SK_LOOKUP attach point")
      Signed-off-by: NKumar Kartikeya Dwivedi <memxor@gmail.com>
      Signed-off-by: NAlexei Starovoitov <ast@kernel.org>
      Reviewed-by: NJakub Sitnicki <jakub@cloudflare.com>
      Acked-by: NSong Liu <songliubraving@fb.com>
      Link: https://lore.kernel.org/bpf/20211028063501.2239335-8-memxor@gmail.com
      c3fc706e
    • K
      selftests/bpf: Add weak/typeless ksym test for light skeleton · 087cba79
      Kumar Kartikeya Dwivedi 提交于
      Also, avoid using CO-RE features, as lskel doesn't support CO-RE, yet.
      Include both light and libbpf skeleton in same file to test both of them
      together.
      
      In c48e51c8 ("bpf: selftests: Add selftests for module kfunc support"),
      I added support for generating both lskel and libbpf skel for a BPF
      object, however the name parameter for bpftool caused collisions when
      included in same file together. This meant that every test needed a
      separate file for a libbpf/light skeleton separation instead of
      subtests.
      
      Change that by appending a "_lskel" suffix to the name for files using
      light skeleton, and convert all existing users.
      Signed-off-by: NKumar Kartikeya Dwivedi <memxor@gmail.com>
      Signed-off-by: NAlexei Starovoitov <ast@kernel.org>
      Acked-by: NAndrii Nakryiko <andrii@kernel.org>
      Link: https://lore.kernel.org/bpf/20211028063501.2239335-7-memxor@gmail.com
      087cba79
    • J
      bpf/benchs: Add benchmarks for comparing hashmap lookups w/ vs. w/out bloom filter · f44bc543
      Joanne Koong 提交于
      This patch adds benchmark tests for comparing the performance of hashmap
      lookups without the bloom filter vs. hashmap lookups with the bloom filter.
      
      Checking the bloom filter first for whether the element exists should
      overall enable a higher throughput for hashmap lookups, since if the
      element does not exist in the bloom filter, we can avoid a costly lookup in
      the hashmap.
      
      On average, using 5 hash functions in the bloom filter tended to perform
      the best across the widest range of different entry sizes. The benchmark
      results using 5 hash functions (running on 8 threads on a machine with one
      numa node, and taking the average of 3 runs) were roughly as follows:
      
      value_size = 4 bytes -
      	10k entries: 30% faster
      	50k entries: 40% faster
      	100k entries: 40% faster
      	500k entres: 70% faster
      	1 million entries: 90% faster
      	5 million entries: 140% faster
      
      value_size = 8 bytes -
      	10k entries: 30% faster
      	50k entries: 40% faster
      	100k entries: 50% faster
      	500k entres: 80% faster
      	1 million entries: 100% faster
      	5 million entries: 150% faster
      
      value_size = 16 bytes -
      	10k entries: 20% faster
      	50k entries: 30% faster
      	100k entries: 35% faster
      	500k entres: 65% faster
      	1 million entries: 85% faster
      	5 million entries: 110% faster
      
      value_size = 40 bytes -
      	10k entries: 5% faster
      	50k entries: 15% faster
      	100k entries: 20% faster
      	500k entres: 65% faster
      	1 million entries: 75% faster
      	5 million entries: 120% faster
      Signed-off-by: NJoanne Koong <joannekoong@fb.com>
      Signed-off-by: NAlexei Starovoitov <ast@kernel.org>
      Link: https://lore.kernel.org/bpf/20211027234504.30744-6-joannekoong@fb.com
      f44bc543
    • J
      bpf/benchs: Add benchmark tests for bloom filter throughput + false positive · 57fd1c63
      Joanne Koong 提交于
      This patch adds benchmark tests for the throughput (for lookups + updates)
      and the false positive rate of bloom filter lookups, as well as some
      minor refactoring of the bash script for running the benchmarks.
      
      These benchmarks show that as the number of hash functions increases,
      the throughput and the false positive rate of the bloom filter decreases.
      >From the benchmark data, the approximate average false-positive rates
      are roughly as follows:
      
      1 hash function = ~30%
      2 hash functions = ~15%
      3 hash functions = ~5%
      4 hash functions = ~2.5%
      5 hash functions = ~1%
      6 hash functions = ~0.5%
      7 hash functions  = ~0.35%
      8 hash functions = ~0.15%
      9 hash functions = ~0.1%
      10 hash functions = ~0%
      
      For reference data, the benchmarks run on one thread on a machine
      with one numa node for 1 to 5 hash functions for 8-byte and 64-byte
      values are as follows:
      
      1 hash function:
        50k entries
      	8-byte value
      	    Lookups - 51.1 M/s operations
      	    Updates - 33.6 M/s operations
      	    False positive rate: 24.15%
      	64-byte value
      	    Lookups - 15.7 M/s operations
      	    Updates - 15.1 M/s operations
      	    False positive rate: 24.2%
        100k entries
      	8-byte value
      	    Lookups - 51.0 M/s operations
      	    Updates - 33.4 M/s operations
      	    False positive rate: 24.04%
      	64-byte value
      	    Lookups - 15.6 M/s operations
      	    Updates - 14.6 M/s operations
      	    False positive rate: 24.06%
        500k entries
      	8-byte value
      	    Lookups - 50.5 M/s operations
      	    Updates - 33.1 M/s operations
      	    False positive rate: 27.45%
      	64-byte value
      	    Lookups - 15.6 M/s operations
      	    Updates - 14.2 M/s operations
      	    False positive rate: 27.42%
        1 mil entries
      	8-byte value
      	    Lookups - 49.7 M/s operations
      	    Updates - 32.9 M/s operations
      	    False positive rate: 27.45%
      	64-byte value
      	    Lookups - 15.4 M/s operations
      	    Updates - 13.7 M/s operations
      	    False positive rate: 27.58%
        2.5 mil entries
      	8-byte value
      	    Lookups - 47.2 M/s operations
      	    Updates - 31.8 M/s operations
      	    False positive rate: 30.94%
      	64-byte value
      	    Lookups - 15.3 M/s operations
      	    Updates - 13.2 M/s operations
      	    False positive rate: 30.95%
        5 mil entries
      	8-byte value
      	    Lookups - 41.1 M/s operations
      	    Updates - 28.1 M/s operations
      	    False positive rate: 31.01%
      	64-byte value
      	    Lookups - 13.3 M/s operations
      	    Updates - 11.4 M/s operations
      	    False positive rate: 30.98%
      
      2 hash functions:
        50k entries
      	8-byte value
      	    Lookups - 34.1 M/s operations
      	    Updates - 20.1 M/s operations
      	    False positive rate: 9.13%
      	64-byte value
      	    Lookups - 8.4 M/s operations
      	    Updates - 7.9 M/s operations
      	    False positive rate: 9.21%
        100k entries
      	8-byte value
      	    Lookups - 33.7 M/s operations
      	    Updates - 18.9 M/s operations
      	    False positive rate: 9.13%
      	64-byte value
      	    Lookups - 8.4 M/s operations
      	    Updates - 7.7 M/s operations
      	    False positive rate: 9.19%
        500k entries
      	8-byte value
      	    Lookups - 32.7 M/s operations
      	    Updates - 18.1 M/s operations
      	    False positive rate: 12.61%
      	64-byte value
      	    Lookups - 8.4 M/s operations
      	    Updates - 7.5 M/s operations
      	    False positive rate: 12.61%
        1 mil entries
      	8-byte value
      	    Lookups - 30.6 M/s operations
      	    Updates - 18.9 M/s operations
      	    False positive rate: 12.54%
      	64-byte value
      	    Lookups - 8.0 M/s operations
      	    Updates - 7.0 M/s operations
      	    False positive rate: 12.52%
        2.5 mil entries
      	8-byte value
      	    Lookups - 25.3 M/s operations
      	    Updates - 16.7 M/s operations
      	    False positive rate: 16.77%
      	64-byte value
      	    Lookups - 7.9 M/s operations
      	    Updates - 6.5 M/s operations
      	    False positive rate: 16.88%
        5 mil entries
      	8-byte value
      	    Lookups - 20.8 M/s operations
      	    Updates - 14.7 M/s operations
      	    False positive rate: 16.78%
      	64-byte value
      	    Lookups - 7.0 M/s operations
      	    Updates - 6.0 M/s operations
      	    False positive rate: 16.78%
      
      3 hash functions:
        50k entries
      	8-byte value
      	    Lookups - 25.1 M/s operations
      	    Updates - 14.6 M/s operations
      	    False positive rate: 7.65%
      	64-byte value
      	    Lookups - 5.8 M/s operations
      	    Updates - 5.5 M/s operations
      	    False positive rate: 7.58%
        100k entries
      	8-byte value
      	    Lookups - 24.7 M/s operations
      	    Updates - 14.1 M/s operations
      	    False positive rate: 7.71%
      	64-byte value
      	    Lookups - 5.8 M/s operations
      	    Updates - 5.3 M/s operations
      	    False positive rate: 7.62%
        500k entries
      	8-byte value
      	    Lookups - 22.9 M/s operations
      	    Updates - 13.9 M/s operations
      	    False positive rate: 2.62%
      	64-byte value
      	    Lookups - 5.6 M/s operations
      	    Updates - 4.8 M/s operations
      	    False positive rate: 2.7%
        1 mil entries
      	8-byte value
      	    Lookups - 19.8 M/s operations
      	    Updates - 12.6 M/s operations
      	    False positive rate: 2.60%
      	64-byte value
      	    Lookups - 5.3 M/s operations
      	    Updates - 4.4 M/s operations
      	    False positive rate: 2.69%
        2.5 mil entries
      	8-byte value
      	    Lookups - 16.2 M/s operations
      	    Updates - 10.7 M/s operations
      	    False positive rate: 4.49%
      	64-byte value
      	    Lookups - 4.9 M/s operations
      	    Updates - 4.1 M/s operations
      	    False positive rate: 4.41%
        5 mil entries
      	8-byte value
      	    Lookups - 18.8 M/s operations
      	    Updates - 9.2 M/s operations
      	    False positive rate: 4.45%
      	64-byte value
      	    Lookups - 5.2 M/s operations
      	    Updates - 3.9 M/s operations
      	    False positive rate: 4.54%
      
      4 hash functions:
        50k entries
      	8-byte value
      	    Lookups - 19.7 M/s operations
      	    Updates - 11.1 M/s operations
      	    False positive rate: 1.01%
      	64-byte value
      	    Lookups - 4.4 M/s operations
      	    Updates - 4.0 M/s operations
      	    False positive rate: 1.00%
        100k entries
      	8-byte value
      	    Lookups - 19.5 M/s operations
      	    Updates - 10.9 M/s operations
      	    False positive rate: 1.00%
      	64-byte value
      	    Lookups - 4.3 M/s operations
      	    Updates - 3.9 M/s operations
      	    False positive rate: 0.97%
        500k entries
      	8-byte value
      	    Lookups - 18.2 M/s operations
      	    Updates - 10.6 M/s operations
      	    False positive rate: 2.05%
      	64-byte value
      	    Lookups - 4.3 M/s operations
      	    Updates - 3.7 M/s operations
      	    False positive rate: 2.05%
        1 mil entries
      	8-byte value
      	    Lookups - 15.5 M/s operations
      	    Updates - 9.6 M/s operations
      	    False positive rate: 1.99%
      	64-byte value
      	    Lookups - 4.0 M/s operations
      	    Updates - 3.4 M/s operations
      	    False positive rate: 1.99%
        2.5 mil entries
      	8-byte value
      	    Lookups - 13.8 M/s operations
      	    Updates - 7.7 M/s operations
      	    False positive rate: 3.91%
      	64-byte value
      	    Lookups - 3.7 M/s operations
      	    Updates - 3.6 M/s operations
      	    False positive rate: 3.78%
        5 mil entries
      	8-byte value
      	    Lookups - 13.0 M/s operations
      	    Updates - 6.9 M/s operations
      	    False positive rate: 3.93%
      	64-byte value
      	    Lookups - 3.5 M/s operations
      	    Updates - 3.7 M/s operations
      	    False positive rate: 3.39%
      
      5 hash functions:
        50k entries
      	8-byte value
      	    Lookups - 16.4 M/s operations
      	    Updates - 9.1 M/s operations
      	    False positive rate: 0.78%
      	64-byte value
      	    Lookups - 3.5 M/s operations
      	    Updates - 3.2 M/s operations
      	    False positive rate: 0.77%
        100k entries
      	8-byte value
      	    Lookups - 16.3 M/s operations
      	    Updates - 9.0 M/s operations
      	    False positive rate: 0.79%
      	64-byte value
      	    Lookups - 3.5 M/s operations
      	    Updates - 3.2 M/s operations
      	    False positive rate: 0.78%
        500k entries
      	8-byte value
      	    Lookups - 15.1 M/s operations
      	    Updates - 8.8 M/s operations
      	    False positive rate: 1.82%
      	64-byte value
      	    Lookups - 3.4 M/s operations
      	    Updates - 3.0 M/s operations
      	    False positive rate: 1.78%
        1 mil entries
      	8-byte value
      	    Lookups - 13.2 M/s operations
      	    Updates - 7.8 M/s operations
      	    False positive rate: 1.81%
      	64-byte value
      	    Lookups - 3.2 M/s operations
      	    Updates - 2.8 M/s operations
      	    False positive rate: 1.80%
        2.5 mil entries
      	8-byte value
      	    Lookups - 10.5 M/s operations
      	    Updates - 5.9 M/s operations
      	    False positive rate: 0.29%
      	64-byte value
      	    Lookups - 3.2 M/s operations
      	    Updates - 2.4 M/s operations
      	    False positive rate: 0.28%
        5 mil entries
      	8-byte value
      	    Lookups - 9.6 M/s operations
      	    Updates - 5.7 M/s operations
      	    False positive rate: 0.30%
      	64-byte value
      	    Lookups - 3.2 M/s operations
      	    Updates - 2.7 M/s operations
      	    False positive rate: 0.30%
      Signed-off-by: NJoanne Koong <joannekoong@fb.com>
      Signed-off-by: NAlexei Starovoitov <ast@kernel.org>
      Acked-by: NAndrii Nakryiko <andrii@kernel.org>
      Link: https://lore.kernel.org/bpf/20211027234504.30744-5-joannekoong@fb.com
      57fd1c63
    • J
      selftests/bpf: Add bloom filter map test cases · ed9109ad
      Joanne Koong 提交于
      This patch adds test cases for bpf bloom filter maps. They include tests
      checking against invalid operations by userspace, tests for using the
      bloom filter map as an inner map, and a bpf program that queries the
      bloom filter map for values added by a userspace program.
      Signed-off-by: NJoanne Koong <joannekoong@fb.com>
      Signed-off-by: NAlexei Starovoitov <ast@kernel.org>
      Acked-by: NAndrii Nakryiko <andrii@kernel.org>
      Link: https://lore.kernel.org/bpf/20211027234504.30744-4-joannekoong@fb.com
      ed9109ad
  6. 28 10月, 2021 5 次提交
  7. 27 10月, 2021 2 次提交