mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 10:41:38 -04:00
UPSTREAM: bpf: Refactor bpf_iter_reg to have separate seq_info member
There is no functionality change for this patch. Struct bpf_iter_reg is used to register a bpf_iter target, which includes information for both prog_load, link_create and seq_file creation. This patch puts fields related seq_file creation into a different structure. This will be useful for map elements iterator where one iterator covers different map types and different map types may have different seq_ops, init/fini private_data function and private_data size. Change-Id: I2577d77f6b6be71319457720547ba77cff04c68b Signed-off-by: Yonghong Song <[email protected]> Signed-off-by: Alexei Starovoitov <[email protected]> Link: https://lore.kernel.org/bpf/[email protected]
This commit is contained in:
parent
370a524542
commit
ecc4d9f640
9 changed files with 64 additions and 29 deletions
|
|
@ -6415,17 +6415,21 @@ DEFINE_BPF_ITER_FUNC(ipv6_route, struct bpf_iter_meta *meta, struct fib6_info *r
|
|||
BTF_ID_LIST(btf_fib6_info_id)
|
||||
BTF_ID(struct, fib6_info)
|
||||
|
||||
static struct bpf_iter_reg ipv6_route_reg_info = {
|
||||
.target = "ipv6_route",
|
||||
static const struct bpf_iter_seq_info ipv6_route_seq_info = {
|
||||
.seq_ops = &ipv6_route_seq_ops,
|
||||
.init_seq_private = bpf_iter_init_seq_net,
|
||||
.fini_seq_private = bpf_iter_fini_seq_net,
|
||||
.seq_priv_size = sizeof(struct ipv6_route_iter),
|
||||
};
|
||||
|
||||
static struct bpf_iter_reg ipv6_route_reg_info = {
|
||||
.target = "ipv6_route",
|
||||
.ctx_arg_info_size = 1,
|
||||
.ctx_arg_info = {
|
||||
{ offsetof(struct bpf_iter__ipv6_route, rt),
|
||||
PTR_TO_BTF_ID_OR_NULL },
|
||||
},
|
||||
.seq_info = &ipv6_route_seq_info,
|
||||
};
|
||||
|
||||
static int __init bpf_iter_register(void)
|
||||
|
|
|
|||
Loading…
Reference in a new issue