<feed xmlns='http://www.w3.org/2005/Atom'>
<title>starfive-tech/linux.git/samples/bpf, branch visionfive_v1_5.13</title>
<subtitle>StarFive Tech Linux Kernel for VisionFive (JH7110) boards (mirror)</subtitle>
<id>https://git.radix-linux.su/starfive-tech/linux.git/atom?h=visionfive_v1_5.13</id>
<link rel='self' href='https://git.radix-linux.su/starfive-tech/linux.git/atom?h=visionfive_v1_5.13'/>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/starfive-tech/linux.git/'/>
<updated>2021-07-28T12:37:21+00:00</updated>
<entry>
<title>bpf, samples: Fix xdpsock with '-M' parameter missing unload process</title>
<updated>2021-07-28T12:37:21+00:00</updated>
<author>
<name>Wang Hai</name>
<email>wanghai38@huawei.com</email>
</author>
<published>2021-06-28T09:18:15+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/starfive-tech/linux.git/commit/?id=08d21fa872ec8ceb0054f224e1bf8cd764622928'/>
<id>urn:sha1:08d21fa872ec8ceb0054f224e1bf8cd764622928</id>
<content type='text'>
[ Upstream commit 2620e92ae6ed83260eb46d214554cd308ee35d92 ]

Execute the following command and exit, then execute it again, the following
error will be reported:

  $ sudo ./samples/bpf/xdpsock -i ens4f2 -M
  ^C
  $ sudo ./samples/bpf/xdpsock -i ens4f2 -M
  libbpf: elf: skipping unrecognized data section(16) .eh_frame
  libbpf: elf: skipping relo section(17) .rel.eh_frame for section(16) .eh_frame
  libbpf: Kernel error message: XDP program already attached
  ERROR: link set xdp fd failed

Commit c9d27c9e8dc7 ("samples: bpf: Do not unload prog within xdpsock") removed
the unloading prog code because of the presence of bpf_link. This is fine if
XDP_SHARED_UMEM is disabled, but if it is enabled, unloading the prog is still
needed.

Fixes: c9d27c9e8dc7 ("samples: bpf: Do not unload prog within xdpsock")
Signed-off-by: Wang Hai &lt;wanghai38@huawei.com&gt;
Signed-off-by: Daniel Borkmann &lt;daniel@iogearbox.net&gt;
Acked-by: Magnus Karlsson &lt;magnus.karlsson@intel.com&gt;
Cc: Maciej Fijalkowski &lt;maciej.fijalkowski@intel.com&gt;
Link: https://lore.kernel.org/bpf/20210628091815.2373487-1-wanghai38@huawei.com
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>samples/bpf: Fix the error return code of xdp_redirect's main()</title>
<updated>2021-07-14T15:07:08+00:00</updated>
<author>
<name>Wang Hai</name>
<email>wanghai38@huawei.com</email>
</author>
<published>2021-06-16T04:25:34+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/starfive-tech/linux.git/commit/?id=a00c9faf7efa106a69a67408dd83dbc962887351'/>
<id>urn:sha1:a00c9faf7efa106a69a67408dd83dbc962887351</id>
<content type='text'>
[ Upstream commit 7c6090ee2a7b3315410cfc83a94c3eb057407b25 ]

Fix to return a negative error code from the error handling
case instead of 0, as done elsewhere in this function.

If bpf_map_update_elem() failed, main() should return a negative error.

Fixes: 832622e6bd18 ("xdp: sample program for new bpf_redirect helper")
Signed-off-by: Wang Hai &lt;wanghai38@huawei.com&gt;
Signed-off-by: Andrii Nakryiko &lt;andrii@kernel.org&gt;
Link: https://lore.kernel.org/bpf/20210616042534.315097-1-wanghai38@huawei.com
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>samples/bpf: Fix Segmentation fault for xdp_redirect command</title>
<updated>2021-07-14T15:07:08+00:00</updated>
<author>
<name>Wang Hai</name>
<email>wanghai38@huawei.com</email>
</author>
<published>2021-06-16T04:23:24+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/starfive-tech/linux.git/commit/?id=9abfeb4e2c5fd54497d9f97d1c87ef78db51d1e7'/>
<id>urn:sha1:9abfeb4e2c5fd54497d9f97d1c87ef78db51d1e7</id>
<content type='text'>
[ Upstream commit 85102ba58b4125ebad941d7555c3c248b23efd16 ]

A Segmentation fault error is caused when the following command
is executed.

$ sudo ./samples/bpf/xdp_redirect lo
Segmentation fault

This command is missing a device &lt;IFNAME|IFINDEX&gt; as an argument, resulting
in out-of-bounds access from argv.

If the number of devices for the xdp_redirect parameter is not 2,
we should report an error and exit.

Fixes: 24251c264798 ("samples/bpf: add option for native and skb mode for redirect apps")
Signed-off-by: Wang Hai &lt;wanghai38@huawei.com&gt;
Signed-off-by: Andrii Nakryiko &lt;andrii@kernel.org&gt;
Link: https://lore.kernel.org/bpf/20210616042324.314832-1-wanghai38@huawei.com
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>samples/bpf: Consider frame size in tx_only of xdpsock sample</title>
<updated>2021-05-06T23:19:55+00:00</updated>
<author>
<name>Magnus Karlsson</name>
<email>magnus.karlsson@intel.com</email>
</author>
<published>2021-05-06T12:43:49+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/starfive-tech/linux.git/commit/?id=3b80d106e110d39d3f678954d3b55078669cf07e'/>
<id>urn:sha1:3b80d106e110d39d3f678954d3b55078669cf07e</id>
<content type='text'>
Fix the tx_only micro-benchmark in xdpsock to take frame size into
consideration. It was hardcoded to the default value of frame_size
which is 4K. Changing this on the command line to 2K made half of the
packets illegal as they were outside the umem and were therefore
discarded by the kernel.

Fixes: 46738f73ea4f ("samples/bpf: add use of need_wakeup flag in xdpsock")
Signed-off-by: Magnus Karlsson &lt;magnus.karlsson@intel.com&gt;
Signed-off-by: Daniel Borkmann &lt;daniel@iogearbox.net&gt;
Acked-by: Maciej Fijalkowski &lt;maciej.fijalkowski@intel.com&gt;
Link: https://lore.kernel.org/bpf/20210506124349.6666-1-magnus.karlsson@gmail.com
</content>
</entry>
<entry>
<title>samples/bpf: Fix broken tracex1 due to kprobe argument change</title>
<updated>2021-04-20T01:19:49+00:00</updated>
<author>
<name>Yaqi Chen</name>
<email>chendotjs@gmail.com</email>
</author>
<published>2021-04-16T15:48:03+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/starfive-tech/linux.git/commit/?id=137733d08f4ab14a354dacaa9a8fc35217747605'/>
<id>urn:sha1:137733d08f4ab14a354dacaa9a8fc35217747605</id>
<content type='text'>
&gt;From commit c0bbbdc32feb ("__netif_receive_skb_core: pass skb by
reference"), the first argument passed into __netif_receive_skb_core
has changed to reference of a skb pointer.

This commit fixes by using bpf_probe_read_kernel.

Signed-off-by: Yaqi Chen &lt;chendotjs@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/20210416154803.37157-1-chendotjs@gmail.com
</content>
</entry>
<entry>
<title>samples: bpf: Do not unload prog within xdpsock</title>
<updated>2021-03-30T16:24:39+00:00</updated>
<author>
<name>Maciej Fijalkowski</name>
<email>maciej.fijalkowski@intel.com</email>
</author>
<published>2021-03-29T22:43:06+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/starfive-tech/linux.git/commit/?id=c9d27c9e8dc7ccced65007a4d5d3640cad42adfc'/>
<id>urn:sha1:c9d27c9e8dc7ccced65007a4d5d3640cad42adfc</id>
<content type='text'>
With the introduction of bpf_link in xsk's libbpf part, there's no
further need for explicit unload of prog on xdpsock's termination. When
process dies, the bpf_link's refcount will be decremented and resources
will be unloaded/freed under the hood in case when there are no more
active users.

While at it, don't dump stats on error path.

Signed-off-by: Maciej Fijalkowski &lt;maciej.fijalkowski@intel.com&gt;
Signed-off-by: Alexei Starovoitov &lt;ast@kernel.org&gt;
Link: https://lore.kernel.org/bpf/20210329224316.17793-8-maciej.fijalkowski@intel.com
</content>
</entry>
<entry>
<title>bpf: Remove unused headers</title>
<updated>2021-03-26T05:03:46+00:00</updated>
<author>
<name>Lu Wei</name>
<email>luwei32@huawei.com</email>
</author>
<published>2021-03-24T08:31:47+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/starfive-tech/linux.git/commit/?id=b0c407ec503b8e97bbffd65cc4bed39e008c192f'/>
<id>urn:sha1:b0c407ec503b8e97bbffd65cc4bed39e008c192f</id>
<content type='text'>
The header &lt;linux/version.h&gt; is useless in sampleip_kern.c
and trace_event_kern.c, remove it.

Signed-off-by: Lu Wei &lt;luwei32@huawei.com&gt;
Signed-off-by: Andrii Nakryiko &lt;andrii@kernel.org&gt;
Link: https://lore.kernel.org/bpf/20210324083147.149278-1-luwei32@huawei.com
</content>
</entry>
<entry>
<title>samples: bpf: Fix a spelling typo in do_hbm_test.sh</title>
<updated>2021-03-16T05:17:35+00:00</updated>
<author>
<name>Masanari Iida</name>
<email>standby24x7@gmail.com</email>
</author>
<published>2021-03-15T12:44:54+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/starfive-tech/linux.git/commit/?id=d94436a5d1a0ac8bcad29eb6735384940ae15603'/>
<id>urn:sha1:d94436a5d1a0ac8bcad29eb6735384940ae15603</id>
<content type='text'>
This patch fixes a spelling typo in do_hbm_test.sh

Signed-off-by: Masanari Iida &lt;standby24x7@gmail.com&gt;
Signed-off-by: Andrii Nakryiko &lt;andrii@kernel.org&gt;
Link: https://lore.kernel.org/bpf/20210315124454.1744594-1-standby24x7@gmail.com
</content>
</entry>
<entry>
<title>samples, bpf: Add missing munmap in xdpsock</title>
<updated>2021-03-04T14:53:32+00:00</updated>
<author>
<name>Maciej Fijalkowski</name>
<email>maciej.fijalkowski@intel.com</email>
</author>
<published>2021-03-03T18:56:35+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/starfive-tech/linux.git/commit/?id=6bc6699881012b5bd5d49fa861a69a37fc01b49c'/>
<id>urn:sha1:6bc6699881012b5bd5d49fa861a69a37fc01b49c</id>
<content type='text'>
We mmap the umem region, but we never munmap it.
Add the missing call at the end of the cleanup.

Fixes: 3945b37a975d ("samples/bpf: use hugepages in xdpsock app")
Signed-off-by: Maciej Fijalkowski &lt;maciej.fijalkowski@intel.com&gt;
Signed-off-by: Daniel Borkmann &lt;daniel@iogearbox.net&gt;
Acked-by: Björn Töpel &lt;bjorn.topel@intel.com&gt;
Link: https://lore.kernel.org/bpf/20210303185636.18070-3-maciej.fijalkowski@intel.com
</content>
</entry>
<entry>
<title>samples: bpf: Remove unneeded semicolon</title>
<updated>2021-02-03T05:37:59+00:00</updated>
<author>
<name>Yang Li</name>
<email>yang.lee@linux.alibaba.com</email>
</author>
<published>2021-02-03T03:17:28+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/starfive-tech/linux.git/commit/?id=1132b9987a3f6c7c396633d5a675075911f1ce32'/>
<id>urn:sha1:1132b9987a3f6c7c396633d5a675075911f1ce32</id>
<content type='text'>
Eliminate the following coccicheck warning:
./samples/bpf/cookie_uid_helper_example.c:316:3-4: Unneeded semicolon

Reported-by: Abaci Robot &lt;abaci@linux.alibaba.com&gt;
Signed-off-by: Yang Li &lt;yang.lee@linux.alibaba.com&gt;
Signed-off-by: Andrii Nakryiko &lt;andrii@kernel.org&gt;
Link: https://lore.kernel.org/bpf/1612322248-35398-1-git-send-email-yang.lee@linux.alibaba.com
</content>
</entry>
</feed>
