<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/tools/testing/selftests/bpf/prog_tests, branch linux-5.2.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.</subtitle>
<id>https://universe.0xinfinity.dev/distro/kernel/atom?h=linux-5.2.y</id>
<link rel='self' href='https://universe.0xinfinity.dev/distro/kernel/atom?h=linux-5.2.y'/>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/'/>
<updated>2019-05-29T13:23:40Z</updated>
<entry>
<title>selftests: bpf: fix compiler warning in flow_dissector test</title>
<updated>2019-05-29T13:23:40Z</updated>
<author>
<name>Alakesh Haloi</name>
<email>alakesh.haloi@gmail.com</email>
</author>
<published>2019-05-28T19:02:18Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=5fac1718e706d94a7078addee9075cfaea00ca8c'/>
<id>urn:sha1:5fac1718e706d94a7078addee9075cfaea00ca8c</id>
<content type='text'>
Add missing header file following compiler warning:

  prog_tests/flow_dissector.c: In function ‘tx_tap’:
  prog_tests/flow_dissector.c:175:9: warning: implicit declaration of function ‘writev’; did you mean ‘write’? [-Wimplicit-function-declaration]
    return writev(fd, iov, ARRAY_SIZE(iov));
           ^~~~~~
           write

Fixes: 0905beec9f52 ("selftests/bpf: run flow dissector tests in skb-less mode")
Signed-off-by: Alakesh Haloi &lt;alakesh.haloi@gmail.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: add prog detach to flow_dissector test</title>
<updated>2019-05-15T23:33:33Z</updated>
<author>
<name>Stanislav Fomichev</name>
<email>sdf@google.com</email>
</author>
<published>2019-05-14T21:12:34Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=3d21b6525caeae45f08e2d3a07ddfdef64882b8b'/>
<id>urn:sha1:3d21b6525caeae45f08e2d3a07ddfdef64882b8b</id>
<content type='text'>
In case we are not running in a namespace (which we don't do by default),
let's try to detach the bpf program that we use for eth_get_headlen tests.

Fixes: 0905beec9f52 ("selftests/bpf: run flow dissector tests in skb-less mode")
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: add missing \n to flow_dissector CHECK errors</title>
<updated>2019-05-15T23:33:33Z</updated>
<author>
<name>Stanislav Fomichev</name>
<email>sdf@google.com</email>
</author>
<published>2019-05-14T21:12:33Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=a9047734eb47bea615826d4b1733526b3a867dbb'/>
<id>urn:sha1:a9047734eb47bea615826d4b1733526b3a867dbb</id>
<content type='text'>
Otherwise, in case of an error, everything gets mushed together.

Fixes: a5cb33464e53 ("selftests/bpf: make flow dissector tests more extensible")
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: initialize bpf_object pointers where needed</title>
<updated>2019-05-09T22:53:56Z</updated>
<author>
<name>Lorenz Bauer</name>
<email>lmb@cloudflare.com</email>
</author>
<published>2019-05-08T16:49:32Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=07b619919d3d5401adc9bc6b79dcf12cc2c6d485'/>
<id>urn:sha1:07b619919d3d5401adc9bc6b79dcf12cc2c6d485</id>
<content type='text'>
There are a few tests which call bpf_object__close on uninitialized
bpf_object*, which may segfault. Explicitly zero-initialise these pointers
to avoid this.

Signed-off-by: Lorenz Bauer &lt;lmb@cloudflare.com&gt;
Acked-by: Martin KaFai Lau &lt;kafai@fb.com&gt;
Signed-off-by: Alexei Starovoitov &lt;ast@kernel.org&gt;
</content>
</entry>
<entry>
<title>selftests: bpf: test writable buffers in raw tps</title>
<updated>2019-04-27T02:04:19Z</updated>
<author>
<name>Matt Mullins</name>
<email>mmullins@fb.com</email>
</author>
<published>2019-04-26T18:49:51Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=e950e843367d7990b9d7ea964e3c33876d477c4b'/>
<id>urn:sha1:e950e843367d7990b9d7ea964e3c33876d477c4b</id>
<content type='text'>
This tests that:
  * a BPF_PROG_TYPE_RAW_TRACEPOINT_WRITABLE cannot be attached if it
    uses either:
    * a variable offset to the tracepoint buffer, or
    * an offset beyond the size of the tracepoint buffer
  * a tracer can modify the buffer provided when attached to a writable
    tracepoint in bpf_prog_test_run

Signed-off-by: Matt Mullins &lt;mmullins@fb.com&gt;
Acked-by: Yonghong Song &lt;yhs@fb.com&gt;
Signed-off-by: Alexei Starovoitov &lt;ast@kernel.org&gt;
</content>
</entry>
<entry>
<title>bpf/flow_dissector: don't adjust nhoff by ETH_HLEN in BPF_PROG_TEST_RUN</title>
<updated>2019-04-23T16:36:35Z</updated>
<author>
<name>Stanislav Fomichev</name>
<email>sdf@google.com</email>
</author>
<published>2019-04-22T15:55:52Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=02ee0658362d3713421851bb7487af77a4098bb5'/>
<id>urn:sha1:02ee0658362d3713421851bb7487af77a4098bb5</id>
<content type='text'>
Now that we use skb-less flow dissector let's return true nhoff and
thoff. We used to adjust them by ETH_HLEN because that's how it was
done in the skb case. For VLAN tests that looks confusing: nhoff is
pointing to vlan parts :-\

Warning, this is an API change for BPF_PROG_TEST_RUN! Feel free to drop
if you think that it's too late at this point to fix it.

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: run flow dissector tests in skb-less mode</title>
<updated>2019-04-23T16:36:34Z</updated>
<author>
<name>Stanislav Fomichev</name>
<email>sdf@google.com</email>
</author>
<published>2019-04-22T15:55:50Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=0905beec9f52caf2c7065a8a88c08bc370850710'/>
<id>urn:sha1:0905beec9f52caf2c7065a8a88c08bc370850710</id>
<content type='text'>
Export last_dissection map from flow dissector and use a known place in
tun driver to trigger BPF flow dissection.

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: add flow dissector bpf_skb_load_bytes helper test</title>
<updated>2019-04-23T16:36:34Z</updated>
<author>
<name>Stanislav Fomichev</name>
<email>sdf@google.com</email>
</author>
<published>2019-04-22T15:55:49Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=c9cb2c1e11cee75b3af5699add3302a3997f78e4'/>
<id>urn:sha1:c9cb2c1e11cee75b3af5699add3302a3997f78e4</id>
<content type='text'>
When flow dissector is called without skb, we want to make sure
bpf_skb_load_bytes invocations return error. Add small test which tries
to read single byte from a packet.

bpf_skb_load_bytes should always fail under BPF_PROG_TEST_RUN because
it was converted to the skb-less mode.

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 a compilation error</title>
<updated>2019-04-18T05:29:51Z</updated>
<author>
<name>Yonghong Song</name>
<email>yhs@fb.com</email>
</author>
<published>2019-04-18T05:23:30Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=ba02de1aa04e392e15ef503c6dd5166915d9d4de'/>
<id>urn:sha1:ba02de1aa04e392e15ef503c6dd5166915d9d4de</id>
<content type='text'>
I hit the following compilation error with gcc 4.8.5.

  prog_tests/flow_dissector.c: In function ‘test_flow_dissector’:
  prog_tests/flow_dissector.c:155:2: error: ‘for’ loop initial declarations are only allowed in C99 mode
    for (int i = 0; i &lt; ARRAY_SIZE(tests); i++) {
    ^
  prog_tests/flow_dissector.c:155:2: note: use option -std=c99 or -std=gnu99 to compile your code

Let us fix the issue by avoiding this particular c99 feature.

Fixes: a5cb33464e53 ("selftests/bpf: make flow dissector tests more extensible")
Signed-off-by: Yonghong Song &lt;yhs@fb.com&gt;
Signed-off-by: Alexei Starovoitov &lt;ast@kernel.org&gt;
</content>
</entry>
<entry>
<title>selftests/bpf: make flow dissector tests more extensible</title>
<updated>2019-04-16T08:21:12Z</updated>
<author>
<name>Stanislav Fomichev</name>
<email>sdf@google.com</email>
</author>
<published>2019-04-12T23:43:10Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=a5cb33464e53482ecc645b4b7703f5b6d151095f'/>
<id>urn:sha1:a5cb33464e53482ecc645b4b7703f5b6d151095f</id>
<content type='text'>
Rewrite selftest to iterate over an array with input packet and
expected flow_keys. This should make it easier to extend this test
with additional cases without too much boilerplate.

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