]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commitdiff
bpf: revert report offload info to user space
authorJakub Kicinski <jakub.kicinski@netronome.com>
Mon, 20 Nov 2017 23:21:59 +0000 (15:21 -0800)
committerDaniel Borkmann <daniel@iogearbox.net>
Mon, 20 Nov 2017 23:37:35 +0000 (00:37 +0100)
This reverts commit bd601b6ada11 ("bpf: report offload info to user
space").  The ifindex by itself is not sufficient, we should provide
information on which network namespace this ifindex belongs to.
After considering some options we concluded that it's best to just
remove this API for now, and rework it in -next.

Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
include/linux/bpf.h
include/uapi/linux/bpf.h
kernel/bpf/offload.c
kernel/bpf/syscall.c

index 37bbab8c0f56eb35eb56628bcf7b3fa4d67b6646..76c577281d78da19721b637bf4fd3b0d99b34270 100644 (file)
@@ -515,7 +515,6 @@ static inline struct bpf_prog *bpf_prog_get_type(u32 ufd,
 
 int bpf_prog_offload_compile(struct bpf_prog *prog);
 void bpf_prog_offload_destroy(struct bpf_prog *prog);
-u32 bpf_prog_offload_ifindex(struct bpf_prog *prog);
 
 #if defined(CONFIG_NET) && defined(CONFIG_BPF_SYSCALL)
 int bpf_prog_offload_init(struct bpf_prog *prog, union bpf_attr *attr);
index 3f626df425168df08b21d4ea4efd658e5d71ab94..4c223ab30293cd1e07248b960e213c7f22b778c5 100644 (file)
@@ -897,10 +897,6 @@ enum sk_action {
 
 #define BPF_TAG_SIZE   8
 
-enum bpf_prog_status {
-       BPF_PROG_STATUS_DEV_BOUND       = (1 << 0),
-};
-
 struct bpf_prog_info {
        __u32 type;
        __u32 id;
@@ -914,8 +910,6 @@ struct bpf_prog_info {
        __u32 nr_map_ids;
        __aligned_u64 map_ids;
        char name[BPF_OBJ_NAME_LEN];
-       __u32 ifindex;
-       __u32 status;
 } __attribute__((aligned(8)));
 
 struct bpf_map_info {
index d4267c674fec1b1a08cee9f5f074b3eeb2767826..68ec884440b75da08824249db74bb992f6d938ce 100644 (file)
@@ -149,18 +149,6 @@ int bpf_prog_offload_compile(struct bpf_prog *prog)
        return bpf_prog_offload_translate(prog);
 }
 
-u32 bpf_prog_offload_ifindex(struct bpf_prog *prog)
-{
-       struct bpf_dev_offload *offload = prog->aux->offload;
-       u32 ifindex;
-
-       rtnl_lock();
-       ifindex = offload->netdev ? offload->netdev->ifindex : 0;
-       rtnl_unlock();
-
-       return ifindex;
-}
-
 const struct bpf_prog_ops bpf_offload_prog_ops = {
 };
 
index 41509cf825d8c33d8fb659c0aeb1ceea9c4455a5..2c4cfeaa8d5e785f16758be08cb8a462766363d9 100644 (file)
@@ -1616,11 +1616,6 @@ static int bpf_prog_get_info_by_fd(struct bpf_prog *prog,
                        return -EFAULT;
        }
 
-       if (bpf_prog_is_dev_bound(prog->aux)) {
-               info.status |= BPF_PROG_STATUS_DEV_BOUND;
-               info.ifindex = bpf_prog_offload_ifindex(prog);
-       }
-
 done:
        if (copy_to_user(uinfo, &info, info_len) ||
            put_user(info_len, &uattr->info.info_len))