]> git.baikalelectronics.ru Git - kernel.git/commitdiff
bpf: offload: rename the ifindex field
authorJakub Kicinski <jakub.kicinski@netronome.com>
Mon, 20 Nov 2017 23:21:53 +0000 (15:21 -0800)
committerDaniel Borkmann <daniel@iogearbox.net>
Mon, 20 Nov 2017 23:37:35 +0000 (00:37 +0100)
bpf_target_prog seems long and clunky, rename it to prog_ifindex.
We don't want to call this field just ifindex, because maps
may need a similar field in the future and bpf_attr members for
programs and maps are unnamed.

Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com>
Reviewed-by: Quentin Monnet <quentin.monnet@netronome.com>
Acked-by: Alexei Starovoitov <ast@kernel.org>
Acked-by: Daniel Borkmann <daniel@iogearbox.net>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
include/uapi/linux/bpf.h
kernel/bpf/offload.c
kernel/bpf/syscall.c
tools/include/uapi/linux/bpf.h

index e880ae6434eed9eb29db99169c716c94c7cf30aa..3f626df425168df08b21d4ea4efd658e5d71ab94 100644 (file)
@@ -262,7 +262,7 @@ union bpf_attr {
                __u32           kern_version;   /* checked when prog_type=kprobe */
                __u32           prog_flags;
                char            prog_name[BPF_OBJ_NAME_LEN];
-               __u32           prog_target_ifindex;    /* ifindex of netdev to prep for */
+               __u32           prog_ifindex;   /* ifindex of netdev to prep for */
        };
 
        struct { /* anonymous struct used by BPF_OBJ_* commands */
index ac187f9ee182ec07efcecd19f2644872959d6afd..a778e5df7e265a614621df83e6b144d2507b76c2 100644 (file)
@@ -29,7 +29,7 @@ int bpf_prog_offload_init(struct bpf_prog *prog, union bpf_attr *attr)
        init_waitqueue_head(&offload->verifier_done);
 
        rtnl_lock();
-       offload->netdev = __dev_get_by_index(net, attr->prog_target_ifindex);
+       offload->netdev = __dev_get_by_index(net, attr->prog_ifindex);
        if (!offload->netdev) {
                rtnl_unlock();
                kfree(offload);
index 09badc37e86467bdef5923c52b4448b9eccc1d18..8e9d065bb7cd44b4ed375c743571ff98c2925493 100644 (file)
@@ -1118,7 +1118,7 @@ struct bpf_prog *bpf_prog_get_type_dev(u32 ufd, enum bpf_prog_type type,
 EXPORT_SYMBOL_GPL(bpf_prog_get_type_dev);
 
 /* last field in 'union bpf_attr' used by this command */
-#define        BPF_PROG_LOAD_LAST_FIELD prog_target_ifindex
+#define        BPF_PROG_LOAD_LAST_FIELD prog_ifindex
 
 static int bpf_prog_load(union bpf_attr *attr)
 {
@@ -1181,7 +1181,7 @@ static int bpf_prog_load(union bpf_attr *attr)
        atomic_set(&prog->aux->refcnt, 1);
        prog->gpl_compatible = is_gpl ? 1 : 0;
 
-       if (attr->prog_target_ifindex) {
+       if (attr->prog_ifindex) {
                err = bpf_prog_offload_init(prog, attr);
                if (err)
                        goto free_prog;
index e880ae6434eed9eb29db99169c716c94c7cf30aa..3f626df425168df08b21d4ea4efd658e5d71ab94 100644 (file)
@@ -262,7 +262,7 @@ union bpf_attr {
                __u32           kern_version;   /* checked when prog_type=kprobe */
                __u32           prog_flags;
                char            prog_name[BPF_OBJ_NAME_LEN];
-               __u32           prog_target_ifindex;    /* ifindex of netdev to prep for */
+               __u32           prog_ifindex;   /* ifindex of netdev to prep for */
        };
 
        struct { /* anonymous struct used by BPF_OBJ_* commands */