<feed xmlns='http://www.w3.org/2005/Atom'>
<title>wireguard-linux/samples/bpf/xdpsock_user.c, branch jd/unified-crypt-queue</title>
<subtitle>WireGuard for the Linux kernel</subtitle>
<id>https://git.zx2c4.com/wireguard-linux/atom/samples/bpf/xdpsock_user.c?h=jd%2Funified-crypt-queue</id>
<link rel='self' href='https://git.zx2c4.com/wireguard-linux/atom/samples/bpf/xdpsock_user.c?h=jd%2Funified-crypt-queue'/>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/wireguard-linux/'/>
<updated>2020-02-05T21:06:09Z</updated>
<entry>
<title>samples: bpf: Allow for -ENETDOWN in xdpsock</title>
<updated>2020-02-05T21:06:09Z</updated>
<author>
<name>Maciej Fijalkowski</name>
<email>maciej.fijalkowski@intel.com</email>
</author>
<published>2020-02-05T04:58:34Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/wireguard-linux/commit/?id=8ed47e140867a6e7d56170f325c8d4fdee6d6b66'/>
<id>urn:sha1:8ed47e140867a6e7d56170f325c8d4fdee6d6b66</id>
<content type='text'>
ndo_xsk_wakeup() can return -ENETDOWN and there's no particular reason
to bail the whole application out on that case. Let's check in kick_tx()
whether errno was set to mentioned value and basically allow application
to further process frames.

Fixes: 248c7f9c0e21 ("samples/bpf: convert xdpsock to use libbpf for AF_XDP access")
Reported-by: Cameron Elliott &lt;cameron@cameronelliott.com&gt;
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/20200205045834.56795-4-maciej.fijalkowski@intel.com
</content>
</entry>
<entry>
<title>samples: bpf: Drop doubled variable declaration in xdpsock</title>
<updated>2020-02-05T21:06:09Z</updated>
<author>
<name>Maciej Fijalkowski</name>
<email>maciej.fijalkowski@intel.com</email>
</author>
<published>2020-02-05T04:58:33Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/wireguard-linux/commit/?id=32c92c15ad3dca6f7cca8643766ad79fa3ab3d17'/>
<id>urn:sha1:32c92c15ad3dca6f7cca8643766ad79fa3ab3d17</id>
<content type='text'>
Seems that by accident there is a doubled declaration of global variable
opt_xdp_bind_flags in xdpsock_user.c. The second one is uninitialized so
compiler was simply ignoring it.

To keep things clean, drop the doubled variable.

Fixes: c543f5469822 ("samples/bpf: add unaligned chunks mode support to xdpsock")
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/20200205045834.56795-3-maciej.fijalkowski@intel.com
</content>
</entry>
<entry>
<title>samples/bpf: Use consistent include paths for libbpf</title>
<updated>2020-01-21T00:37:45Z</updated>
<author>
<name>Toke Høiland-Jørgensen</name>
<email>toke@redhat.com</email>
</author>
<published>2020-01-20T13:06:49Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/wireguard-linux/commit/?id=7cf245a37ef013b2c1c5ca7ae25061de2ba7ad01'/>
<id>urn:sha1:7cf245a37ef013b2c1c5ca7ae25061de2ba7ad01</id>
<content type='text'>
Fix all files in samples/bpf to include libbpf header files with the bpf/
prefix, to be consistent with external users of the library. Also ensure
that all includes of exported libbpf header files (those that are exported
on 'make install' of the library) use bracketed includes instead of quoted.

To make sure no new files are introduced that doesn't include the bpf/
prefix in its include, remove tools/lib/bpf from the include path entirely,
and use tools/lib instead.

Fixes: 6910d7d3867a ("selftests/bpf: Ensure bpf_helper_defs.h are taken from selftests dir")
Signed-off-by: Toke Høiland-Jørgensen &lt;toke@redhat.com&gt;
Signed-off-by: Alexei Starovoitov &lt;ast@kernel.org&gt;
Acked-by: Jesper Dangaard Brouer &lt;brouer@redhat.com&gt;
Acked-by: Andrii Nakryiko &lt;andriin@fb.com&gt;
Link: https://lore.kernel.org/bpf/157952560911.1683545.8795966751309534150.stgit@toke.dk
</content>
</entry>
<entry>
<title>samples/bpf: xdpsock: Add option to specify transmit fill pattern</title>
<updated>2019-12-21T00:10:39Z</updated>
<author>
<name>Jay Jayatheerthan</name>
<email>jay.jayatheerthan@intel.com</email>
</author>
<published>2019-12-20T08:55:30Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/wireguard-linux/commit/?id=46e3268eaaca9f8a0f145872b96fe6d54a232890'/>
<id>urn:sha1:46e3268eaaca9f8a0f145872b96fe6d54a232890</id>
<content type='text'>
The UDP payload fill pattern can be specified using '-P' or '--tx-pkt-pattern'
option. It is an unsigned 32 bit field and defaulted to 0x12345678.

The IP and UDP checksum is calculated by the code as per the content of
the packet before transmission.

Signed-off-by: Jay Jayatheerthan &lt;jay.jayatheerthan@intel.com&gt;
Signed-off-by: Alexei Starovoitov &lt;ast@kernel.org&gt;
Link: https://lore.kernel.org/bpf/20191220085530.4980-7-jay.jayatheerthan@intel.com
</content>
</entry>
<entry>
<title>samples/bpf: xdpsock: Add option to specify tx packet size</title>
<updated>2019-12-21T00:10:39Z</updated>
<author>
<name>Jay Jayatheerthan</name>
<email>jay.jayatheerthan@intel.com</email>
</author>
<published>2019-12-20T08:55:29Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/wireguard-linux/commit/?id=4a3c23ae3acc6185a9d418830f22672a52ff986a'/>
<id>urn:sha1:4a3c23ae3acc6185a9d418830f22672a52ff986a</id>
<content type='text'>
New option '-s' or '--tx-pkt-size' has been added to specify the transmit
packet size. The packet size ranges from 47 to 4096 bytes. When this
option is not provided, it defaults to 64 byte packet.

The code uses struct ethhdr, struct iphdr and struct udphdr to form the
transmit packet. The MAC address, IP address and UDP ports are set to default
values.

The code calculates IP and UDP checksums before sending the packet.
Checksum calculation code in Linux kernel is used for this purpose.
The Ethernet FCS is not filled by the code.

Signed-off-by: Jay Jayatheerthan &lt;jay.jayatheerthan@intel.com&gt;
Signed-off-by: Alexei Starovoitov &lt;ast@kernel.org&gt;
Link: https://lore.kernel.org/bpf/20191220085530.4980-6-jay.jayatheerthan@intel.com
</content>
</entry>
<entry>
<title>samples/bpf: xdpsock: Add option to specify number of packets to send</title>
<updated>2019-12-21T00:10:39Z</updated>
<author>
<name>Jay Jayatheerthan</name>
<email>jay.jayatheerthan@intel.com</email>
</author>
<published>2019-12-20T08:55:28Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/wireguard-linux/commit/?id=ece6e9694751a4f0b99372724a0705a0217132b3'/>
<id>urn:sha1:ece6e9694751a4f0b99372724a0705a0217132b3</id>
<content type='text'>
Use '-C' or '--tx-pkt-count' to specify number of packets to send.
If it is not specified, the application sends packets forever. If packet
count is not a multiple of batch size, last batch sent is less than the
batch size.

Signed-off-by: Jay Jayatheerthan &lt;jay.jayatheerthan@intel.com&gt;
Signed-off-by: Alexei Starovoitov &lt;ast@kernel.org&gt;
Link: https://lore.kernel.org/bpf/20191220085530.4980-5-jay.jayatheerthan@intel.com
</content>
</entry>
<entry>
<title>samples/bpf: xdpsock: Add option to specify batch size</title>
<updated>2019-12-21T00:10:39Z</updated>
<author>
<name>Jay Jayatheerthan</name>
<email>jay.jayatheerthan@intel.com</email>
</author>
<published>2019-12-20T08:55:27Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/wireguard-linux/commit/?id=cd9e72b6f21044b36a096833003811c2b2038455'/>
<id>urn:sha1:cd9e72b6f21044b36a096833003811c2b2038455</id>
<content type='text'>
New option to specify batch size for tx, rx and l2fwd has been added. This
allows fine tuning to maximize performance. It is specified using '-b' or
'--batch_size' options. When not specified default is 64.

Signed-off-by: Jay Jayatheerthan &lt;jay.jayatheerthan@intel.com&gt;
Signed-off-by: Alexei Starovoitov &lt;ast@kernel.org&gt;
Link: https://lore.kernel.org/bpf/20191220085530.4980-4-jay.jayatheerthan@intel.com
</content>
</entry>
<entry>
<title>samples/bpf: xdpsock: Use common code to handle signal and main exit</title>
<updated>2019-12-21T00:10:39Z</updated>
<author>
<name>Jay Jayatheerthan</name>
<email>jay.jayatheerthan@intel.com</email>
</author>
<published>2019-12-20T08:55:26Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/wireguard-linux/commit/?id=695255882bdf63da240db33d0f2aa9ccca1cbe67'/>
<id>urn:sha1:695255882bdf63da240db33d0f2aa9ccca1cbe67</id>
<content type='text'>
Add code to do cleanup for signals and application completion in a unified
fashion. The signal handler sets benckmark_done flag terminating the
threads. The cleanup is called before returning from main() function.

Signed-off-by: Jay Jayatheerthan &lt;jay.jayatheerthan@intel.com&gt;
Signed-off-by: Alexei Starovoitov &lt;ast@kernel.org&gt;
Link: https://lore.kernel.org/bpf/20191220085530.4980-3-jay.jayatheerthan@intel.com
</content>
</entry>
<entry>
<title>samples/bpf: xdpsock: Add duration option to specify how long to run</title>
<updated>2019-12-21T00:10:39Z</updated>
<author>
<name>Jay Jayatheerthan</name>
<email>jay.jayatheerthan@intel.com</email>
</author>
<published>2019-12-20T08:55:25Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/wireguard-linux/commit/?id=d3f11b018f6ce278e683008e9c225fe87afc532d'/>
<id>urn:sha1:d3f11b018f6ce278e683008e9c225fe87afc532d</id>
<content type='text'>
The application now supports '-d' or '--duration' option to specify number of
seconds to run. This is used in tx, rx and l2fwd features. If this option is
not provided, the application runs forever.

Signed-off-by: Jay Jayatheerthan &lt;jay.jayatheerthan@intel.com&gt;
Signed-off-by: Alexei Starovoitov &lt;ast@kernel.org&gt;
Link: https://lore.kernel.org/bpf/20191220085530.4980-2-jay.jayatheerthan@intel.com
</content>
</entry>
<entry>
<title>samples/bpf: Attach XDP programs in driver mode by default</title>
<updated>2019-12-16T15:05:38Z</updated>
<author>
<name>Toke Høiland-Jørgensen</name>
<email>toke@redhat.com</email>
</author>
<published>2019-12-16T11:07:42Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/wireguard-linux/commit/?id=d50ecc46d18fa19ccf06e0c4d2ee8a050c665e3d'/>
<id>urn:sha1:d50ecc46d18fa19ccf06e0c4d2ee8a050c665e3d</id>
<content type='text'>
When attaching XDP programs, userspace can set flags to request the attach
mode (generic/SKB mode, driver mode or hw offloaded mode). If no such flags
are requested, the kernel will attempt to attach in driver mode, and then
silently fall back to SKB mode if this fails.

The silent fallback is a major source of user confusion, as users will try
to load a program on a device without XDP support, and instead of an error
they will get the silent fallback behaviour, not notice, and then wonder
why performance is not what they were expecting.

In an attempt to combat this, let's switch all the samples to default to
explicitly requesting driver-mode attach. As part of this, ensure that all
the userspace utilities have a switch to enable SKB mode. For those that
have a switch to request driver mode, keep it but turn it into a no-op.

Signed-off-by: Toke Høiland-Jørgensen &lt;toke@redhat.com&gt;
Signed-off-by: Alexei Starovoitov &lt;ast@kernel.org&gt;
Acked-by: Jesper Dangaard Brouer &lt;brouer@redhat.com&gt;
Acked-by: David Ahern &lt;dsahern@gmail.com&gt;
Link: https://lore.kernel.org/bpf/20191216110742.364456-1-toke@redhat.com
</content>
</entry>
</feed>
