Thread (7 messages) flat view 7 messages, 4 authors, 2021-03-11

Re: [PATCH bpf-next 2/2] libbpf: xsk: move barriers from libbpf_util.h to xsk.h

From: Andrii Nakryiko <hidden>
Date: 2021-03-11 18:58:54
Also in: bpf

On Wed, Mar 10, 2021 at 10:59 PM Björn Töpel [off-list ref] wrote:
On 2021-03-11 01:06, Jonathan Lemon wrote:
quoted
On Wed, Mar 10, 2021 at 09:09:29AM +0100, Björn Töpel wrote:
quoted
From: Björn Töpel <redacted>

The only user of libbpf_util.h is xsk.h. Move the barriers to xsk.h,
and remove libbpf_util.h. The barriers are used as an implementation
detail, and should not be considered part of the stable API.
Does that mean that anything else which uses the same type of
shared rings (bpf ringbuffer, io_uring, zctap) have to implement
the same primitives that xsk.h has?
Jonathan, there's a longer explanation on back-/forward-compatibility in
the commit message [1]. Again, this is for the XDP socket rings, so I
wont comment on the other rings. I would not assume compatibility
between different rings (e.g. the bpf ringbuffer and XDP sockets rings),
not even prior the barrier change.
BPF ringbuf is using smp_store_release()/smp_load_acquire(), which are
coming from asm/barrier.h. But libbpf abstracts all the low-level
details, so users don't have to use such low-level primitives
directly.
Björn

[1]
https://lore.kernel.org/bpf/20210305094113.413544-2-bjorn.topel@gmail.com/ (local)
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help