Skip to content

Hash support for sock

John Fastabend netdev 1 version In review

Get series with b4
b4 am 20180427224752.6861.77895.stgit@john-Precision-Tower-5810

Versions newest first

  1. v1 Latest3 patches 2 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3bpf: sockmap, refactor sockmap routines to work with hashmapinclude/linux/filter.h include/net/tcp.h kernel/bpf/sockmap.c +1 more+98 -870 replies
2/3bpf: sockmap, add hash map supportinclude/linux/bpf.h include/linux/bpf_types.h include/uapi/linux/bpf.h +6 more+570 -190 replies
3/3bpf: selftest additions for SOCKHASHtools/testing/selftests/bpf/Makefile tools/testing/selftests/bpf/test_sockhash_kern.c tools/testing/selftests/bpf/test_sockmap.c +2 more+368 -3460 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [bpf-next PATCH 0/3] 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 need to be referenced using longer keys.

This series adds support for a sockhash map type which reuses almost all the sockmap code except it needed a few special add/remove handlers.

To test this we duplicate all the sockmap testing except swap out the sockmap with a sockhash.

---

John Fastabend (3):
bpf: sockmap, refactor sockmap routines to work with hashmap
bpf: sockmap, add hash map support
bpf: selftest additions for SOCKHASH

 tools/bpf/bpftool/map.c                          |    1 
 tools/include/uapi/linux/bpf.h                   |    6 
 tools/testing/selftests/bpf/Makefile             |    3 
 tools/testing/selftests/bpf/test_sockhash_kern.c |    4 
 tools/testing/selftests/bpf/test_sockmap.c       |   27 +-
 tools/testing/selftests/bpf/test_sockmap_kern.c  |  340 ----------------------
 tools/testing/selftests/bpf/test_sockmap_kern.h  |  340 ++++++++++++++++++++++
 7 files changed, 374 insertions(+), 347 deletions(-)
 create mode 100644 tools/testing/selftests/bpf/test_sockhash_kern.c
 create mode 100644 tools/testing/selftests/bpf/test_sockmap_kern.h