From 399db8392bd720588c5355ad79907e9c515e86ac Mon Sep 17 00:00:00 2001 From: Jakub Kicinski Date: Thu, 23 Nov 2017 18:12:02 -0800 Subject: [PATCH] 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 Reviewed-by: Quentin Monnet Acked-by: Daniel Borkmann --- include/bpf_util.h | 4 ++-- ip/iplink_xdp.c | 2 +- ip/iproute_lwtunnel.c | 2 +- lib/bpf.c | 4 ++-- tc/f_bpf.c | 2 +- tc/m_bpf.c | 2 +- 6 files changed, 8 insertions(+), 8 deletions(-) diff --git a/include/bpf_util.h b/include/bpf_util.h index 8e39a2d4..da2dee8b 100644 --- a/include/bpf_util.h +++ b/include/bpf_util.h @@ -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); diff --git a/ip/iplink_xdp.c b/ip/iplink_xdp.c index 993e44d7..edaec2a2 100644 --- a/ip/iplink_xdp.c +++ b/ip/iplink_xdp.c @@ -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; diff --git a/ip/iproute_lwtunnel.c b/ip/iproute_lwtunnel.c index 62dc0cd8..740da7c6 100644 --- a/ip/iproute_lwtunnel.c +++ b/ip/iproute_lwtunnel.c @@ -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)); diff --git a/lib/bpf.c b/lib/bpf.c index 52f7c790..9a086712 100644 --- a/lib/bpf.c +++ b/lib/bpf.c @@ -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] = {}; diff --git a/tc/f_bpf.c b/tc/f_bpf.c index a38ec2ab..21ba759c 100644 --- a/tc/f_bpf.c +++ b/tc/f_bpf.c @@ -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; diff --git a/tc/m_bpf.c b/tc/m_bpf.c index f2ce3892..e275afd0 100644 --- a/tc/m_bpf.c +++ b/tc/m_bpf.c @@ -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; -- 2.39.5