diff options
author | Jakub Sitnicki <jakub@cloudflare.com> | 2020-02-18 20:10:18 +0300 |
---|---|---|
committer | Daniel Borkmann <daniel@iogearbox.net> | 2020-02-22 00:29:45 +0300 |
commit | c1cdf65da060a8e047a9f4433306fd6dac1f51a6 (patch) | |
tree | ec77dc322cb1085437d4e63ee2c19d6958297ac4 /tools/perf/scripts/python/export-to-postgresql.py | |
parent | 6e830c2f6c9641217e22330cec1372acff78dcef (diff) | |
download | linux-c1cdf65da060a8e047a9f4433306fd6dac1f51a6.tar.xz |
bpf, sockmap: Return socket cookie on lookup from syscall
Tooling that populates the SOCK{MAP,HASH} with sockets from user-space
needs a way to inspect its contents. Returning the struct sock * that the
map 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, SOCK{MAP,HASH} need to support such a
value size for lookup to be possible. This requires special handling on
update, though. Attempts to do a lookup on a map holding u32 values will be
met with ENOSPC error.
Signed-off-by: Jakub Sitnicki <jakub@cloudflare.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: John Fastabend <john.fastabend@gmail.com>
Link: https://lore.kernel.org/bpf/20200218171023.844439-7-jakub@cloudflare.com
Diffstat (limited to 'tools/perf/scripts/python/export-to-postgresql.py')
0 files changed, 0 insertions, 0 deletions