<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/net/xdp/xsk_queue.h, branch linux-5.5.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-5.5.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-5.5.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2019-08-30T23:08:26Z</updated>
<entry>
<title>xsk: add support to allow unaligned chunk placement</title>
<updated>2019-08-30T23:08:26Z</updated>
<author>
<name>Kevin Laatz</name>
</author>
<published>2019-08-27T02:25:22Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=c05cd3645814724bdeb32a2b4d953b12bdea5f8c'/>
<id>urn:sha1:c05cd3645814724bdeb32a2b4d953b12bdea5f8c</id>
<content type='text'>
Currently, addresses are chunk size aligned. This means, we are very
restricted in terms of where we can place chunk within the umem. For
example, if we have a chunk size of 2k, then our chunks can only be placed
at 0,2k,4k,6k,8k... and so on (ie. every 2k starting from 0).

This patch introduces the ability to use unaligned chunks. With these
changes, we are no longer bound to having to place chunks at a 2k (or
whatever your chunk size is) interval. Since we are no longer dealing with
aligned chunks, they can now cross page boundaries. Checks for page
contiguity have been added in order to keep track of which pages are
followed by a physically contiguous page.

Signed-off-by: Kevin Laatz &lt;kevin.laatz@intel.com&gt;
Signed-off-by: Ciara Loftus &lt;ciara.loftus@intel.com&gt;
Signed-off-by: Bruce Richardson &lt;bruce.richardson@intel.com&gt;
Acked-by: Jonathan Lemon &lt;jonathan.lemon@gmail.com&gt;
Signed-off-by: Daniel Borkmann &lt;daniel@iogearbox.net&gt;
</content>
</entry>
<entry>
<title>xsk: add support for need_wakeup flag in AF_XDP rings</title>
<updated>2019-08-17T21:07:32Z</updated>
<author>
<name>Magnus Karlsson</name>
</author>
<published>2019-08-14T07:27:17Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=77cd0d7b3f257fd0e3096b4fdcff1a7d38e99e10'/>
<id>urn:sha1:77cd0d7b3f257fd0e3096b4fdcff1a7d38e99e10</id>
<content type='text'>
This commit adds support for a new flag called need_wakeup in the
AF_XDP Tx and fill rings. When this flag is set, it means that the
application has to explicitly wake up the kernel Rx (for the bit in
the fill ring) or kernel Tx (for bit in the Tx ring) processing by
issuing a syscall. Poll() can wake up both depending on the flags
submitted and sendto() will wake up tx processing only.

The main reason for introducing this new flag is to be able to
efficiently support the case when application and driver is executing
on the same core. Previously, the driver was just busy-spinning on the
fill ring if it ran out of buffers in the HW and there were none on
the fill ring. This approach works when the application is running on
another core as it can replenish the fill ring while the driver is
busy-spinning. Though, this is a lousy approach if both of them are
running on the same core as the probability of the fill ring getting
more entries when the driver is busy-spinning is zero. With this new
feature the driver now sets the need_wakeup flag and returns to the
application. The application can then replenish the fill queue and
then explicitly wake up the Rx processing in the kernel using the
syscall poll(). For Tx, the flag is only set to one if the driver has
no outstanding Tx completion interrupts. If it has some, the flag is
zero as it will be woken up by a completion interrupt anyway.

As a nice side effect, this new flag also improves the performance of
the case where application and driver are running on two different
cores as it reduces the number of syscalls to the kernel. The kernel
tells user space if it needs to be woken up by a syscall, and this
eliminates many of the syscalls.

This flag needs some simple driver support. If the driver does not
support this, the Rx flag is always zero and the Tx flag is always
one. This makes any application relying on this feature default to the
old behaviour of not requiring any syscalls in the Rx path and always
having to call sendto() in the Tx path.

For backwards compatibility reasons, this feature has to be explicitly
turned on using a new bind flag (XDP_USE_NEED_WAKEUP). I recommend
that you always turn it on as it so far always have had a positive
performance impact.

The name and inspiration of the flag has been taken from io_uring by
Jens Axboe. Details about this feature in io_uring can be found in
http://kernel.dk/io_uring.pdf, section 8.3.

Signed-off-by: Magnus Karlsson &lt;magnus.karlsson@intel.com&gt;
Acked-by: Jonathan Lemon &lt;jonathan.lemon@gmail.com&gt;
Signed-off-by: Daniel Borkmann &lt;daniel@iogearbox.net&gt;
</content>
</entry>
<entry>
<title>Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net</title>
<updated>2019-07-09T02:48:57Z</updated>
<author>
<name>David S. Miller</name>
</author>
<published>2019-07-09T02:48:57Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=af144a983402f7fd324ce556d9f9011a8b3e01fe'/>
<id>urn:sha1:af144a983402f7fd324ce556d9f9011a8b3e01fe</id>
<content type='text'>
Two cases of overlapping changes, nothing fancy.

Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>xsk: Add API to check for available entries in FQ</title>
<updated>2019-06-27T20:53:26Z</updated>
<author>
<name>Maxim Mikityanskiy</name>
</author>
<published>2019-06-26T14:35:24Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=d57d76428ae9abca51fb89f9326da9d4b1cf8270'/>
<id>urn:sha1:d57d76428ae9abca51fb89f9326da9d4b1cf8270</id>
<content type='text'>
Add a function that checks whether the Fill Ring has the specified
amount of descriptors available. It will be useful for mlx5e that wants
to check in advance, whether it can allocate a bulk of RX descriptors,
to get the best performance.

Signed-off-by: Maxim Mikityanskiy &lt;maximmi@mellanox.com&gt;
Signed-off-by: Tariq Toukan &lt;tariqt@mellanox.com&gt;
Acked-by: Saeed Mahameed &lt;saeedm@mellanox.com&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>xsk: Properly terminate assignment in xskq_produce_flush_desc</title>
<updated>2019-06-26T12:39:05Z</updated>
<author>
<name>Nathan Chancellor</name>
</author>
<published>2019-06-25T18:23:52Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=f7019b7b0ad14bde732b8953161994edfc384953'/>
<id>urn:sha1:f7019b7b0ad14bde732b8953161994edfc384953</id>
<content type='text'>
Clang warns:

In file included from net/xdp/xsk_queue.c:10:
net/xdp/xsk_queue.h:292:2: warning: expression result unused
[-Wunused-value]
        WRITE_ONCE(q-&gt;ring-&gt;producer, q-&gt;prod_tail);
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/compiler.h:284:6: note: expanded from macro 'WRITE_ONCE'
        __u.__val;                                      \
        ~~~ ^~~~~
1 warning generated.

The q-&gt;prod_tail assignment has a comma at the end, not a semi-colon.
Fix that so clang no longer warns and everything works as expected.

Fixes: c497176cb2e4 ("xsk: add Rx receive functions and poll support")
Link: https://github.com/ClangBuiltLinux/linux/issues/544
Signed-off-by: Nathan Chancellor &lt;natechancellor@gmail.com&gt;
Acked-by: Nick Desaulniers &lt;ndesaulniers@google.com&gt;
Acked-by: Jonathan Lemon &lt;jonathan.lemon@gmail.com&gt;
Acked-by: Björn Töpel &lt;bjorn.topel@intel.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>xsk: fix XDP socket ring buffer memory ordering</title>
<updated>2019-04-17T03:13:10Z</updated>
<author>
<name>Magnus Karlsson</name>
</author>
<published>2019-04-16T12:58:08Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=f63666de2ba9c1c3ac0ec57fc5d3032514ec80f1'/>
<id>urn:sha1:f63666de2ba9c1c3ac0ec57fc5d3032514ec80f1</id>
<content type='text'>
The ring buffer code of XDP sockets is missing a memory barrier on the
consumer side between the load of the data and the write that signals
that it is ok for the producer to put new data into the buffer. On
architectures that does not guarantee that stores are not reordered
with older loads, the producer might put data into the ring before the
consumer had the chance to read it. As IA does guarantee this
ordering, it would only need a compiler barrier here, but there are no
primitives in Linux for this specific case (hinder writes to be ordered
before older reads) so I had to add a smp_mb() here which will
translate into a run-time synch operation on IA.

Added a longish comment in the code explaining what each barrier in
the ring implementation accomplishes and what would happen if we
removed one of them.

Signed-off-by: Magnus Karlsson &lt;magnus.karlsson@intel.com&gt;
Signed-off-by: Alexei Starovoitov &lt;ast@kernel.org&gt;
</content>
</entry>
<entry>
<title>xsk: fix to reject invalid options in Tx descriptor</title>
<updated>2019-03-08T20:17:06Z</updated>
<author>
<name>Björn Töpel</name>
</author>
<published>2019-03-08T07:57:27Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=c57b557b644da624982c36b74f608cdb7b902868'/>
<id>urn:sha1:c57b557b644da624982c36b74f608cdb7b902868</id>
<content type='text'>
Passing a non-existing option in the options member of struct
xdp_desc was, incorrectly, silently ignored. This patch addresses
that behavior, and drops any Tx descriptor with non-existing options.

We have examined existing user space code, and to our best knowledge,
no one is relying on the current incorrect behavior. AF_XDP is still
in its infancy, so from our perspective, the risk of breakage is very
low, and addressing this problem now is important.

Fixes: 35fcde7f8deb ("xsk: support for Tx")
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>
<entry>
<title>net: xsk: add a simple buffer reuse queue</title>
<updated>2018-09-25T20:13:15Z</updated>
<author>
<name>Jakub Kicinski</name>
</author>
<published>2018-09-07T08:18:46Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=f5bd91388e26557f64ca999e0006038c7a919308'/>
<id>urn:sha1:f5bd91388e26557f64ca999e0006038c7a919308</id>
<content type='text'>
XSK UMEM is strongly single producer single consumer so reuse of
frames is challenging.  Add a simple "stash" of FILL packets to
reuse for drivers to optionally make use of.  This is useful
when driver has to free (ndo_stop) or resize a ring with an active
AF_XDP ZC socket.

Signed-off-by: Jakub Kicinski &lt;jakub.kicinski@netronome.com&gt;
Tested-by: Andrew Bowers &lt;andrewx.bowers@intel.com&gt;
Signed-off-by: Jeff Kirsher &lt;jeffrey.t.kirsher@intel.com&gt;
</content>
</entry>
<entry>
<title>xsk: i40e: get rid of useless struct xdp_umem_props</title>
<updated>2018-08-31T23:38:16Z</updated>
<author>
<name>Magnus Karlsson</name>
</author>
<published>2018-08-31T11:40:02Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=93ee30f3e8b412c5fc2d2f7d9d002529d9a209ad'/>
<id>urn:sha1:93ee30f3e8b412c5fc2d2f7d9d002529d9a209ad</id>
<content type='text'>
This commit gets rid of the structure xdp_umem_props. It was there to
be able to break a dependency at one point, but this is no longer
needed. The values in the struct are instead stored directly in the
xdp_umem structure. This simplifies the xsk code as well as af_xdp
zero-copy drivers and as a bonus gets rid of one internal header file.

The i40e driver is also adapted to the new interface in this commit.

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>xsk: fix poll/POLLIN premature returns</title>
<updated>2018-07-26T00:53:10Z</updated>
<author>
<name>Björn Töpel</name>
</author>
<published>2018-07-23T09:43:03Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=d24458e43b103c7eb7b2fd57bcac392fd7750438'/>
<id>urn:sha1:d24458e43b103c7eb7b2fd57bcac392fd7750438</id>
<content type='text'>
Polling for the ingress queues relies on reading the producer/consumer
pointers of the Rx queue.

Prior this commit, a cached consumer pointer could be used, instead of
the actual consumer pointer and therefore report POLLIN prematurely.

This patch makes sure that the non-cached consumer pointer is used
instead.

Reported-by: Qi Zhang &lt;qi.z.zhang@intel.com&gt;
Tested-by: Qi Zhang &lt;qi.z.zhang@intel.com&gt;
Fixes: c497176cb2e4 ("xsk: add Rx receive functions and poll support")
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>
