aboutsummaryrefslogtreecommitdiffstats
path: root/include/net
diff options
context:
space:
mode:
authorAlexei Starovoitov <ast@kernel.org>2019-04-27 09:07:49 -0700
committerAlexei Starovoitov <ast@kernel.org>2019-04-27 09:07:49 -0700
commit9076c49bdca2aa68c805f2677b2bccc4bde2bac1 (patch)
treee709bccec939c79f8e25d7902a5a89f26b24caae /include/net
parentMerge branch 'writeable-bpf-tracepoints' (diff)
parentbpf: Add ene-to-end test for bpf_sk_storage_* helpers (diff)
downloadlinux-9076c49bdca2aa68c805f2677b2bccc4bde2bac1.tar.gz
linux-9076c49bdca2aa68c805f2677b2bccc4bde2bac1.zip
Merge branch 'sk-local-storage'
Martin KaFai Lau says: ==================== v4: - Move checks to map_alloc_check in patch 1 (Stanislav Fomichev) - Refactor BTF encoding macros to test_btf.h at a new patch 4 (Stanislav Fomichev) - Refactor getenv and add print PASS message at the end of the test in patch 6 (Yonghong Song) v3: - Replace spinlock_types.h with spinlock.h in patch 1 (kbuild test robot <lkp@intel.com>) v2: - Add the "test_maps.h" file in patch 5 This series introduces the BPF sk local storage. The details is in the patch 1 commit message. ==================== Acked-by: Yonghong Song <yhs@fb.com> Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Diffstat (limited to 'include/net')
-rw-r--r--include/net/bpf_sk_storage.h13
-rw-r--r--include/net/sock.h5
2 files changed, 18 insertions, 0 deletions
diff --git a/include/net/bpf_sk_storage.h b/include/net/bpf_sk_storage.h
new file mode 100644
index 000000000000..b9dcb02e756b
--- /dev/null
+++ b/include/net/bpf_sk_storage.h
@@ -0,0 +1,13 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+/* Copyright (c) 2019 Facebook */
+#ifndef _BPF_SK_STORAGE_H
+#define _BPF_SK_STORAGE_H
+
+struct sock;
+
+void bpf_sk_storage_free(struct sock *sk);
+
+extern const struct bpf_func_proto bpf_sk_storage_get_proto;
+extern const struct bpf_func_proto bpf_sk_storage_delete_proto;
+
+#endif /* _BPF_SK_STORAGE_H */
diff --git a/include/net/sock.h b/include/net/sock.h
index 784cd19d5ff7..4d208c0f9c14 100644
--- a/include/net/sock.h
+++ b/include/net/sock.h
@@ -236,6 +236,8 @@ struct sock_common {
/* public: */
};
+struct bpf_sk_storage;
+
/**
* struct sock - network layer representation of sockets
* @__sk_common: shared layout with inet_timewait_sock
@@ -510,6 +512,9 @@ struct sock {
#endif
void (*sk_destruct)(struct sock *sk);
struct sock_reuseport __rcu *sk_reuseport_cb;
+#ifdef CONFIG_BPF_SYSCALL
+ struct bpf_sk_storage __rcu *sk_bpf_storage;
+#endif
struct rcu_head sk_rcu;
};