<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux-dev/samples/bpf, branch master</title>
<subtitle>Linux kernel development work - see feature branches</subtitle>
<id>https://git.zx2c4.com/linux-dev/atom/samples/bpf?h=master</id>
<link rel='self' href='https://git.zx2c4.com/linux-dev/atom/samples/bpf?h=master'/>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/'/>
<updated>2022-09-30T22:04:23Z</updated>
<entry>
<title>samples/bpf: Fix typo in xdp_router_ipv4 sample</title>
<updated>2022-09-30T22:04:23Z</updated>
<author>
<name>Deming Wang</name>
<email>wangdeming@inspur.com</email>
</author>
<published>2022-09-27T19:25:27Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=b59cc7fcbaebde52ed97f63c6c50e49b8dd5be37'/>
<id>urn:sha1:b59cc7fcbaebde52ed97f63c6c50e49b8dd5be37</id>
<content type='text'>
Fix typo in xdp_router_ipv4 sample.

Signed-off-by: Deming Wang &lt;wangdeming@inspur.com&gt;
Signed-off-by: Andrii Nakryiko &lt;andrii@kernel.org&gt;
Link: https://lore.kernel.org/bpf/20220927192527.8722-1-wangdeming@inspur.com
</content>
</entry>
<entry>
<title>samples/bpf: Replace blk_account_io_done() with __blk_account_io_done()</title>
<updated>2022-09-21T00:25:59Z</updated>
<author>
<name>Rong Tao</name>
<email>rongtao@cestc.cn</email>
</author>
<published>2022-09-11T13:03:30Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=bc069da65eec7b5113b40432930152c9c1cd7f88'/>
<id>urn:sha1:bc069da65eec7b5113b40432930152c9c1cd7f88</id>
<content type='text'>
Since commit be6bfe36db17 ("block: inline hot paths of blk_account_io_*()")
blk_account_io_*() become inline functions.

Signed-off-by: Rong Tao &lt;rtoax@foxmail.com&gt;
Signed-off-by: Andrii Nakryiko &lt;andrii@kernel.org&gt;
Acked-by: Yonghong Song &lt;yhs@fb.com&gt;
Link: https://lore.kernel.org/bpf/tencent_1CC476835C219FACD84B6715F0D785517E07@qq.com
</content>
</entry>
<entry>
<title>samples/bpf: Reduce syscall overhead in map_perf_test.</title>
<updated>2022-09-05T13:33:05Z</updated>
<author>
<name>Alexei Starovoitov</name>
<email>ast@kernel.org</email>
</author>
<published>2022-09-02T21:10:46Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=89dc8d0c38e0df27e580876a1681a55c686a51ff'/>
<id>urn:sha1:89dc8d0c38e0df27e580876a1681a55c686a51ff</id>
<content type='text'>
Make map_perf_test for preallocated and non-preallocated hash map
spend more time inside bpf program to focus performance analysis
on the speed of update/lookup/delete operations performed by bpf program.

It makes 'perf report' of bpf_mem_alloc look like:
 11.76%  map_perf_test    [k] _raw_spin_lock_irqsave
 11.26%  map_perf_test    [k] htab_map_update_elem
  9.70%  map_perf_test    [k] _raw_spin_lock
  9.47%  map_perf_test    [k] htab_map_delete_elem
  8.57%  map_perf_test    [k] memcpy_erms
  5.58%  map_perf_test    [k] alloc_htab_elem
  4.09%  map_perf_test    [k] __htab_map_lookup_elem
  3.44%  map_perf_test    [k] syscall_exit_to_user_mode
  3.13%  map_perf_test    [k] lookup_nulls_elem_raw
  3.05%  map_perf_test    [k] migrate_enable
  3.04%  map_perf_test    [k] memcmp
  2.67%  map_perf_test    [k] unit_free
  2.39%  map_perf_test    [k] lookup_elem_raw

Reduce default iteration count as well to make 'map_perf_test' quick enough
even on debug kernels.

Signed-off-by: Alexei Starovoitov &lt;ast@kernel.org&gt;
Signed-off-by: Daniel Borkmann &lt;daniel@iogearbox.net&gt;
Acked-by: Kumar Kartikeya Dwivedi &lt;memxor@gmail.com&gt;
Acked-by: Andrii Nakryiko &lt;andrii@kernel.org&gt;
Link: https://lore.kernel.org/bpf/20220902211058.60789-5-alexei.starovoitov@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.zx2c4.com/linux-dev/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>samples: bpf: Replace sizeof(arr)/sizeof(arr[0]) with ARRAY_SIZE</title>
<updated>2022-07-14T04:43:52Z</updated>
<author>
<name>Linkui Xiao</name>
<email>xiaolinkui@kylinos.cn</email>
</author>
<published>2022-07-12T07:23:02Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=b1fc28b338860b6c06a7a5881005a1ca9b108ba2'/>
<id>urn:sha1:b1fc28b338860b6c06a7a5881005a1ca9b108ba2</id>
<content type='text'>
The ARRAY_SIZE macro is more compact and more formal in linux source.

Signed-off-by: Linkui Xiao &lt;xiaolinkui@kylinos.cn&gt;
Signed-off-by: Andrii Nakryiko &lt;andrii@kernel.org&gt;
Acked-by: Jiri Olsa &lt;jolsa@kernel.org&gt;
Link: https://lore.kernel.org/bpf/20220712072302.13761-1-xiaolinkui@kylinos.cn
</content>
</entry>
<entry>
<title>samples/bpf: Fix xdp_redirect_map egress devmap prog</title>
<updated>2022-07-12T04:14:35Z</updated>
<author>
<name>Jesper Dangaard Brouer</name>
<email>brouer@redhat.com</email>
</author>
<published>2022-07-11T14:04:22Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=49705c4ab324654a7038fc843255140730477e04'/>
<id>urn:sha1:49705c4ab324654a7038fc843255140730477e04</id>
<content type='text'>
LLVM compiler optimized out the memcpy in xdp_redirect_map_egress,
which caused the Ethernet source MAC-addr to always be zero
when enabling the devmap egress prog via cmdline --load-egress.

Issue observed with LLVM version 14.0.0
 - Shipped with Fedora 36 on target: x86_64-redhat-linux-gnu.

In verbose mode print the source MAC-addr in case xdp_devmap_attached
mode is used.

Signed-off-by: Jesper Dangaard Brouer &lt;brouer@redhat.com&gt;
Signed-off-by: Andrii Nakryiko &lt;andrii@kernel.org&gt;
Link: https://lore.kernel.org/bpf/165754826292.575614.5636444052787717159.stgit@firesoul
</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.zx2c4.com/linux-dev/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: fixup some tools to be able to support xdp multibuffer</title>
<updated>2022-06-22T01:55:53Z</updated>
<author>
<name>Andy Gospodarek</name>
<email>andrew.gospodarek@broadcom.com</email>
</author>
<published>2022-06-21T17:54:02Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=772251742262bd651529a3cea3ee756b71e95a29'/>
<id>urn:sha1:772251742262bd651529a3cea3ee756b71e95a29</id>
<content type='text'>
This changes the section name for the bpf program embedded in these
files to "xdp.frags" to allow the programs to be loaded on drivers that
are using an MTU greater than PAGE_SIZE.  Rather than directly accessing
the buffers, the packet data is now accessed via xdp helper functions to
provide an example for those who may need to write more complex
programs.

v2: remove new unnecessary variable

Signed-off-by: Andy Gospodarek &lt;gospo@broadcom.com&gt;
Acked-by: John Fastabend &lt;john.fastabend@gmail.com&gt;
Acked-by: Lorenzo Bianconi &lt;lorenzo@kernel.org&gt;
Link: https://lore.kernel.org/r/20220621175402.35327-1-gospo@broadcom.com
Signed-off-by: Alexei Starovoitov &lt;ast@kernel.org&gt;
</content>
</entry>
<entry>
<title>samples/bpf: Check detach prog exist or not in xdp_fwd</title>
<updated>2022-06-16T00:26:20Z</updated>
<author>
<name>Zhengchao Shao</name>
<email>shaozhengchao@huawei.com</email>
</author>
<published>2022-06-06T00:54:25Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=de5bb43826dd5326ade7158fc45bca0b9c0d927d'/>
<id>urn:sha1:de5bb43826dd5326ade7158fc45bca0b9c0d927d</id>
<content type='text'>
Before detach the prog, we should check detach prog exist or not.

Signed-off-by: Zhengchao Shao &lt;shaozhengchao@huawei.com&gt;
Signed-off-by: Andrii Nakryiko &lt;andrii@kernel.org&gt;
Reviewed-by: Toke Høiland-Jørgensen &lt;toke@redhat.com&gt;
Link: https://lore.kernel.org/bpf/20220606005425.261967-1-shaozhengchao@huawei.com
</content>
</entry>
<entry>
<title>sample: bpf: xdp_router_ipv4: Allow the kernel to send arp requests</title>
<updated>2022-06-02T23:26:54Z</updated>
<author>
<name>Lorenzo Bianconi</name>
<email>lorenzo@kernel.org</email>
</author>
<published>2022-05-25T09:44:27Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=200a89e3e88786b52bc1dd5f26a310c097f4c6a7'/>
<id>urn:sha1:200a89e3e88786b52bc1dd5f26a310c097f4c6a7</id>
<content type='text'>
Forward the packet to the kernel if the gw router mac address is missing
in to trigger ARP discovery.

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: Andrii Nakryiko &lt;andrii@kernel.org&gt;
Link: https://lore.kernel.org/bpf/60bde5496d108089080504f58199bcf1143ea938.1653471558.git.lorenzo@kernel.org
</content>
</entry>
</feed>
