linux/net/xdp
Magnus Karlsson c9b47cc1fa xsk: fix bug when trying to use both copy and zero-copy on one queue id
Previously, the xsk code did not record which umem was bound to a
specific queue id. This was not required if all drivers were zero-copy
enabled as this had to be recorded in the driver anyway. So if a user
tried to bind two umems to the same queue, the driver would say
no. But if copy-mode was first enabled and then zero-copy mode (or the
reverse order), we mistakenly enabled both of them on the same umem
leading to buggy behavior. The main culprit for this is that we did
not store the association of umem to queue id in the copy case and
only relied on the driver reporting this. As this relation was not
stored in the driver for copy mode (it does not rely on the AF_XDP
NDOs), this obviously could not work.

This patch fixes the problem by always recording the umem to queue id
relationship in the netdev_queue and netdev_rx_queue structs. This way
we always know what kind of umem has been bound to a queue id and can
act appropriately at bind time.

Signed-off-by: Magnus Karlsson <magnus.karlsson@intel.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
2018-10-05 09:31:00 +02:00
..
Kconfig
Makefile xsk: remove newline at end of file 2018-05-18 16:07:02 +02:00
xdp_umem.c xsk: fix bug when trying to use both copy and zero-copy on one queue id 2018-10-05 09:31:00 +02:00
xdp_umem.h xsk: fix bug when trying to use both copy and zero-copy on one queue id 2018-10-05 09:31:00 +02:00
xsk_queue.c net: xsk: add a simple buffer reuse queue 2018-09-25 13:13:15 -07:00
xsk_queue.h net: xsk: add a simple buffer reuse queue 2018-09-25 13:13:15 -07:00
xsk.c xsk: fix bug when trying to use both copy and zero-copy on one queue id 2018-10-05 09:31:00 +02:00