Thread (49 messages) 49 messages, 5 authors, 2020-01-21

RE: [PATCH bpf-next v2 07/11] bpf, sockmap: Return socket cookie on lookup from syscall

From: John Fastabend <john.fastabend@gmail.com>
Date: 2020-01-12 00:56:53
Also in: bpf

Jakub Sitnicki wrote:
Tooling that populates the SOCKMAP with sockets from user-space needs a way
to inspect its contents. Returning the struct sock * that SOCKMAP holds to
user-space is neither safe nor useful. An approach established by
REUSEPORT_SOCKARRAY is to return a socket cookie (a unique identifier)
instead.

Since socket cookies are u64 values SOCKMAP needs to support such a value
size for lookup to be possible. This requires special handling on update,
though. Attempts to do a lookup on SOCKMAP holding u32 values will be met
with ENOSPC error.

Signed-off-by: Jakub Sitnicki <jakub@cloudflare.com>
---
Acked-by: John Fastabend <john.fastabend@gmail.com>
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help