<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/tools/testing/selftests/bpf/prog_tests, branch linux-5.1.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.</subtitle>
<id>https://universe.0xinfinity.dev/distro/kernel/atom?h=linux-5.1.y</id>
<link rel='self' href='https://universe.0xinfinity.dev/distro/kernel/atom?h=linux-5.1.y'/>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/'/>
<updated>2019-04-03T14:49:48Z</updated>
<entry>
<title>selftests/bpf: fix vlan handling in flow dissector program</title>
<updated>2019-04-03T14:49:48Z</updated>
<author>
<name>Stanislav Fomichev</name>
<email>sdf@google.com</email>
</author>
<published>2019-04-01T20:57:30Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=2c3af7d901c61c101c02f431cfb520af9ff56ab4'/>
<id>urn:sha1:2c3af7d901c61c101c02f431cfb520af9ff56ab4</id>
<content type='text'>
When we tail call PROG(VLAN) from parse_eth_proto we don't need to peek
back to handle vlan proto because we didn't adjust nhoff/thoff yet. Use
flow_keys-&gt;n_proto, that we set in parse_eth_proto instead and
properly increment nhoff as well.

Also, always use skb-&gt;protocol and don't look at skb-&gt;vlan_present.
skb-&gt;vlan_present indicates that vlan information is stored out-of-band
in skb-&gt;vlan_{tci,proto} and vlan header is already pulled from skb.
That means, skb-&gt;vlan_present == true is not relevant for BPF flow
dissector.

Add simple test cases with VLAN tagged frames:
  * single vlan for ipv4
  * double vlan for ipv6

Signed-off-by: Stanislav Fomichev &lt;sdf@google.com&gt;
Signed-off-by: Daniel Borkmann &lt;daniel@iogearbox.net&gt;
</content>
</entry>
<entry>
<title>selftests/bpf: fix segfault of test_progs when prog loading failed</title>
<updated>2019-03-12T20:55:54Z</updated>
<author>
<name>Yonghong Song</name>
<email>yhs@fb.com</email>
</author>
<published>2019-03-12T05:21:09Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=d6f1837107c00fa7b2fdb606acf65b33b455dbfd'/>
<id>urn:sha1:d6f1837107c00fa7b2fdb606acf65b33b455dbfd</id>
<content type='text'>
The test_progs subtests, test_spin_lock() and test_map_lock(),
requires BTF present to run successfully.
Currently, when BTF failed to load, test_progs will segfault,
  $ ./test_progs
  ...
  12: (bf) r1 = r8
  13: (85) call bpf_spin_lock#93
  map 'hash_map' has to have BTF in order to use bpf_spin_lock

  libbpf: -- END LOG --
  libbpf: failed to load program 'map_lock_demo'
  libbpf: failed to load object './test_map_lock.o'
  test_map_lock:bpf_prog_load errno 13
  Segmentation fault

The segfault is caused by uninitialized variable "obj", which
is used in bpf_object__close(obj), when bpf prog failed to load.

Initializing variable "obj" to NULL in two occasions fixed the problem.
  $ ./test_progs
  ...
  Summary: 219 PASSED, 2 FAILED

Fixes: b4d4556c3266 ("selftests/bpf: add bpf_spin_lock verifier tests")
Fixes: ba72a7b4badb ("selftests/bpf: test for BPF_F_LOCK")
Reported-by: Daniel Borkmann &lt;daniel@iogearbox.net&gt;
Signed-off-by: Yonghong Song &lt;yhs@fb.com&gt;
Acked-by: Song Liu &lt;songliubraving@fb.com&gt;
Signed-off-by: Daniel Borkmann &lt;daniel@iogearbox.net&gt;
</content>
</entry>
<entry>
<title>selftests: bpf: test_progs: initialize duration in singal_pending test</title>
<updated>2019-03-07T09:46:25Z</updated>
<author>
<name>Stanislav Fomichev</name>
<email>sdf@google.com</email>
</author>
<published>2019-03-06T23:25:26Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=69b09175d68241cb96ff9433d8e7a17382d720d6'/>
<id>urn:sha1:69b09175d68241cb96ff9433d8e7a17382d720d6</id>
<content type='text'>
CHECK macro implicitly uses duration. We call CHECK() a couple of times
before duration is initialized from bpf_prog_test_run().
Explicitly set duration to 0 to avoid compiler warnings.

Fixes: 740f8a657221 ("selftests/bpf: make sure signal interrupts BPF_PROG_TEST_RUN")
Signed-off-by: Stanislav Fomichev &lt;sdf@google.com&gt;
Acked-by: Yonghong Song &lt;yhs@fb.com&gt;
Signed-off-by: Daniel Borkmann &lt;daniel@iogearbox.net&gt;
</content>
</entry>
<entry>
<title>selftests: bpf: break up test_progs - misc</title>
<updated>2019-03-02T19:10:40Z</updated>
<author>
<name>Stanislav Fomichev</name>
<email>sdf@google.com</email>
</author>
<published>2019-03-02T03:42:19Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=886225bb0868fcf763bea62d18e57e4b5ef08a42'/>
<id>urn:sha1:886225bb0868fcf763bea62d18e57e4b5ef08a42</id>
<content type='text'>
Move the rest of prog tests into separate files.

Signed-off-by: Stanislav Fomichev &lt;sdf@google.com&gt;
Signed-off-by: Alexei Starovoitov &lt;ast@kernel.org&gt;
</content>
</entry>
<entry>
<title>selftests: bpf: break up test_progs - spinlock</title>
<updated>2019-03-02T19:10:40Z</updated>
<author>
<name>Stanislav Fomichev</name>
<email>sdf@google.com</email>
</author>
<published>2019-03-02T03:42:18Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=271a6337cbaedfa9b93006326d0ecc28fd3dc71c'/>
<id>urn:sha1:271a6337cbaedfa9b93006326d0ecc28fd3dc71c</id>
<content type='text'>
Move spinlock prog tests into separate files.

Signed-off-by: Stanislav Fomichev &lt;sdf@google.com&gt;
Signed-off-by: Alexei Starovoitov &lt;ast@kernel.org&gt;
</content>
</entry>
<entry>
<title>selftests: bpf: break up test_progs - tracepoint</title>
<updated>2019-03-02T19:10:40Z</updated>
<author>
<name>Stanislav Fomichev</name>
<email>sdf@google.com</email>
</author>
<published>2019-03-02T03:42:17Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=20cb14ff9c49fcb189daf82246fb6fcd3923542c'/>
<id>urn:sha1:20cb14ff9c49fcb189daf82246fb6fcd3923542c</id>
<content type='text'>
Move tracepoint prog tests into separate files.

Signed-off-by: Stanislav Fomichev &lt;sdf@google.com&gt;
Signed-off-by: Alexei Starovoitov &lt;ast@kernel.org&gt;
</content>
</entry>
<entry>
<title>selftests: bpf: break up test_progs - stackmap</title>
<updated>2019-03-02T19:10:40Z</updated>
<author>
<name>Stanislav Fomichev</name>
<email>sdf@google.com</email>
</author>
<published>2019-03-02T03:42:16Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=615741d81de6c16aa466c4eb37805caa868a9bb8'/>
<id>urn:sha1:615741d81de6c16aa466c4eb37805caa868a9bb8</id>
<content type='text'>
Move stackmap prog tests into separate files.

Signed-off-by: Stanislav Fomichev &lt;sdf@google.com&gt;
Signed-off-by: Alexei Starovoitov &lt;ast@kernel.org&gt;
</content>
</entry>
<entry>
<title>selftests: bpf: break up test_progs - xdp</title>
<updated>2019-03-02T19:10:40Z</updated>
<author>
<name>Stanislav Fomichev</name>
<email>sdf@google.com</email>
</author>
<published>2019-03-02T03:42:15Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=eaf90740f5ad054b1962f32a50e5b7476c0f16bd'/>
<id>urn:sha1:eaf90740f5ad054b1962f32a50e5b7476c0f16bd</id>
<content type='text'>
Move xdp prog tests into separate files.

Signed-off-by: Stanislav Fomichev &lt;sdf@google.com&gt;
Signed-off-by: Alexei Starovoitov &lt;ast@kernel.org&gt;
</content>
</entry>
<entry>
<title>selftests: bpf: break up test_progs - pkt access</title>
<updated>2019-03-02T19:10:40Z</updated>
<author>
<name>Stanislav Fomichev</name>
<email>sdf@google.com</email>
</author>
<published>2019-03-02T03:42:14Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=7395724b404db76fc093fb99b5c957baa409d8ae'/>
<id>urn:sha1:7395724b404db76fc093fb99b5c957baa409d8ae</id>
<content type='text'>
Move pkt access prog tests into separate files.

Signed-off-by: Stanislav Fomichev &lt;sdf@google.com&gt;
Signed-off-by: Alexei Starovoitov &lt;ast@kernel.org&gt;
</content>
</entry>
<entry>
<title>selftests: bpf: break up test_progs - preparations</title>
<updated>2019-03-02T19:10:40Z</updated>
<author>
<name>Stanislav Fomichev</name>
<email>sdf@google.com</email>
</author>
<published>2019-03-02T03:42:13Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=3f30658830f3a133ba2136237ea9c8e589344a3b'/>
<id>urn:sha1:3f30658830f3a133ba2136237ea9c8e589344a3b</id>
<content type='text'>
Add new prog_tests directory where tests are supposed to land.
Each prog_tests/&lt;filename&gt;.c is expected to have a global function
with signature 'void test_&lt;filename&gt;(void)'. Makefile automatically
generates prog_tests/tests.h file with entry for each prog_tests file:

	#ifdef DECLARE
	extern void test_&lt;filename&gt;(void);
	...
	#endif

	#ifdef CALL
	test_&lt;filename&gt;();
	...
	#endif

prog_tests/tests.h is included in test_progs.c in two places with
appropriate defines. This scheme allows us to move each function with
a separate patch without breaking anything.

Compared to the recent verifier split, each separate file here is
a compilation unit and test_progs.[ch] is now used as a place to put
some common routines that might be used by multiple tests.

Signed-off-by: Stanislav Fomichev &lt;sdf@google.com&gt;
Signed-off-by: Alexei Starovoitov &lt;ast@kernel.org&gt;
</content>
</entry>
</feed>
