Skip to content

Commit 1ee6400

Browse files
Jakub Kicinskiborkmann
authored andcommitted
bpf: revert report offload info to user space
This reverts commit bd601b6 ("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>
1 parent 51aa423 commit 1ee6400

File tree

4 files changed

+0
-24
lines changed

4 files changed

+0
-24
lines changed

include/linux/bpf.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -515,7 +515,6 @@ static inline struct bpf_prog *bpf_prog_get_type(u32 ufd,
515515

516516
int bpf_prog_offload_compile(struct bpf_prog *prog);
517517
void bpf_prog_offload_destroy(struct bpf_prog *prog);
518-
u32 bpf_prog_offload_ifindex(struct bpf_prog *prog);
519518

520519
#if defined(CONFIG_NET) && defined(CONFIG_BPF_SYSCALL)
521520
int bpf_prog_offload_init(struct bpf_prog *prog, union bpf_attr *attr);

include/uapi/linux/bpf.h

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -897,10 +897,6 @@ enum sk_action {
897897

898898
#define BPF_TAG_SIZE 8
899899

900-
enum bpf_prog_status {
901-
BPF_PROG_STATUS_DEV_BOUND = (1 << 0),
902-
};
903-
904900
struct bpf_prog_info {
905901
__u32 type;
906902
__u32 id;
@@ -914,8 +910,6 @@ struct bpf_prog_info {
914910
__u32 nr_map_ids;
915911
__aligned_u64 map_ids;
916912
char name[BPF_OBJ_NAME_LEN];
917-
__u32 ifindex;
918-
__u32 status;
919913
} __attribute__((aligned(8)));
920914

921915
struct bpf_map_info {

kernel/bpf/offload.c

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -149,18 +149,6 @@ int bpf_prog_offload_compile(struct bpf_prog *prog)
149149
return bpf_prog_offload_translate(prog);
150150
}
151151

152-
u32 bpf_prog_offload_ifindex(struct bpf_prog *prog)
153-
{
154-
struct bpf_dev_offload *offload = prog->aux->offload;
155-
u32 ifindex;
156-
157-
rtnl_lock();
158-
ifindex = offload->netdev ? offload->netdev->ifindex : 0;
159-
rtnl_unlock();
160-
161-
return ifindex;
162-
}
163-
164152
const struct bpf_prog_ops bpf_offload_prog_ops = {
165153
};
166154

kernel/bpf/syscall.c

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1616,11 +1616,6 @@ static int bpf_prog_get_info_by_fd(struct bpf_prog *prog,
16161616
return -EFAULT;
16171617
}
16181618

1619-
if (bpf_prog_is_dev_bound(prog->aux)) {
1620-
info.status |= BPF_PROG_STATUS_DEV_BOUND;
1621-
info.ifindex = bpf_prog_offload_ifindex(prog);
1622-
}
1623-
16241619
done:
16251620
if (copy_to_user(uinfo, &info, info_len) ||
16261621
put_user(info_len, &uattr->info.info_len))

0 commit comments

Comments
 (0)