<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/scripts/bpf_helpers_doc.py, 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-05-11T19:20:53Z</updated>
<entry>
<title>bpf: Minor fixes to BPF helpers documentation</title>
<updated>2020-05-11T19:20:53Z</updated>
<author>
<name>Quentin Monnet</name>
<email>quentin@isovalent.com</email>
</author>
<published>2020-05-11T16:15:35Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=ab8d78093dfa2e7820ca0c28dda9142aa771c510'/>
<id>urn:sha1:ab8d78093dfa2e7820ca0c28dda9142aa771c510</id>
<content type='text'>
Minor improvements to the documentation for BPF helpers:

* Fix formatting for the description of "bpf_socket" for
  bpf_getsockopt() and bpf_setsockopt(), thus suppressing two warnings
  from rst2man about "Unexpected indentation".
* Fix formatting for return values for bpf_sk_assign() and seq_file
  helpers.
* Fix and harmonise formatting, in particular for function/struct names.
* Remove blank lines before "Return:" sections.
* Replace tabs found in the middle of text lines.
* Fix typos.
* Add a note to the footer (in Python script) about "bpftool feature
  probe", including for listing features available to unprivileged
  users, and add a reference to bpftool man page.

Thanks to Florian for reporting two typos (duplicated words).

Signed-off-by: Quentin Monnet &lt;quentin@isovalent.com&gt;
Signed-off-by: Daniel Borkmann &lt;daniel@iogearbox.net&gt;
Link: https://lore.kernel.org/bpf/20200511161536.29853-4-quentin@isovalent.com
</content>
</entry>
<entry>
<title>bpf: Add bpf_seq_printf and bpf_seq_write helpers</title>
<updated>2020-05-10T00:05:26Z</updated>
<author>
<name>Yonghong Song</name>
<email>yhs@fb.com</email>
</author>
<published>2020-05-09T17:59:14Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=492e639f0c222784e2e0f121966375f641c61b15'/>
<id>urn:sha1:492e639f0c222784e2e0f121966375f641c61b15</id>
<content type='text'>
Two helpers bpf_seq_printf and bpf_seq_write, are added for
writing data to the seq_file buffer.

bpf_seq_printf supports common format string flag/width/type
fields so at least I can get identical results for
netlink and ipv6_route targets.

For bpf_seq_printf and bpf_seq_write, return value -EOVERFLOW
specifically indicates a write failure due to overflow, which
means the object will be repeated in the next bpf invocation
if object collection stays the same. Note that if the object
collection is changed, depending how collection traversal is
done, even if the object still in the collection, it may not
be visited.

For bpf_seq_printf, format %s, %p{i,I}{4,6} needs to
read kernel memory. Reading kernel memory may fail in
the following two cases:
  - invalid kernel address, or
  - valid kernel address but requiring a major fault
If reading kernel memory failed, the %s string will be
an empty string and %p{i,I}{4,6} will be all 0.
Not returning error to bpf program is consistent with
what bpf_trace_printk() does for now.

bpf_seq_printf may return -EBUSY meaning that internal percpu
buffer for memory copy of strings or other pointees is
not available. Bpf program can return 1 to indicate it
wants the same object to be repeated. Right now, this should not
happen on no-RT kernels since migrate_disable(), which guards
bpf prog call, calls preempt_disable().

Signed-off-by: Yonghong Song &lt;yhs@fb.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/20200509175914.2476661-1-yhs@fb.com
</content>
</entry>
<entry>
<title>bpf_helpers_doc.py: Fix warning when compiling bpftool</title>
<updated>2020-03-13T19:53:40Z</updated>
<author>
<name>Carlos Neira</name>
<email>cneirabustos@gmail.com</email>
</author>
<published>2020-03-13T15:46:50Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=5996a587a466fa469531272139d23a3b56e07e5c'/>
<id>urn:sha1:5996a587a466fa469531272139d23a3b56e07e5c</id>
<content type='text'>
When compiling bpftool the following warning is found: "declaration of
'struct bpf_pidns_info' will not be visible outside of this function."
This patch adds struct bpf_pidns_info to type_fwds array to fix this.

Fixes: b4490c5c4e02 ("bpf: Added new helper bpf_get_ns_current_pid_tgid")
Signed-off-by: Carlos Neira &lt;cneirabustos@gmail.com&gt;
Signed-off-by: Daniel Borkmann &lt;daniel@iogearbox.net&gt;
Reviewed-by: Quentin Monnet &lt;quentin@isovalent.com&gt;
Acked-by: Martin KaFai Lau &lt;kafai@fb.com&gt;
Link: https://lore.kernel.org/bpf/20200313154650.13366-1-cneirabustos@gmail.com
</content>
</entry>
<entry>
<title>bpf: Added new helper bpf_get_ns_current_pid_tgid</title>
<updated>2020-03-13T00:33:11Z</updated>
<author>
<name>Carlos Neira</name>
<email>cneirabustos@gmail.com</email>
</author>
<published>2020-03-04T20:41:56Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=b4490c5c4e023f09b7d27c9a9d3e7ad7d09ea6bf'/>
<id>urn:sha1:b4490c5c4e023f09b7d27c9a9d3e7ad7d09ea6bf</id>
<content type='text'>
New bpf helper bpf_get_ns_current_pid_tgid,
This helper will return pid and tgid from current task
which namespace matches dev_t and inode number provided,
this will allows us to instrument a process inside a container.

Signed-off-by: Carlos Neira &lt;cneirabustos@gmail.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/20200304204157.58695-3-cneirabustos@gmail.com
</content>
</entry>
<entry>
<title>scripts/bpf: Switch to more portable python3 shebang</title>
<updated>2020-02-26T14:42:21Z</updated>
<author>
<name>Scott Branden</name>
<email>scott.branden@broadcom.com</email>
</author>
<published>2020-02-25T20:54:26Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=3cd046f182aab72b922e35461b204a2b52587946'/>
<id>urn:sha1:3cd046f182aab72b922e35461b204a2b52587946</id>
<content type='text'>
Change "/usr/bin/python3" to "/usr/bin/env python3" for
more portable solution in bpf_helpers_doc.py.

Signed-off-by: Scott Branden &lt;scott.branden@broadcom.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/20200225205426.6975-1-scott.branden@broadcom.com
</content>
</entry>
<entry>
<title>libbpf: Clean up bpf_helper_defs.h generation output</title>
<updated>2020-01-14T01:48:13Z</updated>
<author>
<name>Andrii Nakryiko</name>
<email>andriin@fb.com</email>
</author>
<published>2020-01-13T07:31:39Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=292e1d73b125d7a3fd7ff382557e003ece3c0d65'/>
<id>urn:sha1:292e1d73b125d7a3fd7ff382557e003ece3c0d65</id>
<content type='text'>
bpf_helpers_doc.py script, used to generate bpf_helper_defs.h, unconditionally
emits one informational message to stderr. Remove it and preserve stderr to
contain only relevant errors. Also make sure script invocations command is
muted by default in libbpf's Makefile.

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/20200113073143.1779940-3-andriin@fb.com
</content>
</entry>
<entry>
<title>scripts/bpf: Print an error when known types list needs updating</title>
<updated>2019-10-21T01:21:21Z</updated>
<author>
<name>Jakub Sitnicki</name>
<email>jakub@cloudflare.com</email>
</author>
<published>2019-10-20T11:23:44Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=ab81e203bc0d4a4542bca2498535f8761a3cfd92'/>
<id>urn:sha1:ab81e203bc0d4a4542bca2498535f8761a3cfd92</id>
<content type='text'>
Don't generate a broken bpf_helper_defs.h header if the helper script needs
updating because it doesn't recognize a newly added type. Instead print an
error that explains why the build is failing, clean up the partially
generated header and stop.

v1-&gt;v2:
- Switched from temporary file to .DELETE_ON_ERROR.

Fixes: 456a513bb5d4 ("scripts/bpf: Emit an #error directive known types list needs updating")
Suggested-by: Andrii Nakryiko &lt;andriin@fb.com&gt;
Signed-off-by: Jakub Sitnicki &lt;jakub@cloudflare.com&gt;
Signed-off-by: Alexei Starovoitov &lt;ast@kernel.org&gt;
Acked-by: Yonghong Song &lt;yhs@fb.com&gt;
Acked-by: Andrii Nakryiko &lt;andriin@fb.com&gt;
Link: https://lore.kernel.org/bpf/20191020112344.19395-1-jakub@cloudflare.com
</content>
</entry>
<entry>
<title>scripts/bpf: Emit an #error directive known types list needs updating</title>
<updated>2019-10-16T12:30:03Z</updated>
<author>
<name>Jakub Sitnicki</name>
<email>jakub@cloudflare.com</email>
</author>
<published>2019-10-16T08:58:11Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=456a513bb5d494f169271b16334049d50c7e630b'/>
<id>urn:sha1:456a513bb5d494f169271b16334049d50c7e630b</id>
<content type='text'>
Make the compiler report a clear error when bpf_helpers_doc.py needs
updating rather than rely on the fact that Clang fails to compile
English:

../../../lib/bpf/bpf_helper_defs.h:2707:1: error: unknown type name 'Unrecognized'
Unrecognized type 'struct bpf_inet_lookup', please add it to known types!

Signed-off-by: Jakub Sitnicki &lt;jakub@cloudflare.com&gt;
Signed-off-by: Daniel Borkmann &lt;daniel@iogearbox.net&gt;
Link: https://lore.kernel.org/bpf/20191016085811.11700-1-jakub@cloudflare.com
</content>
</entry>
<entry>
<title>scripts/bpf: Fix xdp_md forward declaration typo</title>
<updated>2019-10-10T04:43:42Z</updated>
<author>
<name>Andrii Nakryiko</name>
<email>andriin@fb.com</email>
</author>
<published>2019-10-10T04:25:34Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=e0b68fb186b251374adbd870f99b1ecea236e770'/>
<id>urn:sha1:e0b68fb186b251374adbd870f99b1ecea236e770</id>
<content type='text'>
Fix typo in struct xpd_md, generated from bpf_helpers_doc.py, which is
causing compilation warnings for programs using bpf_helpers.h

Fixes: 7a387bed47f7 ("scripts/bpf: teach bpf_helpers_doc.py to dump BPF helper definitions")
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/20191010042534.290562-1-andriin@fb.com
</content>
</entry>
<entry>
<title>scripts/bpf: teach bpf_helpers_doc.py to dump BPF helper definitions</title>
<updated>2019-10-07T05:29:36Z</updated>
<author>
<name>Andrii Nakryiko</name>
<email>andriin@fb.com</email>
</author>
<published>2019-10-07T03:07:37Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=7a387bed47f7e80e257d966cd64a3e92a63e26a1'/>
<id>urn:sha1:7a387bed47f7e80e257d966cd64a3e92a63e26a1</id>
<content type='text'>
Enhance scripts/bpf_helpers_doc.py to emit C header with BPF helper
definitions (to be included from libbpf's bpf_helpers.h).

Signed-off-by: Andrii Nakryiko &lt;andriin@fb.com&gt;
Signed-off-by: Alexei Starovoitov &lt;ast@kernel.org&gt;
</content>
</entry>
</feed>
