bpf: net: Refactor bpf_iter target registration
Currently bpf_iter_reg_target takes parameters from target and allocates memory to save them. This is really not necessary, esp. in the future we may grow information passed from targets to bpf_iter manager. The patch refactors the code so target reg_info becomes static and bpf_iter manager can just take a reference to it. Signed-off-by: Yonghong Song <yhs@fb.com> Signed-off-by: Alexei Starovoitov <ast@kernel.org> Link: https://lore.kernel.org/bpf/20200513180219.2949605-1-yhs@fb.com
This commit is contained in:

committed by
Alexei Starovoitov

parent
2e3ed68bfc
commit
15172a46fa
@@ -1153,7 +1153,7 @@ struct bpf_iter_meta {
|
||||
u64 seq_num;
|
||||
};
|
||||
|
||||
int bpf_iter_reg_target(struct bpf_iter_reg *reg_info);
|
||||
int bpf_iter_reg_target(const struct bpf_iter_reg *reg_info);
|
||||
void bpf_iter_unreg_target(const char *target);
|
||||
bool bpf_iter_prog_supported(struct bpf_prog *prog);
|
||||
int bpf_iter_link_attach(const union bpf_attr *attr, struct bpf_prog *prog);
|
||||
|
Reference in New Issue
Block a user