mirror of
https://git.proxmox.com/git/mirror_iproute2
synced 2026-01-07 03:08:19 +00:00
bpf: rename bpf_parse_common() to bpf_parse_and_load_common()
bpf_parse_common() parses and loads the program. Rename it accordingly. Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com> Reviewed-by: Quentin Monnet <quentin.monnet@netronome.com> Acked-by: Daniel Borkmann <daniel@iogearbox.net>
This commit is contained in:
parent
3f0b9e620c
commit
399db8392b
@ -259,8 +259,8 @@ struct bpf_cfg_in {
|
||||
.off = 0, \
|
||||
.imm = 0 })
|
||||
|
||||
int bpf_parse_common(struct bpf_cfg_in *cfg, const struct bpf_cfg_ops *ops,
|
||||
void *nl);
|
||||
int bpf_parse_and_load_common(struct bpf_cfg_in *cfg,
|
||||
const struct bpf_cfg_ops *ops, void *nl);
|
||||
|
||||
const char *bpf_prog_to_default_section(enum bpf_prog_type type);
|
||||
|
||||
|
||||
@ -75,7 +75,7 @@ int xdp_parse(int *argc, char ***argv, struct iplink_req *req, bool generic,
|
||||
return xdp_delete(&xdp);
|
||||
}
|
||||
|
||||
if (bpf_parse_common(&cfg, &bpf_cb_ops, &xdp))
|
||||
if (bpf_parse_and_load_common(&cfg, &bpf_cb_ops, &xdp))
|
||||
return -1;
|
||||
|
||||
*argc = cfg.argc;
|
||||
|
||||
@ -898,7 +898,7 @@ static int lwt_parse_bpf(struct rtattr *rta, size_t len,
|
||||
int err;
|
||||
|
||||
nest = rta_nest(rta, len, attr);
|
||||
err = bpf_parse_common(&cfg, &bpf_cb_ops, &x);
|
||||
err = bpf_parse_and_load_common(&cfg, &bpf_cb_ops, &x);
|
||||
if (err < 0) {
|
||||
fprintf(stderr, "Failed to parse eBPF program: %s\n",
|
||||
strerror(-err));
|
||||
|
||||
@ -953,8 +953,8 @@ static int bpf_parse_opt_tbl(struct bpf_cfg_in *cfg,
|
||||
return 0;
|
||||
}
|
||||
|
||||
int bpf_parse_common(struct bpf_cfg_in *cfg, const struct bpf_cfg_ops *ops,
|
||||
void *nl)
|
||||
int bpf_parse_and_load_common(struct bpf_cfg_in *cfg,
|
||||
const struct bpf_cfg_ops *ops, void *nl)
|
||||
{
|
||||
bool opt_tbl[BPF_MODE_MAX] = {};
|
||||
|
||||
|
||||
@ -107,7 +107,7 @@ opt_bpf:
|
||||
cfg.argc = argc;
|
||||
cfg.argv = argv;
|
||||
|
||||
if (bpf_parse_common(&cfg, &bpf_cb_ops, n))
|
||||
if (bpf_parse_and_load_common(&cfg, &bpf_cb_ops, n))
|
||||
return -1;
|
||||
|
||||
argc = cfg.argc;
|
||||
|
||||
@ -102,7 +102,7 @@ opt_bpf:
|
||||
cfg.argc = argc;
|
||||
cfg.argv = argv;
|
||||
|
||||
if (bpf_parse_common(&cfg, &bpf_cb_ops, n))
|
||||
if (bpf_parse_and_load_common(&cfg, &bpf_cb_ops, n))
|
||||
return -1;
|
||||
|
||||
argc = cfg.argc;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user