Merge branch 'bpf-sock-hashmap'
John Fastabend says:
====================
In the original sockmap implementation we got away with using an
array similar to devmap. However, unlike devmap where an ifindex
has a nice 1:1 function into the map we have found some use cases
with sockets that need to be referenced using longer keys.
This series adds support for a sockhash map reusing as much of
the sockmap code as possible. I made the decision to add sockhash
specific helpers vs trying to generalize the existing helpers
because (a) they have sockmap in the name and (b) the keys are
different types. I prefer to be explicit here rather than play
type games or do something else tricky.
To test this we duplicate all the sockmap testing except swap out
the sockmap with a sockhash.
v2: fix file stats and add v2 tag
v3: move tool updates into test patch, move bpftool updates into
its own patch, and fixup the test patch stats to catch the
renamed file and provide only diffs ± on that.
v4: Add documentation to UAPI bpf.h
v5: Add documentation to tools UAPI bpf.h
v6: 'git add' test_sockhash_kern.c which was previously missing
but was not causing issues because of typo in test script,
noticed by Daniel. After this the git format-patch -M option
no longer tracks the rename of the test_sockmap_kern files for
some reason. I guess the diff has exceeded some threshold.
====================
Signed-off-by:
Daniel Borkmann <daniel@iogearbox.net>
No related branches found
No related tags found
Showing
- include/linux/bpf.h 8 additions, 0 deletionsinclude/linux/bpf.h
- include/linux/bpf_types.h 1 addition, 0 deletionsinclude/linux/bpf_types.h
- include/linux/filter.h 1 addition, 2 deletionsinclude/linux/filter.h
- include/net/tcp.h 1 addition, 2 deletionsinclude/net/tcp.h
- include/uapi/linux/bpf.h 52 additions, 2 deletionsinclude/uapi/linux/bpf.h
- kernel/bpf/core.c 1 addition, 0 deletionskernel/bpf/core.c
- kernel/bpf/sockmap.c 565 additions, 73 deletionskernel/bpf/sockmap.c
- kernel/bpf/verifier.c 12 additions, 2 deletionskernel/bpf/verifier.c
- net/core/filter.c 66 additions, 23 deletionsnet/core/filter.c
- tools/bpf/bpftool/map.c 1 addition, 0 deletionstools/bpf/bpftool/map.c
- tools/include/uapi/linux/bpf.h 52 additions, 2 deletionstools/include/uapi/linux/bpf.h
- tools/testing/selftests/bpf/Makefile 1 addition, 1 deletiontools/testing/selftests/bpf/Makefile
- tools/testing/selftests/bpf/bpf_helpers.h 8 additions, 0 deletionstools/testing/selftests/bpf/bpf_helpers.h
- tools/testing/selftests/bpf/test_sockhash_kern.c 5 additions, 0 deletionstools/testing/selftests/bpf/test_sockhash_kern.c
- tools/testing/selftests/bpf/test_sockmap.c 20 additions, 7 deletionstools/testing/selftests/bpf/test_sockmap.c
- tools/testing/selftests/bpf/test_sockmap_kern.c 4 additions, 339 deletionstools/testing/selftests/bpf/test_sockmap_kern.c
- tools/testing/selftests/bpf/test_sockmap_kern.h 363 additions, 0 deletionstools/testing/selftests/bpf/test_sockmap_kern.h
Loading
Please register or sign in to comment