<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/tools/testing/selftests/bpf/network_helpers.h, branch linux-rolling-stable</title>
<subtitle>Hosts the 0x221E linux distro kernel.</subtitle>
<id>https://universe.0xinfinity.dev/distro/kernel/atom?h=linux-rolling-stable</id>
<link rel='self' href='https://universe.0xinfinity.dev/distro/kernel/atom?h=linux-rolling-stable'/>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/'/>
<updated>2025-10-29T18:07:24Z</updated>
<entry>
<title>selftests/bpf: Add tc helpers</title>
<updated>2025-10-29T18:07:24Z</updated>
<author>
<name>Alexis Lothoré (eBPF Foundation)</name>
<email>alexis.lothore@bootlin.com</email>
</author>
<published>2025-10-27T14:51:53Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=1d5137c8d1ace4b85c458b5efe524c83d2f2ef72'/>
<id>urn:sha1:1d5137c8d1ace4b85c458b5efe524c83d2f2ef72</id>
<content type='text'>
The test_tunnel.c file defines small fonctions to easily attach eBPF
programs to tc hooks, either on egress, ingress or both.

Create a shared helper in network_helpers.c so that other tests can
benefit from it.

Signed-off-by: Alexis Lothoré (eBPF Foundation) &lt;alexis.lothore@bootlin.com&gt;
Signed-off-by: Martin KaFai Lau &lt;martin.lau@kernel.org&gt;
Link: https://patch.msgid.link/20251027-tc_tunnel-v3-1-505c12019f9d@bootlin.com
</content>
</entry>
<entry>
<title>Merge tag 'bpf-next-6.15' of git://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next</title>
<updated>2025-03-30T19:43:03Z</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2025-03-30T19:43:03Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=fa593d0f969dcfa41d390822fdf1a0ab48cd882c'/>
<id>urn:sha1:fa593d0f969dcfa41d390822fdf1a0ab48cd882c</id>
<content type='text'>
Pull bpf updates from Alexei Starovoitov:
 "For this merge window we're splitting BPF pull request into three for
  higher visibility: main changes, res_spin_lock, try_alloc_pages.

  These are the main BPF changes:

   - Add DFA-based live registers analysis to improve verification of
     programs with loops (Eduard Zingerman)

   - Introduce load_acquire and store_release BPF instructions and add
     x86, arm64 JIT support (Peilin Ye)

   - Fix loop detection logic in the verifier (Eduard Zingerman)

   - Drop unnecesary lock in bpf_map_inc_not_zero() (Eric Dumazet)

   - Add kfunc for populating cpumask bits (Emil Tsalapatis)

   - Convert various shell based tests to selftests/bpf/test_progs
     format (Bastien Curutchet)

   - Allow passing referenced kptrs into struct_ops callbacks (Amery
     Hung)

   - Add a flag to LSM bpf hook to facilitate bpf program signing
     (Blaise Boscaccy)

   - Track arena arguments in kfuncs (Ihor Solodrai)

   - Add copy_remote_vm_str() helper for reading strings from remote VM
     and bpf_copy_from_user_task_str() kfunc (Jordan Rome)

   - Add support for timed may_goto instruction (Kumar Kartikeya
     Dwivedi)

   - Allow bpf_get_netns_cookie() int cgroup_skb programs (Mahe Tardy)

   - Reduce bpf_cgrp_storage_busy false positives when accessing cgroup
     local storage (Martin KaFai Lau)

   - Introduce bpf_dynptr_copy() kfunc (Mykyta Yatsenko)

   - Allow retrieving BTF data with BTF token (Mykyta Yatsenko)

   - Add BPF kfuncs to set and get xattrs with 'security.bpf.' prefix
     (Song Liu)

   - Reject attaching programs to noreturn functions (Yafang Shao)

   - Introduce pre-order traversal of cgroup bpf programs (Yonghong
     Song)"

* tag 'bpf-next-6.15' of git://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next: (186 commits)
  selftests/bpf: Add selftests for load-acquire/store-release when register number is invalid
  bpf: Fix out-of-bounds read in check_atomic_load/store()
  libbpf: Add namespace for errstr making it libbpf_errstr
  bpf: Add struct_ops context information to struct bpf_prog_aux
  selftests/bpf: Sanitize pointer prior fclose()
  selftests/bpf: Migrate test_xdp_vlan.sh into test_progs
  selftests/bpf: test_xdp_vlan: Rename BPF sections
  bpf: clarify a misleading verifier error message
  selftests/bpf: Add selftest for attaching fexit to __noreturn functions
  bpf: Reject attaching fexit/fmod_ret to __noreturn functions
  bpf: Only fails the busy counter check in bpf_cgrp_storage_get if it creates storage
  bpf: Make perf_event_read_output accessible in all program types.
  bpftool: Using the right format specifiers
  bpftool: Add -Wformat-signedness flag to detect format errors
  selftests/bpf: Test freplace from user namespace
  libbpf: Pass BPF token from find_prog_btf_id to BPF_BTF_GET_FD_BY_ID
  bpf: Return prog btf_id without capable check
  bpf: BPF token support for BPF_BTF_GET_FD_BY_ID
  bpf, x86: Fix objtool warning for timed may_goto
  bpf: Check map-&gt;record at the beginning of check_and_free_fields()
  ...
</content>
</entry>
<entry>
<title>selftests/bpf: Allow assigning traffic monitor print function</title>
<updated>2025-03-15T18:48:57Z</updated>
<author>
<name>Amery Hung</name>
<email>ameryhung@gmail.com</email>
</author>
<published>2025-03-05T18:20:56Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=34a25aabcdea5c6e42a283381f8354d70592744a'/>
<id>urn:sha1:34a25aabcdea5c6e42a283381f8354d70592744a</id>
<content type='text'>
Allow users to change traffic monitor's print function. If not provided,
traffic monitor will print to stdout by default.

Signed-off-by: Amery Hung &lt;ameryhung@gmail.com&gt;
Signed-off-by: Martin KaFai Lau &lt;martin.lau@kernel.org&gt;
Link: https://patch.msgid.link/20250305182057.2802606-2-ameryhung@gmail.com
Signed-off-by: Alexei Starovoitov &lt;ast@kernel.org&gt;
</content>
</entry>
<entry>
<title>selftests/bpf: Move open_tuntap to network helpers</title>
<updated>2025-03-06T20:31:08Z</updated>
<author>
<name>Marcus Wichelmann</name>
<email>marcus.wichelmann@hetzner-cloud.de</email>
</author>
<published>2025-03-05T21:34:35Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=d5ca409c86d35ebe60fad08ed554797abd8e53c0'/>
<id>urn:sha1:d5ca409c86d35ebe60fad08ed554797abd8e53c0</id>
<content type='text'>
To test the XDP metadata functionality of the tun driver, it's necessary
to create a new tap device first. A helper function for this already
exists in lwt_helpers.h. Move it to the common network helpers header,
so it can be reused in other tests.

Signed-off-by: Marcus Wichelmann &lt;marcus.wichelmann@hetzner-cloud.de&gt;
Signed-off-by: Martin KaFai Lau &lt;martin.lau@kernel.org&gt;
Link: https://patch.msgid.link/20250305213438.3863922-4-marcus.wichelmann@hetzner-cloud.de
</content>
</entry>
<entry>
<title>selftests/bpf: helpers: Add append_tid()</title>
<updated>2025-02-03T11:33:51Z</updated>
<author>
<name>Bastien Curutchet (eBPF Foundation)</name>
<email>bastien.curutchet@bootlin.com</email>
</author>
<published>2025-01-31T07:21:40Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=723f1b9ce332ae50dede24daa7a1abc0c87a6f83'/>
<id>urn:sha1:723f1b9ce332ae50dede24daa7a1abc0c87a6f83</id>
<content type='text'>
Some tests can't be run in parallel because they use same namespace
names or veth names.

Create an helper that appends the thread ID to a given string. 8
characters are used for it (7 digits + '\0')

Signed-off-by: Bastien Curutchet (eBPF Foundation) &lt;bastien.curutchet@bootlin.com&gt;
Signed-off-by: Martin KaFai Lau &lt;martin.lau@kernel.org&gt;
Link: https://patch.msgid.link/20250131-redirect-multi-v4-1-970b33678512@bootlin.com
Signed-off-by: Alexei Starovoitov &lt;ast@kernel.org&gt;
</content>
</entry>
<entry>
<title>selftests/bpf: add network helpers to generate udp checksums</title>
<updated>2024-12-02T16:41:17Z</updated>
<author>
<name>Alexis Lothoré (eBPF Foundation)</name>
<email>alexis.lothore@bootlin.com</email>
</author>
<published>2024-11-20T07:43:22Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=bcc00987bc56faa3d0e20762ececefc831506846'/>
<id>urn:sha1:bcc00987bc56faa3d0e20762ececefc831506846</id>
<content type='text'>
network_helpers.c provides some helpers to generate ip checksums or ip
pseudo-header checksums, but not for upper layers (eg: udp checksums)

Add helpers for udp checksum to allow manually building udp packets.

Signed-off-by: Alexis Lothoré (eBPF Foundation) &lt;alexis.lothore@bootlin.com&gt;
Acked-by: Stanislav Fomichev &lt;sdf@fomichev.me&gt;
Link: https://lore.kernel.org/r/20241120-flow_dissector-v3-12-45b46494f937@bootlin.com
Signed-off-by: Alexei Starovoitov &lt;ast@kernel.org&gt;
</content>
</entry>
<entry>
<title>selftests/bpf: document pseudo-header checksum helpers</title>
<updated>2024-12-02T16:41:16Z</updated>
<author>
<name>Alexis Lothoré (eBPF Foundation)</name>
<email>alexis.lothore@bootlin.com</email>
</author>
<published>2024-11-20T07:43:20Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=752fddc0501c540214875b26bde2538f0a831811'/>
<id>urn:sha1:752fddc0501c540214875b26bde2538f0a831811</id>
<content type='text'>
network_helpers.h provides helpers to compute checksum for pseudo
headers but no helpers to compute the global checksums.

Before adding those, clarify csum_tcpudp_magic and csum_ipv6_magic
purpose by adding some documentation.

Signed-off-by: Alexis Lothoré (eBPF Foundation) &lt;alexis.lothore@bootlin.com&gt;
Acked-by: Stanislav Fomichev &lt;sdf@fomichev.me&gt;
Link: https://lore.kernel.org/r/20241120-flow_dissector-v3-10-45b46494f937@bootlin.com
Signed-off-by: Alexei Starovoitov &lt;ast@kernel.org&gt;
</content>
</entry>
<entry>
<title>selftests/bpf: move ip checksum helper to network helpers</title>
<updated>2024-12-02T16:41:16Z</updated>
<author>
<name>Alexis Lothoré (eBPF Foundation)</name>
<email>alexis.lothore@bootlin.com</email>
</author>
<published>2024-11-20T07:43:19Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=f4504af68575c1675235bacd8d36157cfc27ae5e'/>
<id>urn:sha1:f4504af68575c1675235bacd8d36157cfc27ae5e</id>
<content type='text'>
xdp_metadata test has a small helper computing ipv4 checksums to allow
manually building packets.

Move this helper to network_helpers to share it with other tests.

Signed-off-by: Alexis Lothoré (eBPF Foundation) &lt;alexis.lothore@bootlin.com&gt;
Acked-by: Stanislav Fomichev &lt;sdf@fomichev.me&gt;
Link: https://lore.kernel.org/r/20241120-flow_dissector-v3-9-45b46494f937@bootlin.com
Signed-off-by: Alexei Starovoitov &lt;ast@kernel.org&gt;
</content>
</entry>
<entry>
<title>selftests/bpf: add missing header include for htons</title>
<updated>2024-10-08T17:40:33Z</updated>
<author>
<name>Alexis Lothoré (eBPF Foundation)</name>
<email>alexis.lothore@bootlin.com</email>
</author>
<published>2024-10-08T14:50:57Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=bc9b3fb827fceec4e05564d6e668280f4470ab5b'/>
<id>urn:sha1:bc9b3fb827fceec4e05564d6e668280f4470ab5b</id>
<content type='text'>
Including the network_helpers.h header in tests can lead to the following
build error:

./network_helpers.h: In function ‘csum_tcpudp_magic’:
./network_helpers.h:116:14: error: implicit declaration of function \
  ‘htons’ [-Werror=implicit-function-declaration]
  116 |         s += htons(proto + len);

The error is avoided in many cases thanks to some other headers included
earlier and bringing in arpa/inet.h (ie: test_progs.h).

Make sure that test_progs build success does not depend on header ordering
by adding the missing header include in network_helpers.h

Fixes: f6642de0c3e9 ("selftests/bpf: Add csum helpers")
Signed-off-by: Alexis Lothoré (eBPF Foundation) &lt;alexis.lothore@bootlin.com&gt;
Link: https://lore.kernel.org/r/20241008-network_helpers_fix-v1-1-2c2ae03df7ef@bootlin.com
Signed-off-by: Martin KaFai Lau &lt;martin.lau@kernel.org&gt;
</content>
</entry>
<entry>
<title>selftests/bpf: netns_new() and netns_free() helpers.</title>
<updated>2024-08-15T19:26:40Z</updated>
<author>
<name>Kui-Feng Lee</name>
<email>thinker.li@gmail.com</email>
</author>
<published>2024-08-15T05:32:51Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=1e115a58be0ffca63727dc0495dae924a19f8cd4'/>
<id>urn:sha1:1e115a58be0ffca63727dc0495dae924a19f8cd4</id>
<content type='text'>
netns_new()/netns_free() create/delete network namespaces. They support the
option '-m' of test_progs to start/stop traffic monitor for the network
namespace being created for matched tests.

Acked-by: Stanislav Fomichev &lt;sdf@fomichev.me&gt;
Signed-off-by: Kui-Feng Lee &lt;thinker.li@gmail.com&gt;
Link: https://lore.kernel.org/r/20240815053254.470944-4-thinker.li@gmail.com
Signed-off-by: Martin KaFai Lau &lt;martin.lau@kernel.org&gt;
</content>
</entry>
</feed>
