• Magnus Karlsson's avatar
    libbpf: remove dependency on barrier.h in xsk.h · b7e3a280
    Magnus Karlsson authored
    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: 1cad0788 ("libbpf: add support for using AF_XDP sockets")
    Signed-off-by: default avatarMagnus Karlsson <magnus.karlsson@intel.com>
    Signed-off-by: default avatarAlexei Starovoitov <ast@kernel.org>
    b7e3a280
libbpf_util.h 1.81 KB