]> git.baikalelectronics.ru Git - kernel.git/commit
libbpf: remove dependency on barrier.h in xsk.h
authorMagnus Karlsson <magnus.karlsson@intel.com>
Tue, 16 Apr 2019 12:58:11 +0000 (14:58 +0200)
committerAlexei Starovoitov <ast@kernel.org>
Wed, 17 Apr 2019 03:13:10 +0000 (20:13 -0700)
commit3a740af6a1b1d46abe2f866e3404c36ba43adf0b
tree5182b3b6a640803c871995f07040247bd3d6f4b0
parent066cfbfbb192a7cf70341013de76fcd5b032fcf1
libbpf: remove dependency on barrier.h in xsk.h

The use of smp_rmb() and smp_wmb() creates a Linux header dependency
on barrier.h that is unnecessary in most parts. This patch implements
the two small defines that are needed from barrier.h. As a bonus, the
new implementations are faster than the default ones as they default
to sfence and lfence for x86, while we only need a compiler barrier in
our case. Just as it is when the same ring access code is compiled in
the kernel.

Fixes: 509c34c8565b ("libbpf: add support for using AF_XDP sockets")
Signed-off-by: Magnus Karlsson <magnus.karlsson@intel.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
tools/lib/bpf/libbpf_util.h
tools/lib/bpf/xsk.h