]> git.baikalelectronics.ru Git - kernel.git/commit
xsk: Simplify the consumer ring access functions
authorMagnus Karlsson <magnus.karlsson@intel.com>
Thu, 19 Dec 2019 12:39:26 +0000 (13:39 +0100)
committerAlexei Starovoitov <ast@kernel.org>
Sat, 21 Dec 2019 00:00:09 +0000 (16:00 -0800)
commitd3938d000de9d326b2e460b06c42b5a77e97e4c9
tree344a4394b00e50605ff67be098e8ac856ac5647b
parentf8476409aa6840947678f8de6acb849e3517adef
xsk: Simplify the consumer ring access functions

Simplify and refactor consumer ring functions. The consumer first
"peeks" to find descriptors or addresses that are available to
read from the ring, then reads them and finally "releases" these
descriptors once it is done. The two local variables cons_tail
and cons_head are turned into one single variable called
cached_cons. cached_tail referred to the cached value of the
global consumer pointer and will be stored in cached_cons. For
cached_head, we just use cached_prod instead as it was not used
for a consumer queue before. It also better reflects what it
really is now: a cached copy of the producer pointer.

The names of the functions are also renamed in the same manner as
the producer functions. The new functions are called xskq_cons_
followed by what it does.

Signed-off-by: Magnus Karlsson <magnus.karlsson@intel.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Link: https://lore.kernel.org/bpf/1576759171-28550-8-git-send-email-magnus.karlsson@intel.com
net/xdp/xsk.c
net/xdp/xsk_queue.h