linux/net/xdp
Magnus Karlsson f63666de2b xsk: fix XDP socket ring buffer memory ordering
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 <magnus.karlsson@intel.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
2019-04-16 20:13:10 -07:00
..
Kconfig xsk: add sock_diag interface for AF_XDP 2019-01-25 01:50:03 +01:00
Makefile xsk: add sock_diag interface for AF_XDP 2019-01-25 01:50:03 +01:00
xdp_umem.c xsk: fix umem memory leak on cleanup 2019-03-16 01:27:51 +01: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_diag.c xsk: fix potential crash in xsk_diag_put_umem() 2019-03-07 10:36:37 +01:00
xsk_queue.c net: xsk: add a simple buffer reuse queue 2018-09-25 13:13:15 -07:00
xsk_queue.h xsk: fix XDP socket ring buffer memory ordering 2019-04-16 20:13:10 -07:00
xsk.c xsk: fix to reject invalid flags in xsk_bind 2019-03-08 21:17:06 +01:00
xsk.h xsk: add sock_diag interface for AF_XDP 2019-01-25 01:50:03 +01:00