<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/samples/bpf/xdpsock_user.c, branch linux-5.1.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.</subtitle>
<id>https://universe.0xinfinity.dev/distro/kernel/atom?h=linux-5.1.y</id>
<link rel='self' href='https://universe.0xinfinity.dev/distro/kernel/atom?h=linux-5.1.y'/>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/'/>
<updated>2019-03-02T00:07:10Z</updated>
<entry>
<title>samples/bpf: silence compiler warning for xdpsock_user.c</title>
<updated>2019-03-02T00:07:10Z</updated>
<author>
<name>Yonghong Song</name>
<email>yhs@fb.com</email>
</author>
<published>2019-03-01T06:19:41Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=b74e21ab7d438117a10d2d331bdfc275fcab2970'/>
<id>urn:sha1:b74e21ab7d438117a10d2d331bdfc275fcab2970</id>
<content type='text'>
Compiling xdpsock_user.c with 4.8.5, I hit the following
compilation warning:
    HOSTCC  samples/bpf/xdpsock_user.o
  /data/users/yhs/work/net-next/samples/bpf/xdpsock_user.c: In function ‘main’:
  /data/users/yhs/work/net-next/samples/bpf/xdpsock_user.c:449:6: warning: ‘idx_cq’ may be used unini
  tialized in this function [-Wmaybe-uninitialized]
    u32 idx_cq, idx_fq;
        ^
  /data/users/yhs/work/net-next/samples/bpf/xdpsock_user.c:606:7: warning: ‘idx_rx’ may be used unini
  tialized in this function [-Wmaybe-uninitialized]
     u32 idx_rx, idx_tx = 0;
         ^
  /data/users/yhs/work/net-next/samples/bpf/xdpsock_user.c:506:6: warning: ‘idx_rx’ may be used unini
  tialized in this function [-Wmaybe-uninitialized]
    u32 idx_rx, idx_fq = 0;

As an example, the code pattern looks like:
    u32 idx_cq;
    ...
    ret = xsk_ring_prod__reserve(&amp;xsk-&gt;umem-&gt;fq, rcvd, &amp;idx_fq);
    if (ret) {
      ...
    }
    ... idx_fq ...
The compiler warns since it does not know whether &amp;idx_fq is assigned
or not inside the library function xsk_ring_prod__reserve().

Let us assign an initial value 0 to such auto variables to silence
compiler warning.

Fixes: 248c7f9c0e21 ("samples/bpf: convert xdpsock to use libbpf for AF_XDP access")
Signed-off-by: Yonghong Song &lt;yhs@fb.com&gt;
Acked-by: Jonathan Lemon &lt;jonathan.lemon@gmail.com&gt;
Acked-by: Song Liu &lt;songliubraving@fb.com&gt;
Signed-off-by: Daniel Borkmann &lt;daniel@iogearbox.net&gt;
</content>
</entry>
<entry>
<title>samples/bpf: convert xdpsock to use libbpf for AF_XDP access</title>
<updated>2019-02-25T22:21:42Z</updated>
<author>
<name>Magnus Karlsson</name>
<email>magnus.karlsson@intel.com</email>
</author>
<published>2019-02-21T09:21:27Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=248c7f9c0e215fcfd847bd3a41cf0160a2359e1a'/>
<id>urn:sha1:248c7f9c0e215fcfd847bd3a41cf0160a2359e1a</id>
<content type='text'>
This commit converts the xdpsock sample application to use the AF_XDP
functions present in libbpf. This cuts down the size of it by nearly
300 lines of code.

The default ring sizes plus the batch size has been increased and the
size of the umem area has decreased. This so that the sample application
will provide higher throughput. Note also that the shared umem code
has been removed from the sample as this is not supported by libbpf
at this point in time.

Tested-by: Björn Töpel &lt;bjorn.topel@intel.com&gt;
Signed-off-by: Magnus Karlsson &lt;magnus.karlsson@intel.com&gt;
Signed-off-by: Daniel Borkmann &lt;daniel@iogearbox.net&gt;
</content>
</entry>
<entry>
<title>samples/bpf: Check the prog id before exiting</title>
<updated>2019-02-01T22:37:51Z</updated>
<author>
<name>Maciej Fijalkowski</name>
<email>maciejromanfijalkowski@gmail.com</email>
</author>
<published>2019-02-01T21:42:30Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=3b7a8ec2dec3e408288dbc80b8aef25df20ba119'/>
<id>urn:sha1:3b7a8ec2dec3e408288dbc80b8aef25df20ba119</id>
<content type='text'>
Check the program id within the signal handler on polling xdp samples
that were previously converted to libbpf usage. Avoid the situation of
unloading the program that was not attached by sample that is exiting.
Handle also the case where bpf_get_link_xdp_id didn't exit with an error
but the xdp program was not found on an interface.

Reported-by: Michal Papaj &lt;michal.papaj@intel.com&gt;
Reported-by: Jakub Spizewski &lt;jakub.spizewski@intel.com&gt;
Signed-off-by: Maciej Fijalkowski &lt;maciej.fijalkowski@intel.com&gt;
Reviewed-by: Jakub Kicinski &lt;jakub.kicinski@netronome.com&gt;
Signed-off-by: Daniel Borkmann &lt;daniel@iogearbox.net&gt;
</content>
</entry>
<entry>
<title>samples/bpf: Add a "force" flag to XDP samples</title>
<updated>2019-02-01T22:37:51Z</updated>
<author>
<name>Maciej Fijalkowski</name>
<email>maciejromanfijalkowski@gmail.com</email>
</author>
<published>2019-02-01T21:42:28Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=743e568c15860d4061202f73214c106a5bb0890b'/>
<id>urn:sha1:743e568c15860d4061202f73214c106a5bb0890b</id>
<content type='text'>
Make xdp samples consistent with iproute2 behavior and set the
XDP_FLAGS_UPDATE_IF_NOEXIST by default when setting the xdp program on
interface. Provide an option for user to force the program loading,
which as a result will not include the mentioned flag in
bpf_set_link_xdp_fd call.

Signed-off-by: Maciej Fijalkowski &lt;maciej.fijalkowski@intel.com&gt;
Reviewed-by: Jakub Kicinski &lt;jakub.kicinski@netronome.com&gt;
Acked-by: John Fastabend &lt;john.fastabend@gmail.com&gt;
Signed-off-by: Daniel Borkmann &lt;daniel@iogearbox.net&gt;
</content>
</entry>
<entry>
<title>samples/bpf: xdpsock, minor fixes</title>
<updated>2018-08-31T23:36:08Z</updated>
<author>
<name>Prashant Bhole</name>
<email>bhole_prashant_q7@lab.ntt.co.jp</email>
</author>
<published>2018-08-31T01:00:49Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=11c3f5113600c40cc8789f9a7023e02b73cb0ca7'/>
<id>urn:sha1:11c3f5113600c40cc8789f9a7023e02b73cb0ca7</id>
<content type='text'>
- xsks_map size was fixed to 4, changed it MAX_SOCKS
- Remove redundant definition of MAX_SOCKS in xdpsock_user.c
- In dump_stats(), add NULL check for xsks[i]

Signed-off-by: Prashant Bhole &lt;bhole_prashant_q7@lab.ntt.co.jp&gt;
Acked-by: Björn Töpel &lt;bjorn.topel@intel.com&gt;
Signed-off-by: Daniel Borkmann &lt;daniel@iogearbox.net&gt;
</content>
</entry>
<entry>
<title>samples/bpf: add -c/--copy -z/--zero-copy flags to xdpsock</title>
<updated>2018-08-29T19:25:53Z</updated>
<author>
<name>Björn Töpel</name>
<email>bjorn.topel@intel.com</email>
</author>
<published>2018-08-28T12:44:35Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=58c50ae4a0b638ebbcdddf03cfa4fd36f0edeb02'/>
<id>urn:sha1:58c50ae4a0b638ebbcdddf03cfa4fd36f0edeb02</id>
<content type='text'>
The -c/--copy -z/--zero-copy flags enforces either copy or zero-copy
mode.

Signed-off-by: Björn Töpel &lt;bjorn.topel@intel.com&gt;
Signed-off-by: Alexei Starovoitov &lt;ast@kernel.org&gt;
</content>
</entry>
<entry>
<title>samples: bpf: convert xdpsock_user.c to libbpf</title>
<updated>2018-07-27T05:18:44Z</updated>
<author>
<name>Jakub Kicinski</name>
<email>jakub.kicinski@netronome.com</email>
</author>
<published>2018-07-26T21:32:21Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=6748182c2d1850811a577fe060387f83d5fa0fe4'/>
<id>urn:sha1:6748182c2d1850811a577fe060387f83d5fa0fe4</id>
<content type='text'>
Convert xdpsock_user.c to use libbpf instead of bpf_load.o.

Signed-off-by: Jakub Kicinski &lt;jakub.kicinski@netronome.com&gt;
Reviewed-by: Quentin Monnet &lt;quentin.monnet@netronome.com&gt;
Signed-off-by: Daniel Borkmann &lt;daniel@iogearbox.net&gt;
</content>
</entry>
<entry>
<title>samples/bpf: xdpsock: order memory on AArch64</title>
<updated>2018-07-27T01:49:02Z</updated>
<author>
<name>Brian Brooks</name>
<email>brian.brooks@linaro.org</email>
</author>
<published>2018-07-25T21:08:19Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=598135e7444c121f11c8c16495ba1e6ab122678f'/>
<id>urn:sha1:598135e7444c121f11c8c16495ba1e6ab122678f</id>
<content type='text'>
Define u_smp_rmb() and u_smp_wmb() to respective barrier instructions.
This ensures the processor will order accesses to queue indices against
accesses to queue ring entries.

Signed-off-by: Brian Brooks &lt;brian.brooks@linaro.org&gt;
Acked-by: Björn Töpel &lt;bjorn.topel@intel.com&gt;
Signed-off-by: Daniel Borkmann &lt;daniel@iogearbox.net&gt;
</content>
</entry>
<entry>
<title>samples/bpf: deal with EBUSY return code from sendmsg in xdpsock sample</title>
<updated>2018-07-03T01:37:12Z</updated>
<author>
<name>Magnus Karlsson</name>
<email>magnus.karlsson@intel.com</email>
</author>
<published>2018-06-29T07:48:19Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=c03079c9d93d593d44524883b6b6127b21978e22'/>
<id>urn:sha1:c03079c9d93d593d44524883b6b6127b21978e22</id>
<content type='text'>
Sendmsg in the SKB path of AF_XDP can now return EBUSY when a packet
was discarded and completed by the driver. Just ignore this message
in the sample application.

Fixes: b4b8faa1ded7 ("samples/bpf: sample application and documentation for AF_XDP sockets")
Signed-off-by: Magnus Karlsson &lt;magnus.karlsson@intel.com&gt;
Reported-by: Pavel Odintsov &lt;pavel@fastnetmon.com&gt;
Signed-off-by: Alexei Starovoitov &lt;ast@kernel.org&gt;
</content>
</entry>
<entry>
<title>samples/bpf: xdpsock: use skb Tx path for XDP_SKB</title>
<updated>2018-06-05T13:48:57Z</updated>
<author>
<name>Björn Töpel</name>
<email>bjorn.topel@intel.com</email>
</author>
<published>2018-06-04T12:06:01Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=9f5232cc7f040f443f81069f553d31b27ab7eb79'/>
<id>urn:sha1:9f5232cc7f040f443f81069f553d31b27ab7eb79</id>
<content type='text'>
Make sure that XDP_SKB also uses the skb Tx path.

Signed-off-by: Björn Töpel &lt;bjorn.topel@intel.com&gt;
Signed-off-by: Daniel Borkmann &lt;daniel@iogearbox.net&gt;
</content>
</entry>
</feed>
