Hash support for sock
Status from this message: Applied to bpf-next, thanks John! Couple of comments in the patches.
Get series with b4
b4 am [email protected]Versions newest first · linked by author and title
- v6 Latest4 patches 6 repliesApplied
- v54 patches 1 replySuperseded
- v44 patches 2 repliesSuperseded
Earlier versions · 3
| Version | Posted | Patches | Replies | Status |
|---|---|---|---|---|
| v3 | 4 patches | 2 replies | Superseded | |
| v2 | 3 patches | 3 replies | Superseded | |
| v1 | 0 of 3 patches | 0 replies | Superseded |
Patches in v6 Applied
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/4 | bpf: sockmap, refactor sockmap routines to work with hashmapinclude/ include/ kernel/ +1 more | +98 | 2 replies | |
| 2/4 | bpf: sockmap, add hash map supportinclude/ include/ include/ +4 more | +610 | 3 replies | |
| 3/4 | bpf: selftest additions for SOCKHASHtools/ tools/ tools/ +4 more | +452 | 0 replies | |
| 4/4 | bpf: bpftool, support for sockhashtools/ | +1 | 0 replies |
Reviews trailers per patch
All 4 patches have a Reviewed-by or Acked-by.
| Patch | David S. Miller |
|---|---|
| 1/4 | A-b |
| 2/4 | A-b |
| 3/4 | A-b |
| 4/4 | A-b |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [PATCH bpf-next v6 0/4] Hash support for sock
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.
Just a note I pushed Dave's Acks through v4 into v5 due to small size of changes.
John Fastabend (4):
bpf: sockmap, refactor sockmap routines to work with hashmap
bpf: sockmap, add hash map support
bpf: selftest additions for SOCKHASH
bpf: bpftool, support for sockhash
include/linux/bpf.h | 8 + include/linux/bpf_types.h | 1 + include/linux/filter.h | 3 +- include/net/tcp.h | 3 +- include/uapi/linux/bpf.h | 52 +- kernel/bpf/core.c | 1 + kernel/bpf/sockmap.c | 638 ++++++++++++++++++++--- kernel/bpf/verifier.c | 14 +- net/core/filter.c | 89 +++- tools/bpf/bpftool/map.c | 1 + tools/include/uapi/linux/bpf.h | 52 +- tools/testing/selftests/bpf/Makefile | 2 +- tools/testing/selftests/bpf/bpf_helpers.h | 8 + tools/testing/selftests/bpf/test_sockhash_kern.c | 5 + tools/testing/selftests/bpf/test_sockmap.c | 27 +- tools/testing/selftests/bpf/test_sockmap_kern.c | 343 +----------- tools/testing/selftests/bpf/test_sockmap_kern.h | 363 +++++++++++++ 17 files changed, 1159 insertions(+), 451 deletions(-) create mode 100644 tools/testing/selftests/bpf/test_sockhash_kern.c create mode 100644 tools/testing/selftests/bpf/test_sockmap_kern.h
Signature · 1 line
1.9.1