<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/tools/testing/selftests/bpf/progs/map_ptr_kern.c, branch linux-6.2.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.</subtitle>
<id>https://universe.0xinfinity.dev/distro/kernel/atom?h=linux-6.2.y</id>
<link rel='self' href='https://universe.0xinfinity.dev/distro/kernel/atom?h=linux-6.2.y'/>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/'/>
<updated>2022-03-30T12:17:25Z</updated>
<entry>
<title>selftests/bpf: Fix warning comparing pointer to 0</title>
<updated>2022-03-30T12:17:25Z</updated>
<author>
<name>Haowen Bai</name>
<email>baihaowen@meizu.com</email>
</author>
<published>2022-03-30T01:59:48Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=2609f635a20d3691e7b5725edc3bdadb7bedf8fb'/>
<id>urn:sha1:2609f635a20d3691e7b5725edc3bdadb7bedf8fb</id>
<content type='text'>
Avoid pointer type value compared with 0 to make code clear. Reported by
coccicheck:

  tools/testing/selftests/bpf/progs/map_ptr_kern.c:370:21-22:
  WARNING comparing pointer to 0
  tools/testing/selftests/bpf/progs/map_ptr_kern.c:397:21-22:
  WARNING comparing pointer to 0

Signed-off-by: Haowen Bai &lt;baihaowen@meizu.com&gt;
Signed-off-by: Daniel Borkmann &lt;daniel@iogearbox.net&gt;
Acked-by: Yonghong Song &lt;yhs@fb.com&gt;
Link: https://lore.kernel.org/bpf/1648605588-19269-1-git-send-email-baihaowen@meizu.com
</content>
</entry>
<entry>
<title>selftests/bpf: Improve inner_map test coverage.</title>
<updated>2021-12-02T19:18:36Z</updated>
<author>
<name>Alexei Starovoitov</name>
<email>ast@kernel.org</email>
</author>
<published>2021-12-01T18:10:36Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=d82fa9b708d7d8a9c275d86c4388d24ecc63206c'/>
<id>urn:sha1:d82fa9b708d7d8a9c275d86c4388d24ecc63206c</id>
<content type='text'>
Check that hash and array inner maps are properly initialized.

Signed-off-by: Alexei Starovoitov &lt;ast@kernel.org&gt;
Signed-off-by: Andrii Nakryiko &lt;andrii@kernel.org&gt;
Acked-by: Andrii Nakryiko &lt;andrii@kernel.org&gt;
Link: https://lore.kernel.org/bpf/20211201181040.23337-14-alexei.starovoitov@gmail.com
</content>
</entry>
<entry>
<title>selftests/bpf: Remove SEC("version") from test progs</title>
<updated>2021-10-08T05:01:56Z</updated>
<author>
<name>Dave Marchevsky</name>
<email>davemarchevsky@fb.com</email>
</author>
<published>2021-10-07T23:12:34Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=dd65acf72d0e073970459d5da80573a04304aaa9'/>
<id>urn:sha1:dd65acf72d0e073970459d5da80573a04304aaa9</id>
<content type='text'>
Since commit 6c4fc209fcf9d ("bpf: remove useless version check for prog
load") these "version" sections, which result in bpf_attr.kern_version
being set, have been unnecessary.

Remove them so that it's obvious to folks using selftests as a guide that
"modern" BPF progs don't need this section.

Signed-off-by: Dave Marchevsky &lt;davemarchevsky@fb.com&gt;
Signed-off-by: Andrii Nakryiko &lt;andrii@kernel.org&gt;
Link: https://lore.kernel.org/bpf/20211007231234.2223081-1-davemarchevsky@fb.com
</content>
</entry>
<entry>
<title>selftests/bpf: Pass page size from userspace in map_ptr</title>
<updated>2021-04-09T06:54:47Z</updated>
<author>
<name>Yauheni Kaliuta</name>
<email>yauheni.kaliuta@redhat.com</email>
</author>
<published>2021-04-08T06:13:05Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=7a85e4dfa7f5d052ae5016e96f1ee426a8870e78'/>
<id>urn:sha1:7a85e4dfa7f5d052ae5016e96f1ee426a8870e78</id>
<content type='text'>
Use ASSERT to check result but keep CHECK where format was used to
report error.

Use bpf_map__set_max_entries() to set map size dynamically from
userspace according to page size.

Zero-initialize the variable in bpf prog, otherwise it will cause
problems on some versions of Clang.

Signed-off-by: Yauheni Kaliuta &lt;yauheni.kaliuta@redhat.com&gt;
Signed-off-by: Andrii Nakryiko &lt;andrii@kernel.org&gt;
Link: https://lore.kernel.org/bpf/20210408061310.95877-4-yauheni.kaliuta@redhat.com
</content>
</entry>
<entry>
<title>bpf: Eliminate rlimit-based memory accounting infra for bpf maps</title>
<updated>2020-12-03T02:32:47Z</updated>
<author>
<name>Roman Gushchin</name>
<email>guro@fb.com</email>
</author>
<published>2020-12-01T21:58:58Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=80ee81e0403c48f4eb342f7c8d40477c89b8836a'/>
<id>urn:sha1:80ee81e0403c48f4eb342f7c8d40477c89b8836a</id>
<content type='text'>
Remove rlimit-based accounting infrastructure code, which is not used
anymore.

To provide a backward compatibility, use an approximation of the
bpf map memory footprint as a "memlock" value, available to a user
via map info. The approximation is based on the maximal number of
elements and key and value sizes.

Signed-off-by: Roman Gushchin &lt;guro@fb.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/20201201215900.3569844-33-guro@fb.com
</content>
</entry>
<entry>
<title>selftests/bpf: Add test for map_ptr arithmetic</title>
<updated>2020-09-09T01:04:07Z</updated>
<author>
<name>Yonghong Song</name>
<email>yhs@fb.com</email>
</author>
<published>2020-09-08T17:57:03Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=e6054fc1f865ac46936a6b5517ae2d36554c94f8'/>
<id>urn:sha1:e6054fc1f865ac46936a6b5517ae2d36554c94f8</id>
<content type='text'>
Change selftest map_ptr_kern.c with disabling inlining for
one of subtests, which will fail the test without previous
verifier change. Also added to verifier test for both
"map_ptr += scalar" and "scalar += map_ptr" arithmetic.

Signed-off-by: Yonghong Song &lt;yhs@fb.com&gt;
Signed-off-by: Alexei Starovoitov &lt;ast@kernel.org&gt;
Acked-by: Andrii Nakryiko &lt;andriin@fb.com&gt;
Link: https://lore.kernel.org/bpf/20200908175703.2463721-1-yhs@fb.com
</content>
</entry>
<entry>
<title>bpf: Renames in preparation for bpf_local_storage</title>
<updated>2020-08-25T21:59:58Z</updated>
<author>
<name>KP Singh</name>
<email>kpsingh@google.com</email>
</author>
<published>2020-08-25T18:29:13Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=1f00d375af84fbcdb6dd6c79fd7c3d02d2390338'/>
<id>urn:sha1:1f00d375af84fbcdb6dd6c79fd7c3d02d2390338</id>
<content type='text'>
A purely mechanical change to split the renaming from the actual
generalization.

Flags/consts:

  SK_STORAGE_CREATE_FLAG_MASK	BPF_LOCAL_STORAGE_CREATE_FLAG_MASK
  BPF_SK_STORAGE_CACHE_SIZE	BPF_LOCAL_STORAGE_CACHE_SIZE
  MAX_VALUE_SIZE		BPF_LOCAL_STORAGE_MAX_VALUE_SIZE

Structs:

  bucket			bpf_local_storage_map_bucket
  bpf_sk_storage_map		bpf_local_storage_map
  bpf_sk_storage_data		bpf_local_storage_data
  bpf_sk_storage_elem		bpf_local_storage_elem
  bpf_sk_storage		bpf_local_storage

The "sk" member in bpf_local_storage is also updated to "owner"
in preparation for changing the type to void * in a subsequent patch.

Functions:

  selem_linked_to_sk			selem_linked_to_storage
  selem_alloc				bpf_selem_alloc
  __selem_unlink_sk			bpf_selem_unlink_storage_nolock
  __selem_link_sk			bpf_selem_link_storage_nolock
  selem_unlink_sk			__bpf_selem_unlink_storage
  sk_storage_update			bpf_local_storage_update
  __sk_storage_lookup			bpf_local_storage_lookup
  bpf_sk_storage_map_free		bpf_local_storage_map_free
  bpf_sk_storage_map_alloc		bpf_local_storage_map_alloc
  bpf_sk_storage_map_alloc_check	bpf_local_storage_map_alloc_check
  bpf_sk_storage_map_check_btf		bpf_local_storage_map_check_btf

Signed-off-by: KP Singh &lt;kpsingh@google.com&gt;
Signed-off-by: Alexei Starovoitov &lt;ast@kernel.org&gt;
Acked-by: Martin KaFai Lau &lt;kafai@fb.com&gt;
Link: https://lore.kernel.org/bpf/20200825182919.1118197-2-kpsingh@chromium.org
</content>
</entry>
<entry>
<title>selftests/bpf: Test access to bpf map pointer</title>
<updated>2020-06-22T20:22:59Z</updated>
<author>
<name>Andrey Ignatov</name>
<email>rdna@fb.com</email>
</author>
<published>2020-06-19T21:11:45Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=b1b53d413f16c6b5078edb127e660e67332e4d2f'/>
<id>urn:sha1:b1b53d413f16c6b5078edb127e660e67332e4d2f</id>
<content type='text'>
Add selftests to test access to map pointers from bpf program for all
map types except struct_ops (that one would need additional work).

verifier test focuses mostly on scenarios that must be rejected.

prog_tests test focuses on accessing multiple fields both scalar and a
nested struct from bpf program and verifies that those fields have
expected values.

Signed-off-by: Andrey Ignatov &lt;rdna@fb.com&gt;
Signed-off-by: Daniel Borkmann &lt;daniel@iogearbox.net&gt;
Acked-by: John Fastabend &lt;john.fastabend@gmail.com&gt;
Acked-by: Martin KaFai Lau &lt;kafai@fb.com&gt;
Link: https://lore.kernel.org/bpf/139a6a17f8016491e39347849b951525335c6eb4.1592600985.git.rdna@fb.com
</content>
</entry>
</feed>
