diff options
| author | Jakub Sitnicki <[email protected]> | 2020-02-18 17:10:18 +0000 |
|---|---|---|
| committer | Daniel Borkmann <[email protected]> | 2020-02-21 22:29:45 +0100 |
| commit | c1cdf65da060a8e047a9f4433306fd6dac1f51a6 (patch) | |
| tree | ec77dc322cb1085437d4e63ee2c19d6958297ac4 /tools/perf/scripts/python/Perf-Trace-Util/lib | |
| parent | 6e830c2f6c9641217e22330cec1372acff78dcef (diff) | |
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 <[email protected]>
Signed-off-by: Daniel Borkmann <[email protected]>
Acked-by: John Fastabend <[email protected]>
Link: https://lore.kernel.org/bpf/[email protected]
Diffstat (limited to 'tools/perf/scripts/python/Perf-Trace-Util/lib')
0 files changed, 0 insertions, 0 deletions