bpf: Add cmd alias BPF_PROG_RUN
Add BPF_PROG_RUN command as an alias to BPF_RPOG_TEST_RUN to better indicate the full range of use cases done by the command. Suggested-by: Daniel Borkmann <daniel@iogearbox.net> Signed-off-by: Alexei Starovoitov <ast@kernel.org> Signed-off-by: Daniel Borkmann <daniel@iogearbox.net> Acked-by: Song Liu <songliubraving@fb.com> Link: https://lore.kernel.org/bpf/20210519014032.20908-1-alexei.starovoitov@gmail.com
This commit is contained in:
parent
3d43167768
commit
5d67f34959
@ -837,6 +837,7 @@ enum bpf_cmd {
|
||||
BPF_PROG_ATTACH,
|
||||
BPF_PROG_DETACH,
|
||||
BPF_PROG_TEST_RUN,
|
||||
BPF_PROG_RUN = BPF_PROG_TEST_RUN,
|
||||
BPF_PROG_GET_NEXT_ID,
|
||||
BPF_MAP_GET_NEXT_ID,
|
||||
BPF_PROG_GET_FD_BY_ID,
|
||||
|
@ -837,6 +837,7 @@ enum bpf_cmd {
|
||||
BPF_PROG_ATTACH,
|
||||
BPF_PROG_DETACH,
|
||||
BPF_PROG_TEST_RUN,
|
||||
BPF_PROG_RUN = BPF_PROG_TEST_RUN,
|
||||
BPF_PROG_GET_NEXT_ID,
|
||||
BPF_MAP_GET_NEXT_ID,
|
||||
BPF_PROG_GET_FD_BY_ID,
|
||||
|
@ -102,7 +102,7 @@ static inline int bpf_load_and_run(struct bpf_load_and_run_opts *opts)
|
||||
attr.test.prog_fd = prog_fd;
|
||||
attr.test.ctx_in = (long) opts->ctx;
|
||||
attr.test.ctx_size_in = opts->ctx->sz;
|
||||
err = skel_sys_bpf(BPF_PROG_TEST_RUN, &attr, sizeof(attr));
|
||||
err = skel_sys_bpf(BPF_PROG_RUN, &attr, sizeof(attr));
|
||||
if (err < 0 || (int)attr.test.retval < 0) {
|
||||
opts->errstr = "failed to execute loader prog";
|
||||
if (err < 0)
|
||||
|
Loading…
Reference in New Issue
Block a user