<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/tools/testing/selftests/bpf/test_maps.c, branch linux-6.0.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-6.0.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-6.0.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2022-10-21T10:39:09Z</updated>
<entry>
<title>selftests/bpf: Free the allocated resources after test case succeeds</title>
<updated>2022-10-21T10:39:09Z</updated>
<author>
<name>Hou Tao</name>
</author>
<published>2022-09-21T07:00:35Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=7922f6ca1dd85cf223731e7668c9350131cfab3c'/>
<id>urn:sha1:7922f6ca1dd85cf223731e7668c9350131cfab3c</id>
<content type='text'>
[ Upstream commit 103d002fb7d548fb1187e350f2b73788558128b9 ]

Free the created fd or allocated bpf_object after test case succeeds,
else there will be resource leaks.

Spotted by using address sanitizer and checking the content of
/proc/$pid/fd directory.

Signed-off-by: Hou Tao &lt;houtao1@huawei.com&gt;
Link: https://lore.kernel.org/r/20220921070035.2016413-3-houtao@huaweicloud.com
Signed-off-by: Martin KaFai Lau &lt;martin.lau@kernel.org&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>selftests/bpf: Remove usage of deprecated feature probing APIs</title>
<updated>2022-02-03T15:32:25Z</updated>
<author>
<name>Andrii Nakryiko</name>
</author>
<published>2022-02-02T22:59:14Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=32e608f82946e1e600f8c92b765c18b7189e596d'/>
<id>urn:sha1:32e608f82946e1e600f8c92b765c18b7189e596d</id>
<content type='text'>
Switch to libbpf_probe_*() APIs instead of the deprecated ones.

Signed-off-by: Andrii Nakryiko &lt;andrii@kernel.org&gt;
Signed-off-by: Daniel Borkmann &lt;daniel@iogearbox.net&gt;
Reviewed-by: Quentin Monnet &lt;quentin@isovalent.com&gt;
Link: https://lore.kernel.org/bpf/20220202225916.3313522-5-andrii@kernel.org
</content>
</entry>
<entry>
<title>selftests/bpf: Remove explicit setrlimit(RLIMIT_MEMLOCK) in main selftests</title>
<updated>2021-12-14T21:16:54Z</updated>
<author>
<name>Andrii Nakryiko</name>
</author>
<published>2021-12-14T19:59:04Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=c164b8b40422ef5c643d08bbc63280e1e1610573'/>
<id>urn:sha1:c164b8b40422ef5c643d08bbc63280e1e1610573</id>
<content type='text'>
As libbpf now is able to automatically take care of RLIMIT_MEMLOCK
increase (or skip it altogether on recent enough kernels), remove
explicit setrlimit() invocations in bench, test_maps, test_verifier, and
test_progs.

Signed-off-by: Andrii Nakryiko &lt;andrii@kernel.org&gt;
Signed-off-by: Daniel Borkmann &lt;daniel@iogearbox.net&gt;
Link: https://lore.kernel.org/bpf/20211214195904.1785155-3-andrii@kernel.org
</content>
</entry>
<entry>
<title>selftests/bpf: Migrate selftests to bpf_map_create()</title>
<updated>2021-11-25T22:37:38Z</updated>
<author>
<name>Andrii Nakryiko</name>
</author>
<published>2021-11-24T19:32:33Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=2fe256a429cb6c0b0064563af4158470143a363c'/>
<id>urn:sha1:2fe256a429cb6c0b0064563af4158470143a363c</id>
<content type='text'>
Conversion is straightforward for most cases. In few cases tests are
using mutable map_flags and attribute structs, but bpf_map_create_opts
can be used in the similar fashion, so there were no problems. Just lots
of repetitive conversions.

Signed-off-by: Andrii Nakryiko &lt;andrii@kernel.org&gt;
Signed-off-by: Daniel Borkmann &lt;daniel@iogearbox.net&gt;
Link: https://lore.kernel.org/bpf/20211124193233.3115996-5-andrii@kernel.org
</content>
</entry>
<entry>
<title>selftests/bpf: Use explicit bpf_prog_test_load() calls everywhere</title>
<updated>2021-11-07T16:34:23Z</updated>
<author>
<name>Andrii Nakryiko</name>
</author>
<published>2021-11-03T22:08:44Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=cbdb1461dcf45765a036e9f6975ffe19e69bdc33'/>
<id>urn:sha1:cbdb1461dcf45765a036e9f6975ffe19e69bdc33</id>
<content type='text'>
-Dbpf_prog_load_deprecated=bpf_prog_test_load trick is both ugly and
breaks when deprecation goes into effect due to macro magic. Convert all
the uses to explicit bpf_prog_test_load() calls which avoid deprecation
errors and makes everything less magical.

Signed-off-by: Andrii Nakryiko &lt;andrii@kernel.org&gt;
Signed-off-by: Alexei Starovoitov &lt;ast@kernel.org&gt;
Acked-by: Dave Marchevsky &lt;davemarchevsky@fb.com&gt;
Link: https://lore.kernel.org/bpf/20211103220845.2676888-12-andrii@kernel.org
</content>
</entry>
<entry>
<title>selftests/bpf: Enlarge select() timeout for test_maps</title>
<updated>2021-08-24T21:01:10Z</updated>
<author>
<name>Li Zhijian</name>
</author>
<published>2021-08-20T01:55:53Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=2d82d73da35b72b53fe0d96350a2b8d929d07e42'/>
<id>urn:sha1:2d82d73da35b72b53fe0d96350a2b8d929d07e42</id>
<content type='text'>
0Day robot observed that it's easily timeout on a heavy load host.
-------------------
 # selftests: bpf: test_maps
 # Fork 1024 tasks to 'test_update_delete'
 # Fork 1024 tasks to 'test_update_delete'
 # Fork 100 tasks to 'test_hashmap'
 # Fork 100 tasks to 'test_hashmap_percpu'
 # Fork 100 tasks to 'test_hashmap_sizes'
 # Fork 100 tasks to 'test_hashmap_walk'
 # Fork 100 tasks to 'test_arraymap'
 # Fork 100 tasks to 'test_arraymap_percpu'
 # Failed sockmap unexpected timeout
 not ok 3 selftests: bpf: test_maps # exit=1
 # selftests: bpf: test_lru_map
 # nr_cpus:8
-------------------
Since this test will be scheduled by 0Day to a random host that could have
only a few cpus(2-8), enlarge the timeout to avoid a false NG report.

In practice, i tried to pin it to only one cpu by 'taskset 0x01 ./test_maps',
and knew 10S is likely enough, but i still perfer to a larger value 30.

Reported-by: kernel test robot &lt;lkp@intel.com&gt;
Signed-off-by: Li Zhijian &lt;lizhijian@cn.fujitsu.com&gt;
Signed-off-by: Alexei Starovoitov &lt;ast@kernel.org&gt;
Acked-by: Song Liu &lt;songliubraving@fb.com&gt;
Link: https://lore.kernel.org/bpf/20210820015556.23276-2-lizhijian@cn.fujitsu.com
</content>
</entry>
<entry>
<title>selftests/bpf: Add exponential backoff to map_delete_retriable in test_maps</title>
<updated>2021-08-17T15:17:40Z</updated>
<author>
<name>Yucong Sun</name>
</author>
<published>2021-08-17T04:57:13Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=857f75ea845706a0ec65ce2239da519214a4451a'/>
<id>urn:sha1:857f75ea845706a0ec65ce2239da519214a4451a</id>
<content type='text'>
Using a fixed delay of 1 microsecond has proven flaky in slow CPU environment,
e.g. Github Actions CI system. This patch adds exponential backoff with a cap
of 50ms to reduce the flakiness of the test. Initial delay is chosen at random
in the range [0ms, 5ms).

Signed-off-by: Yucong Sun &lt;fallentree@fb.com&gt;
Signed-off-by: Andrii Nakryiko &lt;andrii@kernel.org&gt;
Link: https://lore.kernel.org/bpf/20210817045713.3307985-1-fallentree@fb.com
</content>
</entry>
<entry>
<title>selftests/bpf: Add exponential backoff to map_update_retriable in test_maps</title>
<updated>2021-08-17T02:13:20Z</updated>
<author>
<name>Yucong Sun</name>
</author>
<published>2021-08-16T17:52:50Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=3c3bd542ffbb2ac09631313ede46ae66660ae550'/>
<id>urn:sha1:3c3bd542ffbb2ac09631313ede46ae66660ae550</id>
<content type='text'>
Using a fixed delay of 1 microsecond has proven flaky in slow CPU environment,
e.g. Github Actions CI system. This patch adds exponential backoff with a cap
of 50ms to reduce the flakiness of the test. Initial delay is chosen at random
in the range [0ms, 5ms).

Signed-off-by: Yucong Sun &lt;fallentree@fb.com&gt;
Signed-off-by: Andrii Nakryiko &lt;andrii@kernel.org&gt;
Acked-by: Song Liu &lt;songliubraving@fb.com&gt;
Link: https://lore.kernel.org/bpf/20210816175250.296110-1-fallentree@fb.com
</content>
</entry>
<entry>
<title>selftests/bpf: Mute expected invalid map creation error msg</title>
<updated>2021-07-22T23:44:10Z</updated>
<author>
<name>Martynas Pumputis</name>
</author>
<published>2021-07-21T14:09:41Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=9907442fcddbdacf55fa22e31f2306ae0d6172d6'/>
<id>urn:sha1:9907442fcddbdacf55fa22e31f2306ae0d6172d6</id>
<content type='text'>
Previously, the newly introduced test case in test_map_in_map(), which
checks whether the inner map is destroyed after unsuccessful creation of
the outer map, logged the following harmless and expected error:

    libbpf: map 'mim': failed to create: Invalid argument(-22) libbpf:
    failed to load object './test_map_in_map_invalid.o'

To avoid any possible confusion, mute the logging during loading of the
prog.

Fixes: 08f71a1e39a1 ("selftests/bpf: Check inner map deletion")
Reported-by: Andrii Nakryiko &lt;andrii@kernel.org&gt;
Signed-off-by: Martynas Pumputis &lt;m@lambda.lt&gt;
Signed-off-by: Andrii Nakryiko &lt;andrii@kernel.org&gt;
Link: https://lore.kernel.org/bpf/20210721140941.563175-1-m@lambda.lt
</content>
</entry>
<entry>
<title>bpf, selftests: Fix test_maps now that sockmap supports UDP</title>
<updated>2021-07-20T20:18:51Z</updated>
<author>
<name>John Fastabend</name>
</author>
<published>2021-07-20T18:48:32Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=c39aa21599748f3845a47645f482d94099b11460'/>
<id>urn:sha1:c39aa21599748f3845a47645f482d94099b11460</id>
<content type='text'>
UDP socket support was added recently so testing UDP insert failure is no
longer correct and causes test_maps failure. The fix is easy though, we
simply need to test that UDP is correctly added instead of blocked.

Fixes: 122e6c79efe1c ("sock_map: Update sock type checks for UDP")
Reported-by: Andrii Nakryiko &lt;andrii@kernel.org&gt;
Signed-off-by: John Fastabend &lt;john.fastabend@gmail.com&gt;
Signed-off-by: Andrii Nakryiko &lt;andrii@kernel.org&gt;
Link: https://lore.kernel.org/bpf/20210720184832.452430-1-john.fastabend@gmail.com
</content>
</entry>
</feed>
