]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit - include/net/tcp.h
bpf: sockmap, refactor sockmap routines to work with hashmap
authorJohn Fastabend <john.fastabend@gmail.com>
Mon, 14 May 2018 17:00:16 +0000 (10:00 -0700)
committerDaniel Borkmann <daniel@iogearbox.net>
Tue, 15 May 2018 15:19:59 +0000 (17:19 +0200)
commite5cd3abcb31a48d4ea91bd32f0618802ca5f3592
tree9f9a20ba785895a7484d60dad2c786e0cd4f04a7
parentf2467c2dbc019548052f3a64dc1efd01c0ae27aa
bpf: sockmap, refactor sockmap routines to work with hashmap

This patch only refactors the existing sockmap code. This will allow
much of the psock initialization code path and bpf helper codes to
work for both sockmap bpf map types that are backed by an array, the
currently supported type, and the new hash backed bpf map type
sockhash.

Most the fallout comes from three changes,

  - Pushing bpf programs into an independent structure so we
    can use it from the htab struct in the next patch.
  - Generalizing helpers to use void *key instead of the hardcoded
    u32.
  - Instead of passing map/key through the metadata we now do
    the lookup inline. This avoids storing the key in the metadata
    which will be useful when keys can be longer than 4 bytes. We
    rename the sk pointers to sk_redir at this point as well to
    avoid any confusion between the current sk pointer and the
    redirect pointer sk_redir.

Signed-off-by: John Fastabend <john.fastabend@gmail.com>
Acked-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
include/linux/filter.h
include/net/tcp.h
kernel/bpf/sockmap.c
net/core/filter.c