<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/net/xdp/xsk_queue.h, branch linux-4.18.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-4.18.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-4.18.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2018-07-26T00:53:10Z</updated>
<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>
<entry>
<title>xsk: fix potential lost completion message in SKB path</title>
<updated>2018-07-03T01:37:11Z</updated>
<author>
<name>Magnus Karlsson</name>
</author>
<published>2018-06-29T07:48:17Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=20b52a75166086a40d838397ef3db28a4f2c5998'/>
<id>urn:sha1:20b52a75166086a40d838397ef3db28a4f2c5998</id>
<content type='text'>
The code in xskq_produce_addr erroneously checked if there
was up to LAZY_UPDATE_THRESHOLD amount of space in the completion
queue. It only needs to check if there is one slot left in the
queue. This bug could under some circumstances lead to a WARN_ON_ONCE
being triggered and the completion message to user space being lost.

Fixes: 35fcde7f8deb ("xsk: support for Tx")
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>xsk: wire upp Tx zero-copy functions</title>
<updated>2018-06-05T13:48:34Z</updated>
<author>
<name>Magnus Karlsson</name>
</author>
<published>2018-06-04T12:05:57Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=ac98d8aab61baf785eb8f099b36daf34fc76a70e'/>
<id>urn:sha1:ac98d8aab61baf785eb8f099b36daf34fc76a70e</id>
<content type='text'>
Here we add the functionality required to support zero-copy Tx, and
also exposes various zero-copy related functions for the netdevs.

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: moved struct xdp_umem definition</title>
<updated>2018-06-05T13:45:17Z</updated>
<author>
<name>Björn Töpel</name>
</author>
<published>2018-06-04T12:05:51Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=e61e62b9e2cc14b336f330f37f517f9d373ff31e'/>
<id>urn:sha1:e61e62b9e2cc14b336f330f37f517f9d373ff31e</id>
<content type='text'>
Moved struct xdp_umem to xdp_sock.h, in order to prepare for zero-copy
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>
<entry>
<title>xsk: new descriptor addressing scheme</title>
<updated>2018-06-04T15:21:02Z</updated>
<author>
<name>Björn Töpel</name>
</author>
<published>2018-06-04T11:57:13Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=bbff2f321a864ee07c9d3d1245af498023146951'/>
<id>urn:sha1:bbff2f321a864ee07c9d3d1245af498023146951</id>
<content type='text'>
Currently, AF_XDP only supports a fixed frame-size memory scheme where
each frame is referenced via an index (idx). A user passes the frame
index to the kernel, and the kernel acts upon the data.  Some NICs,
however, do not have a fixed frame-size model, instead they have a
model where a memory window is passed to the hardware and multiple
frames are filled into that window (referred to as the "type-writer"
model).

By changing the descriptor format from the current frame index
addressing scheme, AF_XDP can in the future be extended to support
these kinds of NICs.

In the index-based model, an idx refers to a frame of size
frame_size. Addressing a frame in the UMEM is done by offseting the
UMEM starting address by a global offset, idx * frame_size + offset.
Communicating via the fill- and completion-rings are done by means of
idx.

In this commit, the idx is removed in favor of an address (addr),
which is a relative address ranging over the UMEM. To convert an
idx-based address to the new addr is simply: addr = idx * frame_size +
offset.

We also stop referring to the UMEM "frame" as a frame. Instead it is
simply called a chunk.

To transfer ownership of a chunk to the kernel, the addr of the chunk
is passed in the fill-ring. Note, that the kernel will mask addr to
make it chunk aligned, so there is no need for userspace to do
that. E.g., for a chunk size of 2k, passing an addr of 2048, 2050 or
3000 to the fill-ring will refer to the same chunk.

On the completion-ring, the addr will match that of the Tx descriptor,
passed to the kernel.

Changing the descriptor format to use chunks/addr will allow for
future changes to move to a type-writer based model, where multiple
frames can reside in one chunk. In this model passing one single chunk
into the fill-ring, would potentially result in multiple Rx
descriptors.

This commit changes the uapi of AF_XDP sockets, and updates the
documentation.

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>xsk: proper fill queue descriptor validation</title>
<updated>2018-06-04T15:21:02Z</updated>
<author>
<name>Björn Töpel</name>
</author>
<published>2018-06-04T11:57:11Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=4e64c835254095f55044d393e628dd3e92fca304'/>
<id>urn:sha1:4e64c835254095f55044d393e628dd3e92fca304</id>
<content type='text'>
Previously the fill queue descriptor was not copied to kernel space
prior validating it, making it possible for userland to change the
descriptor post-kernel-validation.

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>xsk: remove explicit ring structure from uapi</title>
<updated>2018-05-22T08:25:06Z</updated>
<author>
<name>Björn Töpel</name>
</author>
<published>2018-05-22T07:34:59Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=b3a9e0be436960072ddf327d9d82f50ee2f620e0'/>
<id>urn:sha1:b3a9e0be436960072ddf327d9d82f50ee2f620e0</id>
<content type='text'>
In this commit we remove the explicit ring structure from the the
uapi. It is tricky for an uapi to depend on a certain L1 cache line
size, since it can differ for variants of the same architecture. Now,
we let the user application determine the offsets of the producer,
consumer and descriptors by asking the socket via getsockopt.

A typical flow would be (Rx ring):

  struct xdp_mmap_offsets off;
  struct xdp_desc *ring;
  u32 *prod, *cons;
  void *map;
  ...

  getsockopt(fd, SOL_XDP, XDP_MMAP_OFFSETS, &amp;off, &amp;optlen);

  map = mmap(NULL, off.rx.desc +
		   NUM_DESCS * sizeof(struct xdp_desc),
		   PROT_READ | PROT_WRITE,
		   MAP_SHARED | MAP_POPULATE, sfd,
		   XDP_PGOFF_RX_RING);
  prod = map + off.rx.producer;
  cons = map + off.rx.consumer;
  ring = map + off.rx.desc;

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>xsk: fixed some cases of unnecessary parentheses</title>
<updated>2018-05-18T14:07:03Z</updated>
<author>
<name>Björn Töpel</name>
</author>
<published>2018-05-18T12:00:23Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=da60cf00c1a576a459defed2edfb88c858510b64'/>
<id>urn:sha1:da60cf00c1a576a459defed2edfb88c858510b64</id>
<content type='text'>
Removed some cases of unnecessary parentheses.

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>xsk: clean up SPDX headers</title>
<updated>2018-05-18T14:07:02Z</updated>
<author>
<name>Björn Töpel</name>
</author>
<published>2018-05-18T12:00:21Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=dac09149d992995adbef0f472093fbb6940a8653'/>
<id>urn:sha1:dac09149d992995adbef0f472093fbb6940a8653</id>
<content type='text'>
Clean up SPDX-License-Identifier and removing licensing leftovers.

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>xsk: statistics support</title>
<updated>2018-05-03T22:55:25Z</updated>
<author>
<name>Magnus Karlsson</name>
</author>
<published>2018-05-02T11:01:35Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=af75d9e02d08dc55ce6a1e42e485465c630d7349'/>
<id>urn:sha1:af75d9e02d08dc55ce6a1e42e485465c630d7349</id>
<content type='text'>
In this commit, a new getsockopt is added: XDP_STATISTICS. This is
used to obtain stats from the sockets.

v2: getsockopt now returns size of stats structure.

Signed-off-by: Magnus Karlsson &lt;magnus.karlsson@intel.com&gt;
Signed-off-by: Alexei Starovoitov &lt;ast@kernel.org&gt;
</content>
</entry>
</feed>
