<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/tools/lib/bpf, branch v5.8</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/
</subtitle>
<id>https://git.shady.money/linux/atom?h=v5.8</id>
<link rel='self' href='https://git.shady.money/linux/atom?h=v5.8'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/'/>
<updated>2020-07-10T02:38:55Z</updated>
<entry>
<title>libbpf: Fix libbpf hashmap on (I)LP32 architectures</title>
<updated>2020-07-10T02:38:55Z</updated>
<author>
<name>Jakub Bogusz</name>
<email>qboosh@pld-linux.org</email>
</author>
<published>2020-07-09T22:57:23Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=b2f9f1535bb93ee5fa2ea30ac1c26fa0d676154c'/>
<id>urn:sha1:b2f9f1535bb93ee5fa2ea30ac1c26fa0d676154c</id>
<content type='text'>
On ILP32, 64-bit result was shifted by value calculated for 32-bit long type
and returned value was much outside hashmap capacity.
As advised by Andrii Nakryiko, this patch uses different hashing variant for
architectures with size_t shorter than long long.

Fixes: e3b924224028 ("libbpf: add resizable non-thread safe internal hashmap")
Signed-off-by: Jakub Bogusz &lt;qboosh@pld-linux.org&gt;
Signed-off-by: Andrii Nakryiko &lt;andriin@fb.com&gt;
Signed-off-by: Alexei Starovoitov &lt;ast@kernel.org&gt;
Link: https://lore.kernel.org/bpf/20200709225723.1069937-1-andriin@fb.com
</content>
</entry>
<entry>
<title>libbpf: Adjust SEC short cut for expected attach type BPF_XDP_DEVMAP</title>
<updated>2020-06-25T20:36:00Z</updated>
<author>
<name>Jesper Dangaard Brouer</name>
<email>brouer@redhat.com</email>
</author>
<published>2020-06-25T14:26:58Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=7a64135f3229a808067e4bd29be15fe6856a9ae6'/>
<id>urn:sha1:7a64135f3229a808067e4bd29be15fe6856a9ae6</id>
<content type='text'>
Adjust the SEC("xdp_devmap/") prog type prefix to contain a
slash "/" for expected attach type BPF_XDP_DEVMAP.  This is consistent
with other prog types like tracing.

Fixes: 2778797037a6 ("libbpf: Add SEC name for xdp programs attached to device map")
Suggested-by: Andrii Nakryiko &lt;andriin@fb.com&gt;
Signed-off-by: Jesper Dangaard Brouer &lt;brouer@redhat.com&gt;
Signed-off-by: Daniel Borkmann &lt;daniel@iogearbox.net&gt;
Acked-by: Andrii Nakryiko &lt;andriin@fb.com&gt;
Link: https://lore.kernel.org/bpf/159309521882.821855.6873145686353617509.stgit@firesoul
</content>
</entry>
<entry>
<title>libbpf: Fix CO-RE relocs against .text section</title>
<updated>2020-06-24T00:01:43Z</updated>
<author>
<name>Andrii Nakryiko</name>
<email>andriin@fb.com</email>
</author>
<published>2020-06-19T23:04:22Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=9c82a63cf3701b78cd092c69c3e75ff806837194'/>
<id>urn:sha1:9c82a63cf3701b78cd092c69c3e75ff806837194</id>
<content type='text'>
bpf_object__find_program_by_title(), used by CO-RE relocation code, doesn't
return .text "BPF program", if it is a function storage for sub-programs.
Because of that, any CO-RE relocation in helper non-inlined functions will
fail. Fix this by searching for .text-corresponding BPF program manually.

Adjust one of bpf_iter selftest to exhibit this pattern.

Fixes: ddc7c3042614 ("libbpf: implement BPF CO-RE offset relocation algorithm")
Reported-by: Yonghong Song &lt;yhs@fb.com&gt;
Signed-off-by: Andrii Nakryiko &lt;andriin@fb.com&gt;
Signed-off-by: Yonghong Song &lt;yhs@fb.com&gt;
Signed-off-by: Alexei Starovoitov &lt;ast@kernel.org&gt;
Acked-by: Yonghong Song &lt;yhs@fb.com&gt;
Link: https://lore.kernel.org/bpf/20200619230423.691274-1-andriin@fb.com
</content>
</entry>
<entry>
<title>libbpf: Forward-declare bpf_stats_type for systems with outdated UAPI headers</title>
<updated>2020-06-22T21:23:49Z</updated>
<author>
<name>Andrii Nakryiko</name>
<email>andriin@fb.com</email>
</author>
<published>2020-06-21T03:11:59Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=4e15507fea70c0c312d79610efa46b6853ccf8e0'/>
<id>urn:sha1:4e15507fea70c0c312d79610efa46b6853ccf8e0</id>
<content type='text'>
Systems that doesn't yet have the very latest linux/bpf.h header, enum
bpf_stats_type will be undefined, causing compilation warnings. Prevents this
by forward-declaring enum.

Fixes: 0bee106716cf ("libbpf: Add support for command BPF_ENABLE_STATS")
Signed-off-by: Andrii Nakryiko &lt;andriin@fb.com&gt;
Signed-off-by: Daniel Borkmann &lt;daniel@iogearbox.net&gt;
Acked-by: Song Liu &lt;songliubraving@fb.com&gt;
Link: https://lore.kernel.org/bpf/20200621031159.2279101-1-andriin@fb.com
</content>
</entry>
<entry>
<title>libbpf: Support pre-initializing .bss global variables</title>
<updated>2020-06-12T22:27:47Z</updated>
<author>
<name>Andrii Nakryiko</name>
<email>andriin@fb.com</email>
</author>
<published>2020-06-12T19:45:04Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=caf62492f479585296e9d636c798d5ac256b7b04'/>
<id>urn:sha1:caf62492f479585296e9d636c798d5ac256b7b04</id>
<content type='text'>
Remove invalid assumption in libbpf that .bss map doesn't have to be updated
in kernel. With addition of skeleton and memory-mapped initialization image,
.bss doesn't have to be all zeroes when BPF map is created, because user-code
might have initialized those variables from user-space.

Fixes: eba9c5f498a1 ("libbpf: Refactor global data map initialization")
Signed-off-by: Andrii Nakryiko &lt;andriin@fb.com&gt;
Signed-off-by: Alexei Starovoitov &lt;ast@kernel.org&gt;
Link: https://lore.kernel.org/bpf/20200612194504.557844-1-andriin@fb.com
</content>
</entry>
<entry>
<title>libbpf: Handle GCC noreturn-turned-volatile quirk</title>
<updated>2020-06-10T11:37:02Z</updated>
<author>
<name>Andrii Nakryiko</name>
<email>andriin@fb.com</email>
</author>
<published>2020-06-10T05:23:35Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=32022fd97ed34f6812802bf1288db27c313576f4'/>
<id>urn:sha1:32022fd97ed34f6812802bf1288db27c313576f4</id>
<content type='text'>
Handle a GCC quirk of emitting extra volatile modifier in DWARF (and
subsequently preserved in BTF by pahole) for function pointers marked as
__attribute__((noreturn)). This was the way to mark such functions before GCC
2.5 added noreturn attribute. Drop such func_proto modifiers, similarly to how
it's done for array (also to handle GCC quirk/bug).

Such volatile attribute is emitted by GCC only, so existing selftests can't
express such test. Simple repro is like this (compiled with GCC + BTF
generated by pahole):

  struct my_struct {
      void __attribute__((noreturn)) (*fn)(int);
  };
  struct my_struct a;

Without this fix, output will be:

struct my_struct {
    voidvolatile  (*fn)(int);
};

With the fix:

struct my_struct {
    void (*fn)(int);
};

Fixes: 351131b51c7a ("libbpf: add btf_dump API for BTF-to-C conversion")
Reported-by: Jean-Philippe Brucker &lt;jean-philippe@linaro.org&gt;
Signed-off-by: Andrii Nakryiko &lt;andriin@fb.com&gt;
Signed-off-by: Daniel Borkmann &lt;daniel@iogearbox.net&gt;
Tested-by: Jean-Philippe Brucker &lt;jean-philippe@linaro.org&gt;
Link: https://lore.kernel.org/bpf/20200610052335.2862559-1-andriin@fb.com
</content>
</entry>
<entry>
<title>libbpf: Define __WORDSIZE if not available</title>
<updated>2020-06-09T23:19:25Z</updated>
<author>
<name>Arnaldo Carvalho de Melo</name>
<email>acme@kernel.org</email>
</author>
<published>2020-06-09T21:16:53Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=8ca8d4a841730c02e77bf3c87bf658cc44f364b9'/>
<id>urn:sha1:8ca8d4a841730c02e77bf3c87bf658cc44f364b9</id>
<content type='text'>
Some systems, such as Android, don't have a define for __WORDSIZE, do it
in terms of __SIZEOF_LONG__, as done in perf since 2012:

   http://git.kernel.org/torvalds/c/3f34f6c0233ae055b5

For reference: https://gcc.gnu.org/onlinedocs/cpp/Common-Predefined-Macros.html

I build tested it here and Andrii did some Travis CI build tests too.

Signed-off-by: Arnaldo Carvalho de Melo &lt;acme@redhat.com&gt;
Signed-off-by: Daniel Borkmann &lt;daniel@iogearbox.net&gt;
Acked-by: Andrii Nakryiko &lt;andriin@fb.com&gt;
Link: https://lore.kernel.org/bpf/20200608161150.GA3073@kernel.org
</content>
</entry>
<entry>
<title>libbpf: Add support for bpf_link-based netns attachment</title>
<updated>2020-06-01T22:21:03Z</updated>
<author>
<name>Jakub Sitnicki</name>
<email>jakub@cloudflare.com</email>
</author>
<published>2020-05-31T08:28:40Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=d60d81acc2c180e33244857e35ef60072573b000'/>
<id>urn:sha1:d60d81acc2c180e33244857e35ef60072573b000</id>
<content type='text'>
Add bpf_program__attach_nets(), which uses LINK_CREATE subcommand to create
an FD-based kernel bpf_link, for attach types tied to network namespace,
that is BPF_FLOW_DISSECTOR for the moment.

Signed-off-by: Jakub Sitnicki &lt;jakub@cloudflare.com&gt;
Signed-off-by: Alexei Starovoitov &lt;ast@kernel.org&gt;
Link: https://lore.kernel.org/bpf/20200531082846.2117903-7-jakub@cloudflare.com
</content>
</entry>
<entry>
<title>libbpf: Add _GNU_SOURCE for reallocarray to ringbuf.c</title>
<updated>2020-06-01T22:13:04Z</updated>
<author>
<name>Andrii Nakryiko</name>
<email>andriin@fb.com</email>
</author>
<published>2020-06-01T20:26:01Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=febeb6dff7beafcaf89521f6c8ff7b0adac08d54'/>
<id>urn:sha1:febeb6dff7beafcaf89521f6c8ff7b0adac08d54</id>
<content type='text'>
On systems with recent enough glibc, reallocarray compat won't kick in, so
reallocarray() itself has to come from stdlib.h include. But _GNU_SOURCE is
necessary to enable it. So add it.

Fixes: bf99c936f947 ("libbpf: Add BPF ring buffer support")
Signed-off-by: Andrii Nakryiko &lt;andriin@fb.com&gt;
Signed-off-by: Alexei Starovoitov &lt;ast@kernel.org&gt;
Acked-by: Song Liu &lt;songliubraving@fb.com&gt;
Link: https://lore.kernel.org/bpf/20200601202601.2139477-1-andriin@fb.com
</content>
</entry>
<entry>
<title>libbpf: Add SEC name for xdp programs attached to device map</title>
<updated>2020-06-01T21:48:32Z</updated>
<author>
<name>David Ahern</name>
<email>dsahern@kernel.org</email>
</author>
<published>2020-05-29T22:07:15Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=2778797037a658be71a6c55b54700bf58ba21eb7'/>
<id>urn:sha1:2778797037a658be71a6c55b54700bf58ba21eb7</id>
<content type='text'>
Support SEC("xdp_devmap*") as a short cut for loading the program with
type BPF_PROG_TYPE_XDP and expected attach type BPF_XDP_DEVMAP.

Signed-off-by: David Ahern &lt;dsahern@kernel.org&gt;
Signed-off-by: Alexei Starovoitov &lt;ast@kernel.org&gt;
Acked-by: Toke Høiland-Jørgensen &lt;toke@redhat.com&gt;
Link: https://lore.kernel.org/bpf/20200529220716.75383-5-dsahern@kernel.org
Signed-off-by: Alexei Starovoitov &lt;ast@kernel.org&gt;
</content>
</entry>
</feed>
