<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/samples/bpf, branch v6.0</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.0</id>
<link rel='self' href='https://git.shady.money/linux/atom?h=v6.0'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/'/>
<updated>2022-07-15T19:01:30Z</updated>
<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>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.shady.money/linux/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.shady.money/linux/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.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: 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.shady.money/linux/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.shady.money/linux/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.shady.money/linux/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>
<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: Detach xdp prog when program exits unexpectedly in xdp_rxq_info_user</title>
<updated>2022-04-28T02:07:42Z</updated>
<author>
<name>Zhengchao Shao</name>
<email>shaozhengchao@huawei.com</email>
</author>
<published>2022-04-27T06:23:38Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=d1c57439e4f3db0a12259b9978905e92847505b8'/>
<id>urn:sha1:d1c57439e4f3db0a12259b9978905e92847505b8</id>
<content type='text'>
When xdp_rxq_info_user program exits unexpectedly, it doesn't detach xdp
prog of device, and other xdp prog can't be attached to the device. So
call init_exit() to detach xdp prog when program exits unexpectedly.

Signed-off-by: Zhengchao Shao &lt;shaozhengchao@huawei.com&gt;
Signed-off-by: Andrii Nakryiko &lt;andrii@kernel.org&gt;
Link: https://lore.kernel.org/bpf/20220427062338.80173-1-shaozhengchao@huawei.com
</content>
</entry>
<entry>
<title>samples/bpf: Reduce the sampling interval in xdp1_user</title>
<updated>2022-04-20T21:58:29Z</updated>
<author>
<name>Zhengchao Shao</name>
<email>shaozhengchao@huawei.com</email>
</author>
<published>2022-04-19T11:47:46Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=db69264f983a5890fe8ba20ed4c20dfd4b687615'/>
<id>urn:sha1:db69264f983a5890fe8ba20ed4c20dfd4b687615</id>
<content type='text'>
If interval is 2, and sum - prev[key] = 1, the result = 0. This will
mislead the tester that the port has no traffic right now. So reduce the
sampling interval to 1.

Signed-off-by: Zhengchao Shao &lt;shaozhengchao@huawei.com&gt;
Signed-off-by: Andrii Nakryiko &lt;andrii@kernel.org&gt;
Link: https://lore.kernel.org/bpf/20220419114746.291613-1-shaozhengchao@huawei.com
</content>
</entry>
</feed>
