aboutsummaryrefslogtreecommitdiffstats
path: root/include/net/tcp.h
diff options
context:
space:
mode:
authorJohn Fastabend <john.fastabend@gmail.com>2018-05-14 13:00:16 -0400
committerDaniel Borkmann <daniel@iogearbox.net>2018-05-15 11:19:59 -0400
commite5cd3abcb31a48d4ea91bd32f0618802ca5f3592 (patch)
tree9f9a20ba785895a7484d60dad2c786e0cd4f04a7 /include/net/tcp.h
parentf2467c2dbc019548052f3a64dc1efd01c0ae27aa (diff)
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>
Diffstat (limited to 'include/net/tcp.h')
-rw-r--r--include/net/tcp.h3
1 files changed, 1 insertions, 2 deletions
diff --git a/include/net/tcp.h b/include/net/tcp.h
index cf803fe0fb86..059287374ba0 100644
--- a/include/net/tcp.h
+++ b/include/net/tcp.h
@@ -814,9 +814,8 @@ struct tcp_skb_cb {
814#endif 814#endif
815 } header; /* For incoming skbs */ 815 } header; /* For incoming skbs */
816 struct { 816 struct {
817 __u32 key;
818 __u32 flags; 817 __u32 flags;
819 struct bpf_map *map; 818 struct sock *sk_redir;
820 void *data_end; 819 void *data_end;
821 } bpf; 820 } bpf;
822 }; 821 };