<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/tools/testing/selftests/bpf/progs/test_skb_ctx.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>2021-11-07T16:34:23Z</updated>
<entry>
<title>selftests/bpf: Fix non-strict SEC() program sections</title>
<updated>2021-11-07T16:34:23Z</updated>
<author>
<name>Andrii Nakryiko</name>
<email>andrii@kernel.org</email>
</author>
<published>2021-11-03T22:08:41Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=3d1d62397f4a12dedee09727b26cd5a4b254ebb7'/>
<id>urn:sha1:3d1d62397f4a12dedee09727b26cd5a4b254ebb7</id>
<content type='text'>
Fix few more SEC() definitions that were previously missed.

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-9-andrii@kernel.org
</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: Test new __sk_buff field hwtstamp</title>
<updated>2021-09-10T21:20:13Z</updated>
<author>
<name>Vadim Fedorenko</name>
<email>vfedorenko@novek.ru</email>
</author>
<published>2021-09-09T22:04:09Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=3384c7c7641b44987e35eadbc9df6c16a0520159'/>
<id>urn:sha1:3384c7c7641b44987e35eadbc9df6c16a0520159</id>
<content type='text'>
Analogous to the gso_segs selftests introduced in commit d9ff286a0f59
("bpf: allow BPF programs access skb_shared_info-&gt;gso_segs field").

Signed-off-by: Vadim Fedorenko &lt;vfedorenko@novek.ru&gt;
Signed-off-by: Daniel Borkmann &lt;daniel@iogearbox.net&gt;
Acked-by: Martin KaFai Lau &lt;kafai@fb.com&gt;
Link: https://lore.kernel.org/bpf/20210909220409.8804-3-vfedorenko@novek.ru
</content>
</entry>
<entry>
<title>bpf: Permit ingress_ifindex in bpf_prog_test_run_xattr</title>
<updated>2021-09-07T23:55:32Z</updated>
<author>
<name>Neil Spring</name>
<email>ntspring@fb.com</email>
</author>
<published>2021-08-31T03:33:56Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=b238290b965f23ac5f8aeb64cd731aef18aa796c'/>
<id>urn:sha1:b238290b965f23ac5f8aeb64cd731aef18aa796c</id>
<content type='text'>
bpf_prog_test_run_xattr takes a struct __sk_buff, but did not permit
that __skbuff to include an nonzero ingress_ifindex.

This patch updates to allow ingress_ifindex, convert the __sk_buff field to
sk_buff (skb_iif) and back, and tests that the value is present from on BPF
program side. The test sets an unlikely distinct value for ingress_ifindex
(11) from ifindex (1), which is in line with the rest of the synthetic field
tests.

Adding this support allows testing BPF that operates differently on
incoming and outgoing skbs by discriminating on this field.

Signed-off-by: Neil Spring &lt;ntspring@fb.com&gt;
Signed-off-by: Andrii Nakryiko &lt;andrii@kernel.org&gt;
Acked-by: John Fastabend &lt;john.fastabend@gmail.com&gt;
Link: https://lore.kernel.org/bpf/20210831033356.1459316-1-ntspring@fb.com
</content>
</entry>
<entry>
<title>selftests/bpf: Test new __sk_buff field gso_size</title>
<updated>2020-03-04T00:23:59Z</updated>
<author>
<name>Willem de Bruijn</name>
<email>willemb@google.com</email>
</author>
<published>2020-03-03T20:05:03Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=62511ceadf6e217f09d4ab1f9198d2bb5cc70e7c'/>
<id>urn:sha1:62511ceadf6e217f09d4ab1f9198d2bb5cc70e7c</id>
<content type='text'>
Analogous to the gso_segs selftests introduced in commit d9ff286a0f59
("bpf: allow BPF programs access skb_shared_info-&gt;gso_segs field").

Signed-off-by: Willem de Bruijn &lt;willemb@google.com&gt;
Signed-off-by: Alexei Starovoitov &lt;ast@kernel.org&gt;
Link: https://lore.kernel.org/bpf/20200303200503.226217-4-willemdebruijn.kernel@gmail.com
</content>
</entry>
<entry>
<title>selftests: Use consistent include paths for libbpf</title>
<updated>2020-01-21T00:37:45Z</updated>
<author>
<name>Toke Høiland-Jørgensen</name>
<email>toke@redhat.com</email>
</author>
<published>2020-01-20T13:06:45Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=3e689141e64df91b009a289c0559adedfe62f511'/>
<id>urn:sha1:3e689141e64df91b009a289c0559adedfe62f511</id>
<content type='text'>
Fix all selftests to include libbpf header files with the bpf/ prefix, to
be consistent with external users of the library. Also ensure that all
includes of exported libbpf header files (those that are exported on 'make
install' of the library) use bracketed includes instead of quoted.

To not break the build, keep the old include path until everything has been
changed to the new one; a subsequent patch will remove that.

Fixes: 6910d7d3867a ("selftests/bpf: Ensure bpf_helper_defs.h are taken from selftests dir")
Signed-off-by: Toke Høiland-Jørgensen &lt;toke@redhat.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/157952560568.1683545.9649335788846513446.stgit@toke.dk
</content>
</entry>
<entry>
<title>bpf: Allow to change skb mark in test_run</title>
<updated>2019-12-19T01:05:58Z</updated>
<author>
<name>Nikita V. Shirokov</name>
<email>tehnerd@tehnerd.com</email>
</author>
<published>2019-12-18T20:57:47Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=6de6c1f840c051017f2308503858ff19344c56b3'/>
<id>urn:sha1:6de6c1f840c051017f2308503858ff19344c56b3</id>
<content type='text'>
allow to pass skb's mark field into bpf_prog_test_run ctx
for BPF_PROG_TYPE_SCHED_CLS prog type. that would allow
to test bpf programs which are doing decision based on this
field

Signed-off-by: Nikita V. Shirokov &lt;tehnerd@tehnerd.com&gt;
Signed-off-by: Alexei Starovoitov &lt;ast@kernel.org&gt;
</content>
</entry>
<entry>
<title>selftests/bpf: Test wire_len/gso_segs in BPF_PROG_TEST_RUN</title>
<updated>2019-12-13T23:26:53Z</updated>
<author>
<name>Stanislav Fomichev</name>
<email>sdf@google.com</email>
</author>
<published>2019-12-13T22:30:28Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=a06bf42f5a95ff462401d59d0c08cf4620213647'/>
<id>urn:sha1:a06bf42f5a95ff462401d59d0c08cf4620213647</id>
<content type='text'>
Make sure we can pass arbitrary data in wire_len/gso_segs.

Signed-off-by: Stanislav Fomichev &lt;sdf@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/20191213223028.161282-2-sdf@google.com
</content>
</entry>
<entry>
<title>selftests: bpf: Add selftest for __sk_buff tstamp</title>
<updated>2019-10-15T23:24:26Z</updated>
<author>
<name>Stanislav Fomichev</name>
<email>sdf@google.com</email>
</author>
<published>2019-10-15T18:31:25Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=95fbda1e37384b9c270218b52718c83ddf4bb34e'/>
<id>urn:sha1:95fbda1e37384b9c270218b52718c83ddf4bb34e</id>
<content type='text'>
Make sure BPF_PROG_TEST_RUN accepts tstamp and exports any
modifications that BPF program does.

Signed-off-by: Stanislav Fomichev &lt;sdf@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/20191015183125.124413-2-sdf@google.com
</content>
</entry>
<entry>
<title>selftests: bpf: add selftest for __sk_buff context in BPF_PROG_TEST_RUN</title>
<updated>2019-04-11T08:21:41Z</updated>
<author>
<name>Stanislav Fomichev</name>
<email>sdf@google.com</email>
</author>
<published>2019-04-09T18:49:11Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=3daf8e703ec3dcf73a27a7dcabbac152793eb114'/>
<id>urn:sha1:3daf8e703ec3dcf73a27a7dcabbac152793eb114</id>
<content type='text'>
Simple test that sets cb to {1,2,3,4,5} and priority to 6, runs bpf
program that fails if cb is not what we expect and increments cb[i] and
priority. When the test finishes, we check that cb is now {2,3,4,5,6}
and priority is 7.

We also test the sanity checks:
* ctx_in is provided, but ctx_size_in is zero (same for
  ctx_out/ctx_size_out)
* unexpected non-zero fields in __sk_buff return EINVAL

Signed-off-by: Stanislav Fomichev &lt;sdf@google.com&gt;
Acked-by: Martin KaFai Lau &lt;kafai@fb.com&gt;
Signed-off-by: Daniel Borkmann &lt;daniel@iogearbox.net&gt;
</content>
</entry>
</feed>
