<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/tools/testing/selftests/bpf/progs/test_tunnel_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-09-02T13:21:03Z</updated>
<entry>
<title>selftests/bpf: Amend test_tunnel to exercise BPF_F_TUNINFO_FLAGS</title>
<updated>2022-09-02T13:21:03Z</updated>
<author>
<name>Shmulik Ladkani</name>
<email>shmulik@metanetworks.com</email>
</author>
<published>2022-08-31T14:40:10Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=8cc61b7a6416541261d56bcdd93a711407f711ba'/>
<id>urn:sha1:8cc61b7a6416541261d56bcdd93a711407f711ba</id>
<content type='text'>
Get the tunnel flags in {ipv6}vxlan_get_tunnel_src and ensure they are
aligned with tunnel params set at {ipv6}vxlan_set_tunnel_dst.

Signed-off-by: Shmulik Ladkani &lt;shmulik.ladkani@gmail.com&gt;
Signed-off-by: Daniel Borkmann &lt;daniel@iogearbox.net&gt;
Link: https://lore.kernel.org/bpf/20220831144010.174110-2-shmulik.ladkani@gmail.com
</content>
</entry>
<entry>
<title>selftests/bpf: Don't assign outer source IP to host</title>
<updated>2022-07-26T10:43:48Z</updated>
<author>
<name>Paul Chaignon</name>
<email>paul@isovalent.com</email>
</author>
<published>2022-07-25T14:32:53Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=1115169f47ae45eeb04c616c404492bc8268daa0'/>
<id>urn:sha1:1115169f47ae45eeb04c616c404492bc8268daa0</id>
<content type='text'>
The previous commit fixed a bug in the bpf_skb_set_tunnel_key helper to
avoid dropping packets whose outer source IP address isn't assigned to a
host interface. This commit changes the corresponding selftest to not
assign the outer source IP address to an interface.

Not assigning the source IP to an interface causes two issues in the
existing test:

1. The ARP requests will fail for that IP address so we need to add the
   ARP entry manually.
2. The encapsulated ICMP echo reply traffic will not reach the VXLAN
   device. It will be dropped by the stack before, because the
   outer destination IP is unknown.

To solve 2., we have two choices. Either we perform decapsulation
ourselves in a BPF program attached at veth1 (the base device for the
VXLAN device), or we switch the outer destination address when we
receive the packet at veth1, such that the stack properly demultiplexes
it to the VXLAN device afterward.

This commit implements the second approach, where we switch the outer
destination address from the unassigned IP address to the assigned one,
only for VXLAN traffic ingressing veth1.

Then, at the vxlan device, the BPF program that checks the output of
bpf_skb_get_tunnel_key needs to be updated as the expected local IP
address is now the unassigned one.

Signed-off-by: Paul Chaignon &lt;paul@isovalent.com&gt;
Signed-off-by: Daniel Borkmann &lt;daniel@iogearbox.net&gt;
Link: https://lore.kernel.org/bpf/4addde76eaf3477a58975bef15ed2788c44e5f55.1658759380.git.paul@isovalent.com
</content>
</entry>
<entry>
<title>selftests/bpf: Replace bpf_trace_printk in tunnel kernel code</title>
<updated>2022-05-10T17:49:03Z</updated>
<author>
<name>Kaixi Fan</name>
<email>fankaixi.li@bytedance.com</email>
</author>
<published>2022-04-30T07:48:44Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=71b2ec21c3313e4cea38d5a6b009e99df30e540a'/>
<id>urn:sha1:71b2ec21c3313e4cea38d5a6b009e99df30e540a</id>
<content type='text'>
Replace bpf_trace_printk with bpf_printk in test_tunnel_kern.c.
function bpf_printk is more easier and useful than bpf_trace_printk.

Signed-off-by: Kaixi Fan &lt;fankaixi.li@bytedance.com&gt;
Link: https://lore.kernel.org/r/20220430074844.69214-4-fankaixi.li@bytedance.com
Signed-off-by: Alexei Starovoitov &lt;ast@kernel.org&gt;
</content>
</entry>
<entry>
<title>selftests/bpf: Move vxlan tunnel testcases to test_progs</title>
<updated>2022-05-10T17:49:03Z</updated>
<author>
<name>Kaixi Fan</name>
<email>fankaixi.li@bytedance.com</email>
</author>
<published>2022-04-30T07:48:43Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=1ee7efd40abf3ab01e67ff4be15d4385d5fa52c1'/>
<id>urn:sha1:1ee7efd40abf3ab01e67ff4be15d4385d5fa52c1</id>
<content type='text'>
Move vxlan tunnel testcases from test_tunnel.sh to test_progs.
And add vxlan tunnel source testcases also. Other tunnel testcases
will be moved to test_progs step by step in the future.
Rename bpf program section name as SEC("tc") because test_progs
bpf loader could not load sections with name SEC("gre_set_tunnel").
Because of this, add bpftool to load bpf programs in test_tunnel.sh.

Signed-off-by: Kaixi Fan &lt;fankaixi.li@bytedance.com&gt;
Link: https://lore.kernel.org/r/20220430074844.69214-3-fankaixi.li@bytedance.com
Signed-off-by: Alexei Starovoitov &lt;ast@kernel.org&gt;
</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>tools/testing: Remove unused variable</title>
<updated>2021-04-15T00:28:58Z</updated>
<author>
<name>zuoqilin</name>
<email>zuoqilin@yulong.com</email>
</author>
<published>2021-04-14T14:16:39Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=069904ce318e0e15dc67f3c2829303237c5e912b'/>
<id>urn:sha1:069904ce318e0e15dc67f3c2829303237c5e912b</id>
<content type='text'>
Remove unused variable "ret2".

Signed-off-by: zuoqilin &lt;zuoqilin@yulong.com&gt;
Signed-off-by: Andrii Nakryiko &lt;andrii@kernel.org&gt;
Link: https://lore.kernel.org/bpf/20210414141639.1446-1-zuoqilin1@163.com
</content>
</entry>
<entry>
<title>selftests/bpf: Set gopt opt_class to 0 if get tunnel opt failed</title>
<updated>2021-03-15T16:28:58Z</updated>
<author>
<name>Hangbin Liu</name>
<email>liuhangbin@gmail.com</email>
</author>
<published>2021-03-09T03:22:14Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=31254dc9566221429d2cfb45fd5737985d70f2b6'/>
<id>urn:sha1:31254dc9566221429d2cfb45fd5737985d70f2b6</id>
<content type='text'>
When fixing the bpf test_tunnel.sh geneve failure. I only fixed the IPv4
part but forgot the IPv6 issue. Similar with the IPv4 fixes 557c223b643a
("selftests/bpf: No need to drop the packet when there is no geneve opt"),
when there is no tunnel option and bpf_skb_get_tunnel_opt() returns error,
there is no need to drop the packets and break all geneve rx traffic.
Just set opt_class to 0 and keep returning TC_ACT_OK at the end.

Fixes: 557c223b643a ("selftests/bpf: No need to drop the packet when there is no geneve opt")
Fixes: 933a741e3b82 ("selftests/bpf: bpf tunnel test.")
Signed-off-by: Hangbin Liu &lt;liuhangbin@gmail.com&gt;
Signed-off-by: Daniel Borkmann &lt;daniel@iogearbox.net&gt;
Acked-by: William Tu &lt;u9012063@gmail.com&gt;
Link: https://lore.kernel.org/bpf/20210309032214.2112438-1-liuhangbin@gmail.com
</content>
</entry>
<entry>
<title>selftests/bpf: No need to drop the packet when there is no geneve opt</title>
<updated>2021-02-24T20:28:30Z</updated>
<author>
<name>Hangbin Liu</name>
<email>liuhangbin@gmail.com</email>
</author>
<published>2021-02-24T08:14:03Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=557c223b643a35effec9654958d8edc62fd2603a'/>
<id>urn:sha1:557c223b643a35effec9654958d8edc62fd2603a</id>
<content type='text'>
In bpf geneve tunnel test we set geneve option on tx side. On rx side we
only call bpf_skb_get_tunnel_opt(). Since commit 9c2e14b48119 ("ip_tunnels:
Set tunnel option flag when tunnel metadata is present") geneve_rx() will
not add TUNNEL_GENEVE_OPT flag if there is no geneve option, which cause
bpf_skb_get_tunnel_opt() return ENOENT and _geneve_get_tunnel() in
test_tunnel_kern.c drop the packet.

As it should be valid that bpf_skb_get_tunnel_opt() return error when
there is not tunnel option, there is no need to drop the packet and
break all geneve rx traffic. Just set opt_class to 0 in this test and
keep returning TC_ACT_OK.

Fixes: 933a741e3b82 ("selftests/bpf: bpf tunnel test.")
Signed-off-by: Hangbin Liu &lt;liuhangbin@gmail.com&gt;
Signed-off-by: Daniel Borkmann &lt;daniel@iogearbox.net&gt;
Acked-by: William Tu &lt;u9012063@gmail.com&gt;
Link: https://lore.kernel.org/bpf/20210224081403.1425474-1-liuhangbin@gmail.com
</content>
</entry>
<entry>
<title>selftest/bpf: Add missed ip6ip6 test back</title>
<updated>2020-11-10T23:37:45Z</updated>
<author>
<name>Hangbin Liu</name>
<email>liuhangbin@gmail.com</email>
</author>
<published>2020-11-10T01:50:12Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=58cfa49c2ba7f815adccc27a775e7cf8a8f7f539'/>
<id>urn:sha1:58cfa49c2ba7f815adccc27a775e7cf8a8f7f539</id>
<content type='text'>
In comment 173ca26e9b51 ("samples/bpf: add comprehensive ipip, ipip6,
ip6ip6 test") we added ip6ip6 test for bpf tunnel testing. But in commit
933a741e3b82 ("selftests/bpf: bpf tunnel test.") when we moved it to
the current folder, we didn't add it.

This patch add the ip6ip6 test back to bpf tunnel test. Update the ipip6's
topology for both IPv4 and IPv6 testing. Since iperf test is removed as
currect framework simplified it in purpose, I also removed unused tcp
checkings in test_tunnel_kern.c.

Fixes: 933a741e3b82 ("selftests/bpf: bpf tunnel test.")
Signed-off-by: Hangbin Liu &lt;liuhangbin@gmail.com&gt;
Signed-off-by: Alexei Starovoitov &lt;ast@kernel.org&gt;
Link: https://lore.kernel.org/bpf/20201110015013.1570716-2-liuhangbin@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>
</feed>
