<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/tools/testing/selftests/bpf/prog_tests/reference_tracking.c, branch linux-5.17.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-5.17.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-5.17.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2021-09-28T20:51:19Z</updated>
<entry>
<title>selftests/bpf: Switch SEC("classifier*") usage to a strict SEC("tc")</title>
<updated>2021-09-28T20:51:19Z</updated>
<author>
<name>Andrii Nakryiko</name>
</author>
<published>2021-09-28T16:19:39Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=c22bdd28257f3532092746b31856932d84ca2e2b'/>
<id>urn:sha1:c22bdd28257f3532092746b31856932d84ca2e2b</id>
<content type='text'>
Convert all SEC("classifier*") uses to a new and strict SEC("tc")
section name. In reference_tracking selftests switch from ambiguous
searching by program title (section name) to non-ambiguous searching by
name in some selftests, getting closer to completely removing
bpf_object__find_program_by_title().

Signed-off-by: Andrii Nakryiko &lt;andrii@kernel.org&gt;
Signed-off-by: Alexei Starovoitov &lt;ast@kernel.org&gt;
Link: https://lore.kernel.org/bpf/20210928161946.2512801-4-andrii@kernel.org
</content>
</entry>
<entry>
<title>selftests/bpf: Stop using bpf_program__load</title>
<updated>2021-09-17T21:02:05Z</updated>
<author>
<name>Dave Marchevsky</name>
</author>
<published>2021-09-17T18:29:04Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=84b4c52960bdccd86d6c3c42a730fd8d0ab75427'/>
<id>urn:sha1:84b4c52960bdccd86d6c3c42a730fd8d0ab75427</id>
<content type='text'>
bpf_program__load is not supposed to be used directly. Replace it with
bpf_object__ APIs for the reference_tracking prog_test, which is the
last offender in bpf selftests.

Some additional complexity is added for this test, namely the use of one
bpf_object to iterate through progs, while a second bpf_object is
created and opened/closed to test actual loading of progs. This is
because the test was doing bpf_program__load then __unload to test
loading of individual progs and same semantics with
bpf_object__load/__unload result in failure to load an __unload-ed obj.

Signed-off-by: Dave Marchevsky &lt;davemarchevsky@fb.com&gt;
Signed-off-by: Alexei Starovoitov &lt;ast@kernel.org&gt;
Acked-by: Andrii Nakryiko &lt;andrii@kernel.org&gt;
Link: https://lore.kernel.org/bpf/20210917182911.2426606-3-davemarchevsky@fb.com
</content>
</entry>
<entry>
<title>selftests/bpf: Rename reference_tracking BPF programs</title>
<updated>2021-08-06T15:18:33Z</updated>
<author>
<name>Andrii Nakryiko</name>
</author>
<published>2021-08-05T23:07:34Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=579345e7f2190c1ee97f44154526dcd458ea790d'/>
<id>urn:sha1:579345e7f2190c1ee97f44154526dcd458ea790d</id>
<content type='text'>
BPF programs for reference_tracking selftest use "fail_" prefix to notify that
they are expected to fail. This is really confusing and inconvenient when
trying to grep through test_progs output to find *actually* failed tests. So
rename the prefix from "fail_" to "err_".

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/20210805230734.437914-1-andrii@kernel.org
</content>
</entry>
<entry>
<title>selftests/bpf: Turn on libbpf 1.0 mode and fix all IS_ERR checks</title>
<updated>2021-05-26T00:32:35Z</updated>
<author>
<name>Andrii Nakryiko</name>
</author>
<published>2021-05-25T03:59:32Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=bad2e478af3b4df9fd84b4db7779ea91bd618c16'/>
<id>urn:sha1:bad2e478af3b4df9fd84b4db7779ea91bd618c16</id>
<content type='text'>
Turn ony libbpf 1.0 mode. Fix all the explicit IS_ERR checks that now will be
broken because libbpf returns NULL on error (and sets errno). Fix
ASSERT_OK_PTR and ASSERT_ERR_PTR to work for both old mode and new modes and
use them throughout selftests. This is trivial to do by using
libbpf_get_error() API that all libbpf users are supposed to use, instead of
IS_ERR checks.

A bunch of checks also did explicit -1 comparison for various fd-returning
APIs. Such checks are replaced with &gt;= 0 or &lt; 0 cases.

There were also few misuses of bpf_object__find_map_by_name() in test_maps.
Those are fixed in this patch as well.

Signed-off-by: Andrii Nakryiko &lt;andrii@kernel.org&gt;
Signed-off-by: Alexei Starovoitov &lt;ast@kernel.org&gt;
Acked-by: John Fastabend &lt;john.fastabend@gmail.com&gt;
Acked-by: Toke Høiland-Jørgensen &lt;toke@redhat.com&gt;
Link: https://lore.kernel.org/bpf/20210525035935.1461796-3-andrii@kernel.org
</content>
</entry>
<entry>
<title>selftests/bpf: Don't use deprecated libbpf APIs</title>
<updated>2020-09-04T00:14:40Z</updated>
<author>
<name>Andrii Nakryiko</name>
</author>
<published>2020-09-03T20:35:37Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=a7659cc30bc9210d885692d175f4bc6f3a9a2175'/>
<id>urn:sha1:a7659cc30bc9210d885692d175f4bc6f3a9a2175</id>
<content type='text'>
Remove all uses of bpf_program__title() and
bpf_program__find_program_by_title().

Signed-off-by: Andrii Nakryiko &lt;andriin@fb.com&gt;
Signed-off-by: Alexei Starovoitov &lt;ast@kernel.org&gt;
Link: https://lore.kernel.org/bpf/20200903203542.15944-10-andriin@fb.com
</content>
</entry>
<entry>
<title>libbpf: Make DECLARE_LIBBPF_OPTS macro strictly a variable declaration</title>
<updated>2019-10-22T19:35:03Z</updated>
<author>
<name>Andrii Nakryiko</name>
</author>
<published>2019-10-22T17:21:00Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=e00aca65e646da08f8dce31c9b89f11dab76198c'/>
<id>urn:sha1:e00aca65e646da08f8dce31c9b89f11dab76198c</id>
<content type='text'>
LIBBPF_OPTS is implemented as a mix of field declaration and memset
+ assignment. This makes it neither variable declaration nor purely
statements, which is a problem, because you can't mix it with either
other variable declarations nor other function statements, because C90
compiler mode emits warning on mixing all that together.

This patch changes LIBBPF_OPTS into a strictly declaration of variable
and solves this problem, as can be seen in case of bpftool, which
previously would emit compiler warning, if done this way (LIBBPF_OPTS as
part of function variables declaration block).

This patch also renames LIBBPF_OPTS into DECLARE_LIBBPF_OPTS to follow
kernel convention for similar macros more closely.

v1-&gt;v2:
- rename LIBBPF_OPTS into DECLARE_LIBBPF_OPTS (Jakub Sitnicki).

Signed-off-by: Andrii Nakryiko &lt;andriin@fb.com&gt;
Signed-off-by: Daniel Borkmann &lt;daniel@iogearbox.net&gt;
Acked-by: Toke Høiland-Jørgensen &lt;toke@redhat.com&gt;
Link: https://lore.kernel.org/bpf/20191022172100.3281465-1-andriin@fb.com
</content>
</entry>
<entry>
<title>selftests/bpf: Make reference_tracking test use subtests</title>
<updated>2019-10-21T12:49:12Z</updated>
<author>
<name>Andrii Nakryiko</name>
</author>
<published>2019-10-21T03:39:01Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=8af1c8b8d6223c31fada6148fd870257407952d1'/>
<id>urn:sha1:8af1c8b8d6223c31fada6148fd870257407952d1</id>
<content type='text'>
reference_tracking is actually a set of 9 sub-tests. Make it explicitly so.

Also, add explicit "classifier/" prefix to BPF program section names to
let libbpf correctly guess program type. Thus, also remove explicit
bpf_prog__set_type() call.

Signed-off-by: Andrii Nakryiko &lt;andriin@fb.com&gt;
Signed-off-by: Daniel Borkmann &lt;daniel@iogearbox.net&gt;
Link: https://lore.kernel.org/bpf/20191021033902.3856966-7-andriin@fb.com
</content>
</entry>
<entry>
<title>selftests/bpf: switch tests to new bpf_object__open_{file, mem}() APIs</title>
<updated>2019-10-06T01:09:48Z</updated>
<author>
<name>Andrii Nakryiko</name>
</author>
<published>2019-10-04T22:40:37Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=928ca75e59d7cf10ad2c4b446c7b5d046e244027'/>
<id>urn:sha1:928ca75e59d7cf10ad2c4b446c7b5d046e244027</id>
<content type='text'>
Verify new bpf_object__open_mem() and bpf_object__open_file() APIs work
as expected by switching test_attach_probe test to use embedded BPF
object and bpf_object__open_mem() and test_reference_tracking to
bpf_object__open_file().

Signed-off-by: Andrii Nakryiko &lt;andriin@fb.com&gt;
Signed-off-by: Alexei Starovoitov &lt;ast@kernel.org&gt;
</content>
</entry>
<entry>
<title>selftests/bpf: test_progs: remove global fail/success counts</title>
<updated>2019-08-27T22:35:40Z</updated>
<author>
<name>Stanislav Fomichev</name>
</author>
<published>2019-08-21T23:44:25Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=d38835b75f67df16cef65c14aa64796a1832e6b4'/>
<id>urn:sha1:d38835b75f67df16cef65c14aa64796a1832e6b4</id>
<content type='text'>
Now that we have a global per-test/per-environment state, there
is no longer need to have global fail/success counters (and there
is no need to save/get the diff before/after the test).

Introduce CHECK_FAIL macro (suggested by Andrii) and covert existing tests
to it. CHECK_FAIL uses new test__fail() to record the failure.

Cc: Andrii Nakryiko &lt;andriin@fb.com&gt;
Signed-off-by: Stanislav Fomichev &lt;sdf@google.com&gt;
Signed-off-by: Daniel Borkmann &lt;daniel@iogearbox.net&gt;
</content>
</entry>
<entry>
<title>selftest/bpf: centralize libbpf logging management for test_progs</title>
<updated>2019-07-28T05:36:19Z</updated>
<author>
<name>Andrii Nakryiko</name>
</author>
<published>2019-07-28T03:25:27Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=329e38f76cc2a77085264ce6e0dbe902c33fd7a3'/>
<id>urn:sha1:329e38f76cc2a77085264ce6e0dbe902c33fd7a3</id>
<content type='text'>
Make test_progs test runner own libbpf logging. Also introduce two
levels of verbosity: -v and -vv. First one will be used in subsequent
patches to enable test log output always. Second one increases verbosity
level of libbpf logging further to include debug output as well.

Signed-off-by: Andrii Nakryiko &lt;andriin@fb.com&gt;
Signed-off-by: Alexei Starovoitov &lt;ast@kernel.org&gt;
</content>
</entry>
</feed>
