Add accesses for bpf_sk_storage_get and bpf_sk_storage_delete.
Add write accesses for avg_pacing_rate of struct mptcp_subflow_context
in .btf_struct_access. They will be used in the bpf_burst selftests.
Add write accesses for all bit flags of struct mptcp_subflow_context
between map_csum_len and data_avail in .btf_struct_access. The stale
flag will be used in the bpf_stale selftests.
Signed-off-by: Geliang Tang <geliang.tang@suse.com>
---
net/mptcp/bpf.c | 16 +++++++++++++++-
1 file changed, 15 insertions(+), 1 deletion(-)
diff --git a/net/mptcp/bpf.c b/net/mptcp/bpf.c
index dd1208670c54..204dc37e31cd 100644
--- a/net/mptcp/bpf.c
+++ b/net/mptcp/bpf.c
@@ -13,6 +13,7 @@
#include <linux/bpf_verifier.h>
#include <linux/btf.h>
#include <linux/btf_ids.h>
+#include <net/bpf_sk_storage.h>
#include "protocol.h"
#ifdef CONFIG_BPF_JIT
@@ -30,7 +31,14 @@ static const struct bpf_func_proto *
bpf_mptcp_sched_get_func_proto(enum bpf_func_id func_id,
const struct bpf_prog *prog)
{
- return bpf_base_func_proto(func_id);
+ switch (func_id) {
+ case BPF_FUNC_sk_storage_get:
+ return &bpf_sk_storage_get_proto;
+ case BPF_FUNC_sk_storage_delete:
+ return &bpf_sk_storage_delete_proto;
+ default:
+ return bpf_base_func_proto(func_id);
+ }
}
static int bpf_mptcp_sched_btf_struct_access(struct bpf_verifier_log *log,
@@ -50,6 +58,12 @@ static int bpf_mptcp_sched_btf_struct_access(struct bpf_verifier_log *log,
case offsetof(struct mptcp_subflow_context, scheduled):
end = offsetofend(struct mptcp_subflow_context, scheduled);
break;
+ case offsetofend(struct mptcp_subflow_context, map_csum_len):
+ end = offsetof(struct mptcp_subflow_context, data_avail);
+ break;
+ case offsetof(struct mptcp_subflow_context, avg_pacing_rate):
+ end = offsetofend(struct mptcp_subflow_context, avg_pacing_rate);
+ break;
default:
bpf_log(log, "no write support to mptcp_subflow_context at off %d\n", off);
return -EACCES;
--
2.35.3