On Fri, Apr 27, 2018 at 04:24:38PM -0700, John Fastabend wrote: > Sockmap is currently backed by an array and enforces keys to be > four bytes. This works well for many use cases and was originally > modeled after devmap which also uses four bytes keys. However, > this has become limiting in larger use cases where a hash would > be more appropriate. For example users may want to use the 5-tuple > of the socket as the lookup key. > > To support this add hash support. > > Signed-off-by: John Fastabend <john.fastab...@gmail.com> > --- > include/linux/bpf.h | 8 + > include/linux/bpf_types.h | 1 > include/uapi/linux/bpf.h | 6 > kernel/bpf/core.c | 1 > kernel/bpf/sockmap.c | 494 > +++++++++++++++++++++++++++++++++++++++- > kernel/bpf/verifier.c | 14 + > net/core/filter.c | 58 +++++ > tools/bpf/bpftool/map.c | 1 > tools/include/uapi/linux/bpf.h | 6 > 9 files changed, 570 insertions(+), 19 deletions(-)
please split tools/* update into separate commit. Also add man-page style documentation for new helpers to uapi/bpf.h