linux-brain/net/xdp
Magnus Karlsson 0d08bbce23 xsk: Simplify detection of empty and full rings
[ Upstream commit 11cc2d21499cabe7e7964389634ed1de3ee91d33 ]

In order to set the correct return flags for poll, the xsk code has to
check if the Rx queue is empty and if the Tx queue is full. This code
was unnecessarily large and complex as it used the functions that are
used to update the local state from the global state (xskq_nb_free and
xskq_nb_avail). Since we are not doing this nor updating any data
dependent on this state, we can simplify the functions. Another
benefit from this is that we can also simplify the xskq_nb_free and
xskq_nb_avail functions in a later commit.

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-3-git-send-email-magnus.karlsson@intel.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
2021-05-22 11:38:27 +02:00
..
Kconfig treewide: Add SPDX license identifier - Makefile/Kconfig 2019-05-21 10:50:46 +02:00
Makefile treewide: Add SPDX license identifier - Makefile/Kconfig 2019-05-21 10:50:46 +02:00
xdp_umem.c xsk: Add overflow check for u64 division, stored into u32 2020-06-03 08:21:36 +02:00
xdp_umem.h xdp: fix hang while unregistering device bound to xdp socket 2019-07-03 15:10:55 +02:00
xsk.c xsk: Replace datagram_poll by sock_poll_wait 2020-12-30 11:50:53 +01:00
xsk.h xsk: add support for need_wakeup flag in AF_XDP rings 2019-08-17 23:07:32 +02:00
xsk_diag.c xsk: lock the control mutex in sock_diag interface 2019-09-05 14:11:52 +02:00
xsk_queue.c net: xsk: add a simple buffer reuse queue 2018-09-25 13:13:15 -07:00
xsk_queue.h xsk: Simplify detection of empty and full rings 2021-05-22 11:38:27 +02:00