<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/samples/bpf, branch v5.5</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.5</id>
<link rel='self' href='https://git.shady.money/linux/atom?h=v5.5'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/'/>
<updated>2019-12-11T23:28:06Z</updated>
<entry>
<title>samples: bpf: fix syscall_tp due to unused syscall</title>
<updated>2019-12-11T23:28:06Z</updated>
<author>
<name>Daniel T. Lee</name>
<email>danieltimlee@gmail.com</email>
</author>
<published>2019-12-05T08:01:14Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=fe3300897cbfd76c6cb825776e5ac0ca50a91ca4'/>
<id>urn:sha1:fe3300897cbfd76c6cb825776e5ac0ca50a91ca4</id>
<content type='text'>
Currently, open() is called from the user program and it calls the syscall
'sys_openat', not the 'sys_open'. This leads to an error of the program
of user side, due to the fact that the counter maps are zero since no
function such 'sys_open' is called.

This commit adds the kernel bpf program which are attached to the
tracepoint 'sys_enter_openat' and 'sys_enter_openat'.

Fixes: 1da236b6be963 ("bpf: add a test case for syscalls/sys_{enter|exit}_* tracepoints")
Signed-off-by: Daniel T. Lee &lt;danieltimlee@gmail.com&gt;
Signed-off-by: Alexei Starovoitov &lt;ast@kernel.org&gt;
</content>
</entry>
<entry>
<title>samples: bpf: Replace symbol compare of trace_event</title>
<updated>2019-12-11T23:27:28Z</updated>
<author>
<name>Daniel T. Lee</name>
<email>danieltimlee@gmail.com</email>
</author>
<published>2019-12-05T08:01:13Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=bba1b2a890253528c45aa66cf856f289a215bfbc'/>
<id>urn:sha1:bba1b2a890253528c45aa66cf856f289a215bfbc</id>
<content type='text'>
Previously, when this sample is added, commit 1c47910ef8013
("samples/bpf: add perf_event+bpf example"), a symbol 'sys_read' and
'sys_write' has been used without no prefixes. But currently there are
no exact symbols with these under kallsyms and this leads to failure.

This commit changes exact compare to substring compare to keep compatible
with exact symbol or prefixed symbol.

Fixes: 1c47910ef8013 ("samples/bpf: add perf_event+bpf example")
Signed-off-by: Daniel T. Lee &lt;danieltimlee@gmail.com&gt;
Signed-off-by: Alexei Starovoitov &lt;ast@kernel.org&gt;
Link: https://lore.kernel.org/bpf/20191205080114.19766-2-danieltimlee@gmail.com
</content>
</entry>
<entry>
<title>samples/bpf: Fix broken xdp_rxq_info due to map order assumptions</title>
<updated>2019-12-05T01:54:15Z</updated>
<author>
<name>Jesper Dangaard Brouer</name>
<email>brouer@redhat.com</email>
</author>
<published>2019-12-02T12:37:31Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=edbca120a8cdfa5a5793707e33497aa5185875ca'/>
<id>urn:sha1:edbca120a8cdfa5a5793707e33497aa5185875ca</id>
<content type='text'>
In the days of using bpf_load.c the order in which the 'maps' sections
were defines in BPF side (*_kern.c) file, were used by userspace side
to identify the map via using the map order as an index. In effect the
order-index is created based on the order the maps sections are stored
in the ELF-object file, by the LLVM compiler.

This have also carried over in libbpf via API bpf_map__next(NULL, obj)
to extract maps in the order libbpf parsed the ELF-object file.

When BTF based maps were introduced a new section type ".maps" were
created. I found that the LLVM compiler doesn't create the ".maps"
sections in the order they are defined in the C-file. The order in the
ELF file is based on the order the map pointer is referenced in the code.

This combination of changes lead to xdp_rxq_info mixing up the map
file-descriptors in userspace, resulting in very broken behaviour, but
without warning the user.

This patch fix issue by instead using bpf_object__find_map_by_name()
to find maps via their names. (Note, this is the ELF name, which can
be longer than the name the kernel retains).

Fixes: be5bca44aa6b ("samples: bpf: convert some XDP samples from bpf_load to libbpf")
Fixes: 451d1dc886b5 ("samples: bpf: update map definition to new syntax BTF-defined map")
Signed-off-by: Jesper Dangaard Brouer &lt;brouer@redhat.com&gt;
Signed-off-by: Alexei Starovoitov &lt;ast@kernel.org&gt;
Acked-by: Toke Høiland-Jørgensen &lt;toke@redhat.com&gt;
Acked-by: Andrii Nakryiko &lt;andriin@fb.com&gt;
Link: https://lore.kernel.org/bpf/157529025128.29832.5953245340679936909.stgit@firesoul
</content>
</entry>
<entry>
<title>Merge git://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next</title>
<updated>2019-11-21T02:11:23Z</updated>
<author>
<name>David S. Miller</name>
<email>davem@davemloft.net</email>
</author>
<published>2019-11-21T02:11:23Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=ee5a489fd9645104925e5cdf8f8e455d833730b9'/>
<id>urn:sha1:ee5a489fd9645104925e5cdf8f8e455d833730b9</id>
<content type='text'>
Daniel Borkmann says:

====================
pull-request: bpf-next 2019-11-20

The following pull-request contains BPF updates for your *net-next* tree.

We've added 81 non-merge commits during the last 17 day(s) which contain
a total of 120 files changed, 4958 insertions(+), 1081 deletions(-).

There are 3 trivial conflicts, resolve it by always taking the chunk from
196e8ca74886c433:

&lt;&lt;&lt;&lt;&lt;&lt;&lt; HEAD
=======
void *bpf_map_area_mmapable_alloc(u64 size, int numa_node);
&gt;&gt;&gt;&gt;&gt;&gt;&gt; 196e8ca74886c433dcfc64a809707074b936aaf5

&lt;&lt;&lt;&lt;&lt;&lt;&lt; HEAD
void *bpf_map_area_alloc(u64 size, int numa_node)
=======
static void *__bpf_map_area_alloc(u64 size, int numa_node, bool mmapable)
&gt;&gt;&gt;&gt;&gt;&gt;&gt; 196e8ca74886c433dcfc64a809707074b936aaf5

&lt;&lt;&lt;&lt;&lt;&lt;&lt; HEAD
        if (size &lt;= (PAGE_SIZE &lt;&lt; PAGE_ALLOC_COSTLY_ORDER)) {
=======
        /* kmalloc()'ed memory can't be mmap()'ed */
        if (!mmapable &amp;&amp; size &lt;= (PAGE_SIZE &lt;&lt; PAGE_ALLOC_COSTLY_ORDER)) {
&gt;&gt;&gt;&gt;&gt;&gt;&gt; 196e8ca74886c433dcfc64a809707074b936aaf5

The main changes are:

1) Addition of BPF trampoline which works as a bridge between kernel functions,
   BPF programs and other BPF programs along with two new use cases: i) fentry/fexit
   BPF programs for tracing with practically zero overhead to call into BPF (as
   opposed to k[ret]probes) and ii) attachment of the former to networking related
   programs to see input/output of networking programs (covering xdpdump use case),
   from Alexei Starovoitov.

2) BPF array map mmap support and use in libbpf for global data maps; also a big
   batch of libbpf improvements, among others, support for reading bitfields in a
   relocatable manner (via libbpf's CO-RE helper API), from Andrii Nakryiko.

3) Extend s390x JIT with usage of relative long jumps and loads in order to lift
   the current 64/512k size limits on JITed BPF programs there, from Ilya Leoshkevich.

4) Add BPF audit support and emit messages upon successful prog load and unload in
   order to have a timeline of events, from Daniel Borkmann and Jiri Olsa.

5) Extension to libbpf and xdpsock sample programs to demo the shared umem mode
   (XDP_SHARED_UMEM) as well as RX-only and TX-only sockets, from Magnus Karlsson.

6) Several follow-up bug fixes for libbpf's auto-pinning code and a new API
   call named bpf_get_link_xdp_info() for retrieving the full set of prog
   IDs attached to XDP, from Toke Høiland-Jørgensen.

7) Add BTF support for array of int, array of struct and multidimensional arrays
   and enable it for skb-&gt;cb[] access in kfree_skb test, from Martin KaFai Lau.

8) Fix AF_XDP by using the correct number of channels from ethtool, from Luigi Rizzo.

9) Two fixes for BPF selftest to get rid of a hang in test_tc_tunnel and to avoid
   xdping to be run as standalone, from Jiri Benc.

10) Various BPF selftest fixes when run with latest LLVM trunk, from Yonghong Song.

11) Fix a memory leak in BPF fentry test run data, from Colin Ian King.

12) Various smaller misc cleanups and improvements mostly all over BPF selftests and
    samples, from Daniel T. Lee, Andre Guedes, Anders Roxell, Mao Wenan, Yue Haibing.
====================

Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>samples/bpf: Add missing option to xdpsock usage</title>
<updated>2019-11-15T21:32:10Z</updated>
<author>
<name>Andre Guedes</name>
<email>andre.guedes@intel.com</email>
</author>
<published>2019-11-14T16:28:47Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=b31333298087f8ee3559bd62bcbd1638f232cac0'/>
<id>urn:sha1:b31333298087f8ee3559bd62bcbd1638f232cac0</id>
<content type='text'>
Commit 743e568c1586 (samples/bpf: Add a "force" flag to XDP samples)
introduced the '-F' option but missed adding it to the usage() and the
'long_option' array.

Fixes: 743e568c1586 (samples/bpf: Add a "force" flag to XDP samples)
Signed-off-by: Andre Guedes &lt;andre.guedes@intel.com&gt;
Signed-off-by: Daniel Borkmann &lt;daniel@iogearbox.net&gt;
Link: https://lore.kernel.org/bpf/20191114162847.221770-2-andre.guedes@intel.com
</content>
</entry>
<entry>
<title>samples/bpf: Remove duplicate option from xdpsock</title>
<updated>2019-11-15T21:29:17Z</updated>
<author>
<name>Andre Guedes</name>
<email>andre.guedes@intel.com</email>
</author>
<published>2019-11-14T16:28:46Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=110b2263db8ab91d204378988ca73b932b26dad3'/>
<id>urn:sha1:110b2263db8ab91d204378988ca73b932b26dad3</id>
<content type='text'>
The '-f' option is shown twice in the usage(). This patch removes the
outdated version.

Signed-off-by: Andre Guedes &lt;andre.guedes@intel.com&gt;
Signed-off-by: Daniel Borkmann &lt;daniel@iogearbox.net&gt;
Link: https://lore.kernel.org/bpf/20191114162847.221770-1-andre.guedes@intel.com
</content>
</entry>
<entry>
<title>samples/bpf: adjust Makefile and README.rst</title>
<updated>2019-11-12T05:42:09Z</updated>
<author>
<name>Jesper Dangaard Brouer</name>
<email>brouer@redhat.com</email>
</author>
<published>2019-11-10T16:31:16Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=6cc2c8762dfdd8c3eeb9d71ed6ad6314d7d5d79c'/>
<id>urn:sha1:6cc2c8762dfdd8c3eeb9d71ed6ad6314d7d5d79c</id>
<content type='text'>
Side effect of some kbuild changes resulted in breaking the
documented way to build samples/bpf/.

This patch change the samples/bpf/Makefile to work again, when
invoking make from the subdir samples/bpf/. Also update the
documentation in README.rst, to reflect the new way to build.

Signed-off-by: Jesper Dangaard Brouer &lt;brouer@redhat.com&gt;
Acked-by: Daniel Borkmann &lt;daniel@iogearbox.net&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>samples/bpf: Use Rx-only and Tx-only sockets in xdpsock</title>
<updated>2019-11-11T03:30:46Z</updated>
<author>
<name>Magnus Karlsson</name>
<email>magnus.karlsson@intel.com</email>
</author>
<published>2019-11-07T17:47:39Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=661842c46de2151758083b2ead605920b4770c2b'/>
<id>urn:sha1:661842c46de2151758083b2ead605920b4770c2b</id>
<content type='text'>
Use Rx-only sockets for the rxdrop sample and Tx-only sockets for the
txpush sample in the xdpsock application. This so that we exercise and
show case these socket types too.

Signed-off-by: Magnus Karlsson &lt;magnus.karlsson@intel.com&gt;
Signed-off-by: Alexei Starovoitov &lt;ast@kernel.org&gt;
Tested-by: William Tu &lt;u9012063@gmail.com&gt;
Acked-by: Jonathan Lemon &lt;jonathan.lemon@gmail.com&gt;
Link: https://lore.kernel.org/bpf/1573148860-30254-5-git-send-email-magnus.karlsson@intel.com
</content>
</entry>
<entry>
<title>samples/bpf: Add XDP_SHARED_UMEM support to xdpsock</title>
<updated>2019-11-11T03:30:45Z</updated>
<author>
<name>Magnus Karlsson</name>
<email>magnus.karlsson@intel.com</email>
</author>
<published>2019-11-07T17:47:37Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=2e5d72c15f0dc713c203464c5c76eb4ec285f598'/>
<id>urn:sha1:2e5d72c15f0dc713c203464c5c76eb4ec285f598</id>
<content type='text'>
Add support for the XDP_SHARED_UMEM mode to the xdpsock sample
application. As libbpf does not have a built in XDP program for this
mode, we use an explicitly loaded XDP program. This also serves as an
example on how to write your own XDP program that can route to an
AF_XDP socket.

Signed-off-by: Magnus Karlsson &lt;magnus.karlsson@intel.com&gt;
Signed-off-by: Alexei Starovoitov &lt;ast@kernel.org&gt;
Tested-by: William Tu &lt;u9012063@gmail.com&gt;
Acked-by: Jonathan Lemon &lt;jonathan.lemon@gmail.com&gt;
Link: https://lore.kernel.org/bpf/1573148860-30254-3-git-send-email-magnus.karlsson@intel.com
</content>
</entry>
<entry>
<title>Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net</title>
<updated>2019-11-09T19:04:37Z</updated>
<author>
<name>David S. Miller</name>
<email>davem@davemloft.net</email>
</author>
<published>2019-11-09T19:04:37Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=14684b93019a2d2ece0df5acaf921924541b928d'/>
<id>urn:sha1:14684b93019a2d2ece0df5acaf921924541b928d</id>
<content type='text'>
One conflict in the BPF samples Makefile, some fixes in 'net' whilst
we were converting over to Makefile.target rules in 'net-next'.

Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
</feed>
