<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/samples/bpf/Makefile, branch v6.4</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=v6.4</id>
<link rel='self' href='https://git.shady.money/linux/atom?h=v6.4'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/'/>
<updated>2023-01-15T21:32:45Z</updated>
<entry>
<title>samples/bpf: change _kern suffix to .bpf with BPF test programs</title>
<updated>2023-01-15T21:32:45Z</updated>
<author>
<name>Daniel T. Lee</name>
<email>danieltimlee@gmail.com</email>
</author>
<published>2023-01-15T07:16:13Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=e04946f54cd99fa1bd92e22f4540720d76d88058'/>
<id>urn:sha1:e04946f54cd99fa1bd92e22f4540720d76d88058</id>
<content type='text'>
This commit changes the _kern suffix to .bpf with the BPF test programs.
With this modification, test programs will inherit the benefit of the
new CLANG-BPF compile target.

Signed-off-by: Daniel T. Lee &lt;danieltimlee@gmail.com&gt;
Link: https://lore.kernel.org/r/20230115071613.125791-11-danieltimlee@gmail.com
Signed-off-by: Alexei Starovoitov &lt;ast@kernel.org&gt;
</content>
</entry>
<entry>
<title>samples/bpf: Change _kern suffix to .bpf with syscall tracing program</title>
<updated>2022-12-29T22:22:34Z</updated>
<author>
<name>Daniel T. Lee</name>
<email>danieltimlee@gmail.com</email>
</author>
<published>2022-12-24T07:15:24Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=d4fffba4d04b8d605ff07f1ed987399f6af0ad5b'/>
<id>urn:sha1:d4fffba4d04b8d605ff07f1ed987399f6af0ad5b</id>
<content type='text'>
Currently old compile rule (CLANG-bpf) doesn't contains VMLINUX_H define
flag which is essential for the bpf program that includes "vmlinux.h".
Also old compile rule doesn't directly specify the compile target as bpf,
instead it uses bunch of extra options with clang followed by long chain
of commands. (e.g. clang | opt | llvm-dis | llc)

In Makefile, there is already new compile rule which is more simple and
neat. And it also has -D__VMLINUX_H__ option. By just changing the _kern
suffix to .bpf will inherit the benefit of the new CLANG-BPF compile
target.

Also, this commit adds dummy gnu/stub.h to the samples/bpf directory.
As commit 1c2dd16add7e ("selftests/bpf: get rid of -D__x86_64__") noted,
compiling with 'clang -target bpf' will raise an error with stubs.h
unless workaround (-D__x86_64) is used. This commit solves this problem
by adding dummy stub.h to make /usr/include/features.h to follow the
expected path as the same way selftests/bpf dealt with.

Signed-off-by: Daniel T. Lee &lt;danieltimlee@gmail.com&gt;
Signed-off-by: Andrii Nakryiko &lt;andrii@kernel.org&gt;
Link: https://lore.kernel.org/bpf/20221224071527.2292-4-danieltimlee@gmail.com
</content>
</entry>
<entry>
<title>samples: bpf: Fix cross-compiling error by using bootstrap bpftool</title>
<updated>2022-07-15T19:01:30Z</updated>
<author>
<name>Pu Lehui</name>
<email>pulehui@huawei.com</email>
</author>
<published>2022-07-14T02:46:10Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=2e4966288c1651c22202df80142ed84dbef817b5'/>
<id>urn:sha1:2e4966288c1651c22202df80142ed84dbef817b5</id>
<content type='text'>
Currently, when cross compiling bpf samples, the host side cannot
use arch-specific bpftool to generate vmlinux.h or skeleton. Since
samples/bpf use bpftool for vmlinux.h, skeleton, and static linking
only, we can use lightweight bootstrap version of bpftool to handle
these, and it's always host-native.

Suggested-by: Andrii Nakryiko &lt;andrii@kernel.org&gt;
Signed-off-by: Pu Lehui &lt;pulehui@huawei.com&gt;
Signed-off-by: Andrii Nakryiko &lt;andrii@kernel.org&gt;
Link: https://lore.kernel.org/bpf/20220714024612.944071-2-pulehui@huawei.com
</content>
</entry>
<entry>
<title>bpf, samples: Remove AF_XDP samples</title>
<updated>2022-07-05T09:58:44Z</updated>
<author>
<name>Magnus Karlsson</name>
<email>magnus.karlsson@intel.com</email>
</author>
<published>2022-06-30T09:37:17Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=cfb5a2dbf1413a0086e987d99ad591b91fc9cf5c'/>
<id>urn:sha1:cfb5a2dbf1413a0086e987d99ad591b91fc9cf5c</id>
<content type='text'>
Remove the AF_XDP samples from samples/bpf/ as they are dependent on
the AF_XDP support in libbpf. This support has now been removed in the
1.0 release, so these samples cannot be compiled anymore. Please start
to use libxdp instead. It is backwards compatible with the AF_XDP
support that was offered in libbpf. New samples can be found in the
various xdp-project repositories connected to libxdp and by googling.

Signed-off-by: Magnus Karlsson &lt;magnus.karlsson@intel.com&gt;
Signed-off-by: Daniel Borkmann &lt;daniel@iogearbox.net&gt;
Acked-by: Toke Høiland-Jørgensen &lt;toke@redhat.com&gt;
Acked-by: Maciej Fijalkowski &lt;maciej.fijalkowski@intel.com&gt;
Acked-by: Jesper Dangaard Brouer &lt;brouer@redhat.com&gt;
Link: https://lore.kernel.org/bpf/20220630093717.8664-1-magnus.karlsson@gmail.com
</content>
</entry>
<entry>
<title>samples: bpf: Don't fail for a missing VMLINUX_BTF when VMLINUX_H is provided</title>
<updated>2022-05-10T00:40:43Z</updated>
<author>
<name>Jerome Marchand</name>
<email>jmarchan@redhat.com</email>
</author>
<published>2022-05-07T16:16:35Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=ec24704492d8791a52a75a39e3ad762b6e017bc6'/>
<id>urn:sha1:ec24704492d8791a52a75a39e3ad762b6e017bc6</id>
<content type='text'>
samples/bpf build currently always fails if it can't generate
vmlinux.h from vmlinux, even when vmlinux.h is directly provided by
VMLINUX_H variable, which makes VMLINUX_H pointless.
Only fails when neither method works.

Fixes: 384b6b3bbf0d ("samples: bpf: Add vmlinux.h generation support")
Reported-by: CKI Project &lt;cki-project@redhat.com&gt;
Reported-by: Veronika Kabatova &lt;vkabatov@redhat.com&gt;
Signed-off-by: Jerome Marchand &lt;jmarchan@redhat.com&gt;
Signed-off-by: Andrii Nakryiko &lt;andrii@kernel.org&gt;
Link: https://lore.kernel.org/bpf/20220507161635.2219052-1-jmarchan@redhat.com
</content>
</entry>
<entry>
<title>samples, bpf: Move routes monitor in xdp_router_ipv4 in a dedicated thread</title>
<updated>2022-04-08T20:10:57Z</updated>
<author>
<name>Lorenzo Bianconi</name>
<email>lorenzo@kernel.org</email>
</author>
<published>2022-04-05T14:15:14Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=587323cf6a6a6da074f0518444ee7da10f517f45'/>
<id>urn:sha1:587323cf6a6a6da074f0518444ee7da10f517f45</id>
<content type='text'>
In order to not miss any netlink message from the kernel, move routes
monitor to a dedicated thread.

Fixes: 85bf1f51691c ("samples: bpf: Convert xdp_router_ipv4 to XDP samples helper")
Signed-off-by: Lorenzo Bianconi &lt;lorenzo@kernel.org&gt;
Signed-off-by: Daniel Borkmann &lt;daniel@iogearbox.net&gt;
Link: https://lore.kernel.org/bpf/e364b817c69ded73be24b677ab47a157f7c21b64.1649167911.git.lorenzo@kernel.org
</content>
</entry>
<entry>
<title>samples: bpf: Fix linking xdp_router_ipv4 after migration</title>
<updated>2022-04-04T21:45:06Z</updated>
<author>
<name>Alexander Lobakin</name>
<email>alexandr.lobakin@intel.com</email>
</author>
<published>2022-04-04T11:54:51Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=fc843ccd8e4c084fa5d605a876db2d3a3c38be88'/>
<id>urn:sha1:fc843ccd8e4c084fa5d605a876db2d3a3c38be88</id>
<content type='text'>
Users of the xdp_sample_user infra should be explicitly linked
with the standard math library (`-lm`). Otherwise, the following
happens:

/usr/bin/ld: xdp_sample_user.c:(.text+0x59fc): undefined reference to `ceil'
/usr/bin/ld: xdp_sample_user.c:(.text+0x5a0d): undefined reference to `ceil'
/usr/bin/ld: xdp_sample_user.c:(.text+0x5adc): undefined reference to `floor'
/usr/bin/ld: xdp_sample_user.c:(.text+0x5b01): undefined reference to `ceil'
/usr/bin/ld: xdp_sample_user.c:(.text+0x5c1e): undefined reference to `floor'
/usr/bin/ld: xdp_sample_user.c:(.text+0x5c43): undefined reference to `ceil
[...]

That happened previously, so there's a block of linkage flags in the
Makefile. xdp_router_ipv4 has been transferred to this infra quite
recently, but hasn't been added to it. Fix.

Fixes: 85bf1f51691c ("samples: bpf: Convert xdp_router_ipv4 to XDP samples helper")
Signed-off-by: Alexander Lobakin &lt;alexandr.lobakin@intel.com&gt;
Signed-off-by: Andrii Nakryiko &lt;andrii@kernel.org&gt;
Link: https://lore.kernel.org/bpf/20220404115451.1116478-1-alexandr.lobakin@intel.com
</content>
</entry>
<entry>
<title>samples: bpf: Convert xdp_router_ipv4 to XDP samples helper</title>
<updated>2022-04-04T00:12:09Z</updated>
<author>
<name>Lorenzo Bianconi</name>
<email>lorenzo@kernel.org</email>
</author>
<published>2022-03-16T07:13:23Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=85bf1f51691c078e77f524a7addf37faa6635a6e'/>
<id>urn:sha1:85bf1f51691c078e77f524a7addf37faa6635a6e</id>
<content type='text'>
Rely on the libbpf skeleton facility and other utilities provided by XDP
sample helpers in xdp_router_ipv4 sample.

Signed-off-by: Lorenzo Bianconi &lt;lorenzo@kernel.org&gt;
Signed-off-by: Andrii Nakryiko &lt;andrii@kernel.org&gt;
Link: https://lore.kernel.org/bpf/7f4d98ee2c13c04d5eb924eebf79ced32fee8418.1647414711.git.lorenzo@kernel.org
</content>
</entry>
<entry>
<title>samples: bpf: Fix xdp_sample_user.o linking with Clang</title>
<updated>2021-12-07T03:33:44Z</updated>
<author>
<name>Alexander Lobakin</name>
<email>alexandr.lobakin@intel.com</email>
</author>
<published>2021-12-03T19:50:03Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=e64fbcaa7a666f16329b1c67af15ea501bc84586'/>
<id>urn:sha1:e64fbcaa7a666f16329b1c67af15ea501bc84586</id>
<content type='text'>
Clang (13) doesn't get the jokes about specifying libraries to link in
cclags of individual .o objects:

clang-13: warning: -lm: 'linker' input unused [-Wunused-command-line-argument]
[ ... ]
  LD  samples/bpf/xdp_redirect_cpu
  LD  samples/bpf/xdp_redirect_map_multi
  LD  samples/bpf/xdp_redirect_map
  LD  samples/bpf/xdp_redirect
  LD  samples/bpf/xdp_monitor
/usr/bin/ld: samples/bpf/xdp_sample_user.o: in function `sample_summary_print':
xdp_sample_user.c:(.text+0x84c): undefined reference to `floor'
/usr/bin/ld: xdp_sample_user.c:(.text+0x870): undefined reference to `ceil'
/usr/bin/ld: xdp_sample_user.c:(.text+0x8cf): undefined reference to `floor'
/usr/bin/ld: xdp_sample_user.c:(.text+0x8f3): undefined reference to `ceil'
[ more ]

Specify '-lm' as ldflags for all xdp_sample_user.o users in the main
Makefile and remove it from ccflags of ^ in Makefile.target -- just
like it's done for all other samples. This works with all compilers.

Fixes: 6e1051a54e31 ("samples: bpf: Convert xdp_monitor to XDP samples helper")
Fixes: b926c55d856c ("samples: bpf: Convert xdp_redirect to XDP samples helper")
Fixes: e531a220cc59 ("samples: bpf: Convert xdp_redirect_cpu to XDP samples helper")
Fixes: bbe65865aa05 ("samples: bpf: Convert xdp_redirect_map to XDP samples helper")
Fixes: 594a116b2aa1 ("samples: bpf: Convert xdp_redirect_map_multi to XDP samples helper")
Signed-off-by: Alexander Lobakin &lt;alexandr.lobakin@intel.com&gt;
Signed-off-by: Andrii Nakryiko &lt;andrii@kernel.org&gt;
Acked-by: Kumar Kartikeya Dwivedi &lt;memxor@gmail.com&gt;
Link: https://lore.kernel.org/bpf/20211203195004.5803-2-alexandr.lobakin@intel.com
</content>
</entry>
<entry>
<title>samples/bpf: Clean up samples/bpf build failes</title>
<updated>2021-12-02T23:23:40Z</updated>
<author>
<name>Andrii Nakryiko</name>
<email>andrii@kernel.org</email>
</author>
<published>2021-12-01T23:28:22Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=527024f7aeb683ce7ef49b07ef7ce9ecf015288d'/>
<id>urn:sha1:527024f7aeb683ce7ef49b07ef7ce9ecf015288d</id>
<content type='text'>
Remove xdp_samples_user.o rule redefinition which generates Makefile
warning and instead override TPROGS_CFLAGS. This seems to work fine when
building inside selftests/bpf.

That was one big head-scratcher before I found that generic
Makefile.target hid this surprising specialization for for xdp_samples_user.o.

Main change is to use actual locally installed libbpf headers.

Also drop printk macro re-definition (not even used!).

Signed-off-by: Andrii Nakryiko &lt;andrii@kernel.org&gt;
Signed-off-by: Alexei Starovoitov &lt;ast@kernel.org&gt;
Link: https://lore.kernel.org/bpf/20211201232824.3166325-8-andrii@kernel.org
</content>
</entry>
</feed>
